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); }
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; } }
public void SetObject(AEnemyBody aEnemyBody) { someobject = aEnemyBody; aEnemyBody.DestroySelf += ObjectDestroyed; }