using System; using System.Collections; using System.Collections.Generic; using UnityEngine; public class BoxOpenUI : MonoBehaviourSingletonTemplateBackKeyAdd { public GameObject[] gos; // 0 카메라, 1 아이템 박스, 2 황금 박스, 3 해골보석 박스 Action m_act; protected override void Awake() { base.Awake(); DontDestroy(); } public void Set(int _box, Action _act) { base.Set(); OptionInfo.Ins.Set_Light(false); DSUtil.InActivateGameObjects(gos); gos[0].SetActive(true); gos[_box].SetActive(true); m_act = _act; StartCoroutine(Co_Anim()); } IEnumerator Co_Anim() { SoundInfo.Ins.Play_OneShot(eSound.s005_BoxOpen, 0.15f); yield return new WaitForSeconds(4.2f); OnClick_Back(); } public override void OnClick_Back() { base.OnClick_Back(); DSUtil.InActivateGameObjects(gos); m_act?.Invoke(); OptionInfo.Ins.Set_Light(true); } }