示例#1
0
 private void OnCollisionEnter2D(Collision2D collision)
 {
     if (collision.gameObject.CompareTag(Tags.TARGET_TAG))
     {
         var target = collision.gameObject.GetComponent <Target>();
         var health = target.GetComponent <Health>();
         if (!target.IsDestroying)
         {
             health.CurrentValue -= Damage;
             CollisionEntered?.Invoke();
         }
         Holder.ReturnBulletToHolder(this);
     }
 }
示例#2
0
 private void OnCollisionEnter2D(Collision2D collision)
 {
     CollisionEntered?.Invoke(collision);
 }
示例#3
0
 private void OnCollisionEnter2D(Collision2D collision)
 {
     CollisionEntered?.Invoke(gameObject);
     //Time.timeScale = 0.5f;
 }
示例#4
0
 private void OnCollisionEnter(Collision collision)
 {
     CollisionEntered?.Invoke(collision);
 }