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

public class ResultCheck : ViewEntity
{
    public bool win;
    
    // Start is called before the first frame update
    void Start()
    {
        
    }

    private void OnTriggerEnter(Collider other)
    {
        if (other.gameObject.layer == HoppingBattleController.layerPlayer)
        {
            var player = other.gameObject.GetComponentInParent<PlayerEntity>();
            if (win)
            {
                player.OnWin();
            }
            else
            {
                player.ReceiveDeadlyDamage(null);
            }
        }
    }

    // Update is called once per frame
    void Update()
    {
        
    }
}
