Browse Source

fixed hidding spot

master
Joshua Reason 8 years ago
parent
commit
06efa327da
4 changed files with 8 additions and 4 deletions
  1. +6
    -2
      IronToad_UnityProject/Assets/Scripts/HidingSpot.cs
  2. +2
    -2
      IronToad_UnityProject/Assets/Scripts/Searchlight.cs
  3. BIN
      IronToad_UnityProject/Assets/_Scenes/GreyBox_Prototype.unity
  4. BIN
      IronToad_UnityProject/Assets/water/Water.mat

+ 6
- 2
IronToad_UnityProject/Assets/Scripts/HidingSpot.cs View File

@ -17,13 +17,17 @@ public class HidingSpot : MonoBehaviour {
} }
void OnTriggerEnter(Collider other) { void OnTriggerEnter(Collider other) {
if (other.gameObject.CompareTag("Player"))
if (other.gameObject.CompareTag("Player")) {
Searchlight.playerHidden = true; Searchlight.playerHidden = true;
Debug.Log("player here");
}
} }
void OnTriggerExit(Collider other) { void OnTriggerExit(Collider other) {
if (other.gameObject.CompareTag("Player"))
if (other.gameObject.CompareTag("Player")) {
Searchlight.playerHidden = false; Searchlight.playerHidden = false;
Debug.Log("player exit");
}
} }
} }

+ 2
- 2
IronToad_UnityProject/Assets/Scripts/Searchlight.cs View File

@ -47,7 +47,7 @@ public class Searchlight : MonoBehaviour
void OnTriggerEnter(Collider other) void OnTriggerEnter(Collider other)
{ {
if (other.tag != "Player")
if (other.tag != "Player" || playerHidden )
return; return;
chased = other; chased = other;
isTriggering = true; isTriggering = true;
@ -64,7 +64,7 @@ public class Searchlight : MonoBehaviour
void OnTriggerExit(Collider other) void OnTriggerExit(Collider other)
{ {
if (other.tag != "Player" || playerHidden)
if (other.tag != "Player" )
return; return;
isTriggering = false; isTriggering = false;
if (state == SearchState.Chasing && !isTriggeringAtLeastOne()) if (state == SearchState.Chasing && !isTriggeringAtLeastOne())

BIN
IronToad_UnityProject/Assets/_Scenes/GreyBox_Prototype.unity View File


BIN
IronToad_UnityProject/Assets/water/Water.mat View File


Loading…
Cancel
Save