예제 #1
0
 void Update()
 {
     if (controller.GetGameState() == GameState.Play)
     {
         if (bloodRecorder.getBlood() <= 0)
         {
             this.gameObject.SetActive(false);
             Singleton <GameEventManager> .Instance.PlayerDead();
         }
     }
 }
예제 #2
0
 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);
         }
     }
 }