summaryrefslogtreecommitdiff
path: root/Other/NavMeshTest/Assets/Scripts/Prop/Door.cs
blob: d222797391542902f5dde86ad798cebc090adebc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.AI;

public class Door : Switchable
{
	public Transform plank;

    public override void OnSwitch(bool on)
    {
		plank.GetComponent<MeshRenderer>().enabled = !on;
		plank.GetComponent<NavMeshObstacle>().enabled = !on;
    }
}