Пример #1
0
 override public void OnSight(Observable o)
 {
     if (o.GetComponent <Attackable> () && m_attackable.CanAttack(o.GetComponent <Attackable> ().Faction))
     {
         Fighter.CurrentTarget = o.GetComponent <Attackable> ();
         NextTask();
         return;
     }
 }
Пример #2
0
 internal void OnTriggerEnter2D(Collider2D other)
 {
     Debug.Log("Hit Something: " + other.gameObject);
     if (other.GetComponent <Attackable> () != null &&
         m_attackable.CanAttack(other.GetComponent <Attackable> ().Faction))
     {
         m_attackable.DamageObj(DamageOnContactEnemy);
     }
 }
Пример #3
0
 protected bool canAttack(Attackable atkObj)
 {
     return(!(!atkObj || (atkObj.gameObject == Creator) || m_collidedObjs.Contains(atkObj) || !atkObj.CanAttack(Faction)));
 }