예제 #1
0
    public override void Reason(GameObject gm, GameObject npc)
    {

        if (npc.transform.position.x == controlref.goalPos.x && npc.transform.position.y == controlref.goalPos.y)
        {
            /* Doesn't get called right now, and we like it, Happy little trees - Bob Ross
            if (gm.GetComponent<GameMasterFSM>().sameTileCollide(npc.gameObject))
            {
                npc.GetComponent<ActorFSM>().SetTransition(Transition.EnemyCollide1); //to enemyDead
                return;
            }*/
            gm.GetComponent<GameMasterFSM>().characters.Remove(npc);
            gm.GetComponent<GameMasterFSM>().actors.Remove(npc);
            controlref.destroyObj();
        }
    }
예제 #2
0
 public override void Act(GameObject gm, GameObject npc)
 {
     if (npc.tag == "Player")
     {
         //gm.GetComponent<GameMasterFSM>().characters.Remove(npc);
         //gm.GetComponent<GameMasterFSM>().actors.Remove(npc);
         //controlref.destroyObj();
         controlref.sr.enabled = false;
     }
     else if (npc.tag == "Enemy")
     {
         controlref.sprayShadows();
         gm.GetComponent<GameMasterFSM>().enemies.Remove(npc);
         gm.GetComponent<GameMasterFSM>().actors.Remove(npc);
         controlref.destroyObj();
     }
 }
예제 #3
0
 public override void Reason(GameObject gm, GameObject npc)
 {
     if (npc.transform.position.x == controlref.goalPos.x && npc.transform.position.y == controlref.goalPos.y)
     {
         if (npc.tag == "Player")
         {
             //gm.GetComponent<GameMasterFSM>().characters.Remove(npc);
             //gm.GetComponent<GameMasterFSM>().actors.Remove(npc);
             //controlref.destroyObj();
             controlref.sr.enabled = false;
         }
         else if (npc.tag == "Enemy")
         {
             controlref.sprayShadows();
             gm.GetComponent<GameMasterFSM>().enemies.Remove(npc);
             gm.GetComponent<GameMasterFSM>().actors.Remove(npc);
             controlref.destroyObj();
         }
     }
 }