Ejemplo n.º 1
0
 void Awake()
 {
     //if (I is null)
     //{
     //    I = this;
     //}
     I               = this;
     hero            = pfHero.GetComponent <HeroState>();
     hero.EventDead += DestoryPawn;
     hero.EventDead += GameFailCallBack;
 }
Ejemplo n.º 2
0
 public void DestoryPawn(PawnState pawn)
 {
     if (pawn is EnemyState)
     {
         var item = enemyList.Find(it => it == pawn);
         enemyList.Remove(item);
     }
     else
     if (pawn is HeroState)
     {
         hero = null;
     }
     GameObject.Destroy(pawn.gameObject);
 }
Ejemplo n.º 3
0
 void Start()
 {
     pawn = transform.GetComponent <PawnController>();
     hero = transform.GetComponent <HeroState>();
     claw = transform.GetComponentInChildren <ClawController>();
 }