예제 #1
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (IsUnit.isUnit(collision.gameObject))
     {
         HitWithVehicle(collision.gameObject);
     }
 }
예제 #2
0
 private void OnTriggerExit2D(Collider2D collision)
 {
     if (IsUnit.isUnit(collision.gameObject))
     {
         if (unitsInProximityDistance.Contains(collision.gameObject))
         {
             unitsInProximityDistance.Remove(collision.gameObject);
         }
     }
     UpdateRakeState();
 }
예제 #3
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (used)
     {
         return;
     }
     if (IsUnit.isUnit(collision.gameObject))
     {
         used = true;
         GetComponent <Animator>().SetTrigger("Trigger");
         victim = collision.gameObject;
         victim.GetComponent <Stats>().DealDamage(damageInPercent / 100.0f);
     }
 }