コード例 #1
0
ファイル: DamagingSurface.cs プロジェクト: Titwin/LD44
 private void OnCollisionEnter2D(Collision2D collision)
 {
     if (targetMask == (targetMask | (1 << collision.gameObject.layer)))
     {
         Attackable target = collision.gameObject.GetComponent <Attackable>();
         if (target != null)
         {
             target.DoDamage(this.gameObject, damage);
         }
     }
 }