コード例 #1
0
    private void OnTriggerEnter(Collider other)
    {
        script_boidGroup bG = other.GetComponent <script_boidGroup>();

        if (bG && bG.GetTeam() == teamIndex && next)
        {
            bG.waypoint = next;
        }
    }
コード例 #2
0
 private void OnCollisionEnter(Collision collision)
 {
     if (collision.gameObject.tag == "Enemy")
     {
         if (collision.gameObject.GetComponent <Script_BoidsBehaviour>().group.GetTeam() != group.GetTeam())
         {
             collision.gameObject.GetComponent <script_enemyInteractions>().Damage(1);
         }
     }
 }