コード例 #1
0
ファイル: Bala.cs プロジェクト: JanerTorres/Star-quest
    private void OnTriggerEnter(Collider other)
    {
        NaveIA nia = other.GetComponent <NaveIA>();

        if (nia != null)
        {
            if (nia.bando != bando)
            {
                nia.CausarDaño(daño);
            }
        }
    }
コード例 #2
0
ファイル: Disparador.cs プロジェクト: JanerTorres/Star-quest
    private void OnTriggerEnter(Collider other)
    {
        NaveIA nia = other.GetComponent <NaveIA>();

        if (nia != null)
        {
            if (nia.bando != bando)
            {
                objetivo = other.gameObject;
            }
        }
    }
コード例 #3
0
ファイル: NaveIA.cs プロジェクト: JanerTorres/Star-quest
 void MirarEnemigo()
 {
     Collider[] cols = Physics.OverlapSphere(transform.position, rangoEnemigos);
     for (int i = 0; i < cols.Length; i++)
     {
         NaveIA nia = cols[i].gameObject.GetComponent <NaveIA>();
         if (nia != null)
         {
             if (nia.bando != bando)
             {
                 objetivo = cols[i].transform;
                 return;
             }
         }
     }
 }