aboutsummaryrefslogtreecommitdiffstats
path: root/Assets/Scripts/BottomlessPit.cs
blob: 01ee21160f366bbb9999f2561e4b4eafa3201a9c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
using MontanaJohns.Actors;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class BottomlessPit : MonoBehaviour
{
    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (LayerMask.LayerToName(collision.gameObject.layer) == "Enemy" || LayerMask.LayerToName(collision.gameObject.layer) == "Player")
        {
            if(collision.gameObject.tag == "Player")
            {
                collision.gameObject.GetComponent<Actor>().TakeDamage(999);
            }
            else
            {
                Destroy(collision.gameObject);
            }
        }
    }
}