示例#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)));
 }