|
@ -10,6 +10,7 @@ public class LightBeam : MonoBehaviour { |
|
|
// Use this for initialization
|
|
|
// Use this for initialization
|
|
|
void Start () { |
|
|
void Start () { |
|
|
NotificationServer.register("statechange Searchlight", toggleState); |
|
|
NotificationServer.register("statechange Searchlight", toggleState); |
|
|
|
|
|
NotificationServer.register("switch off", switchOff); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// Update is called once per frame
|
|
|
// Update is called once per frame
|
|
@ -26,4 +27,9 @@ public class LightBeam : MonoBehaviour { |
|
|
private void toggleState() { |
|
|
private void toggleState() { |
|
|
GetComponent<Animator>().SetBool("isSeen", (Searchlight.state == Searchlight.SearchState.Chasing)); |
|
|
GetComponent<Animator>().SetBool("isSeen", (Searchlight.state == Searchlight.SearchState.Chasing)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void switchOff() { |
|
|
|
|
|
lightBeam.gameObject.SetActive(false); |
|
|
|
|
|
target.gameObject.SetActive(false); |
|
|
|
|
|
} |
|
|
} |
|
|
} |