예제 #1
0
 void OnEnemyKilled(AEnemyBody aEnemyBody)
 {
     transform.rotation = Quaternion.LookRotation((aEnemyBody.transform.position - transform.position).normalized);
     PlayAnimation(SoldierAnims.attack01);
     PlayAnimation(SoldierAnims.reset);
     scoreHandler.OnKilledEnemy(1);
     //Debug.Log(GetHashCode() + " Eat enemy");
     Eat(5);
 }
예제 #2
0
    public EnemyAI(int direction, float moverate, EnemyBody someEnemy = null)
    {
        MoveRate = moverate;
        GameManager.instanse.Iteration += OnItteration;

        this.direction = (Direction)(direction % 4);
        someobject     = someEnemy;
        if (someEnemy)
        {
            someobject.DestroySelf += ObjectDestroyed;
        }
    }
예제 #3
0
 public void SetObject(AEnemyBody aEnemyBody)
 {
     someobject              = aEnemyBody;
     aEnemyBody.DestroySelf += ObjectDestroyed;
 }