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(); } }
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(); } } }