Global Game Jam 2022
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

32 lines
643 B

using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using Variables;
public class ChestController : MonoBehaviour
{
[SerializeField, Header("References")]
private Animator m_chestAnimator;
[SerializeField]
private Reference<bool> m_freezePlayer;
[SerializeField]
private Reference<bool> m_isVictory;
private void OnTriggerEnter2D(Collider2D collision)
{
if (collision.CompareTag("Player"))
{
m_chestAnimator.SetBool("Open", true);
m_freezePlayer.Value = true;
m_isVictory.Value = true;
}
}
}