summaryrefslogtreecommitdiff
path: root/Other/NavMeshTest/Assets/Scripts/Prop/Door.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Other/NavMeshTest/Assets/Scripts/Prop/Door.cs')
-rw-r--r--Other/NavMeshTest/Assets/Scripts/Prop/Door.cs15
1 files changed, 15 insertions, 0 deletions
diff --git a/Other/NavMeshTest/Assets/Scripts/Prop/Door.cs b/Other/NavMeshTest/Assets/Scripts/Prop/Door.cs
new file mode 100644
index 0000000..d222797
--- /dev/null
+++ b/Other/NavMeshTest/Assets/Scripts/Prop/Door.cs
@@ -0,0 +1,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;
+ }
+}