コード例 #1
0
 private void OnTriggerExit2D(Collider2D collision)
 {
     if (collision.GetComponent <CompositeCollider2D>() != null)
     {
         if (!swat.IsCharging())
         {
             swat.ChangeDir();
         }
     }
 }
コード例 #2
0
 // Update is called once per frame
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (preso != null && preso.peacefull == true)
     {
         preso.ChangeDir();
     }
     else if (swat != null)
     {
         swat.ChangeDir();
     }
 }