コード例 #1
0
 protected void OnTriggerEnter(Collider co)
 {
     if (co.tag == "Turret" && co is BoxCollider)
     {
         CannonFire cf = co.gameObject.GetComponent <CannonFire> ();
         if (cf != null)
         {
             NeuralNode node = cf.GetNode();
             if (node != null)
             {
                 towersToConfound [node] = new List <int> ();
             }
         }
     }
 }
コード例 #2
0
 protected virtual void OnTriggerExit(Collider co)
 {
     if (co.tag == "Turret" && co is BoxCollider)
     {
         CannonFire cf = co.gameObject.GetComponent <CannonFire> ();
         if (cf != null)
         {
             NeuralNode node = cf.GetNode();
             if (node != null)
             {
                 List <int> confoundedIndices = towersToConfound [node];
                 node.ResetWeights(confoundedIndices);
                 node.RemoveFromEnemiesToInform(this);
                 node.InformEnemies(confoundedIndices);
             }
         }
     }
 }    //OnTriggerExit()