This commit is contained in:
JA
2026-06-20 19:34:23 +08:00
parent e5031c0068
commit d442805c3f
4136 changed files with 514641 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
using Manager;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class UIlottertOpen : MonoBehaviour
{
private Animator animator;
private bool isOpen=true;
private void Awake()
{
animator = GetComponentInChildren<Animator>();
}
private void OnTriggerStay2D(Collider2D collision)
{
if (Input.GetKeyDown(KeyCode.E)&&isOpen)
{
Debug.Log("Open Box");
isOpen = false;
animator.Play("Box");
SoundManager.Instance.PlaySound(SoundDefine.BoxOpen);
StartCoroutine(nameof(Open));
}
}
private void OnTriggerExit2D(Collider2D collision)
{
StopCoroutine(nameof(Open));
}
IEnumerator Open()
{
yield return new WaitForSeconds(1.2f);
UIManager.Instance.Show<UILottery>();
}
}