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

  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using UnityEngine;
  5. using Variables;
  6. public class ChestController : MonoBehaviour
  7. {
  8. [SerializeField, Header("References")]
  9. private Animator m_chestAnimator;
  10. [SerializeField]
  11. private Reference<bool> m_freezePlayer;
  12. [SerializeField]
  13. private Reference<bool> m_isVictory;
  14. private void OnTriggerEnter2D(Collider2D collision)
  15. {
  16. if (collision.CompareTag("Player"))
  17. {
  18. m_chestAnimator.SetBool("Open", true);
  19. m_freezePlayer.Value = true;
  20. m_isVictory.Value = true;
  21. }
  22. }
  23. }