using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerCollision : MonoBehaviour
{
    public int DmgFromEnemy = 50;
    public int DmgFromOther = 10;

    private IPlayer player;

    public void Start()
    {
        player = GetComponent<IPlayer>();
    }

    public void OnTriggerEnter(Collider other)
{
        var enemy = other.GetComponent<IEnemy>();
        player.Health -= enemy is object
            ? DmgFromEnemy
            : DmgFromOther;
    }
}
