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,44 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Door : MonoBehaviour
{
public Animator _ani;
public BoxCollider2D bx;
public bool isOpen=false;
public GameObject boss;
private void Awake()
{
_ani = GetComponentInChildren<Animator>();
bx = GetComponent<BoxCollider2D>();
boss = GameObject.FindWithTag("Boss");
}
private void Update()
{
if(isOpen)
{
Debug.Log("¿ªÃÅ");
_ani.Play("activate");
StartCoroutine(nameof(Open));
}
}
private void OnCollisionEnter2D(Collision2D collision)
{
if (collision.gameObject.CompareTag("Player")&&!isOpen)
{
UIManager.Instance.Show<UIOpen>();
}
}
private IEnumerator Open()
{
yield return new WaitForSeconds(7f);
bx.isTrigger = true;
boss.GetComponentInChildren<BossAI>().SetBegin(true);
isOpen=false;
this.gameObject.SetActive(false);
}
}