Exemple #1
0
 public virtual void OnTriggerEnter(Collider col)
 {
     if (tType == TurretType.CAPITAL)
     {
         ICAPTarget s = col.GetComponent <ICAPTarget> ();
         if (s != null)
         {
             if (s.isHostile(self.faction))
             {
                 targets.Add(s);
             }
         }
     }
     else if (tType == TurretType.PD)
     {
         IPDTarget s = col.GetComponent <IPDTarget> ();
         if (s != null)
         {
             if (s.isHostile(self.faction))
             {
                 pdTargets.Add(s);
             }
             SortList();
         }
     }
 }
Exemple #2
0
    public void OnTriggerEnter(Collider col)
    {
        IPDTarget t = col.GetComponent <IPDTarget> ();

        if (t != null)
        {
            if (t.isHostile(self.faction))
            {
                pdTargets.Add(t);
                //	ResetTarget ();
            }
        }
        ICAPTarget s = col.GetComponent <ICAPTarget> ();

        if (s != null)
        {
            if (s.isHostile(self.faction))
            {
                targets.Add(s);
                //	ResetTarget ();
            }
        }
    }