void Update() { if (controller.GetGameState() == GameState.Play) { if (bloodRecorder.getBlood() <= 0) { this.gameObject.SetActive(false); Singleton <GameEventManager> .Instance.PlayerDead(); } } }
void Update() { if (controller.GetGameState() == GameState.Play) { if (bloodRecorder.getBlood() <= 0) { this.gameObject.SetActive(false); Singleton <GameEventManager> .Instance.NPCDead(this.gameObject); } else { target = controller.getPlayerPosition(); NavMeshAgent agent = GetComponent <NavMeshAgent>(); agent.SetDestination(target); } } }