Cute_demon_attacks/meng_yao/Assets/script/scene_Main/DownPanel.cs
2024-12-29 23:34:20 +08:00

34 lines
833 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
public class DownPanel : Base
{
public List<Button> btns = new List<Button>();
public List<GameObject> PanelList=new List<GameObject>();
public GameObject canvse;
public StaminaBar _staminaBar;
// Start is called before the first frame update
void Start()
{
btns[0].onClick.AddListener(async() => {
btns[0].enabled = false;
Invoke("RecoverBtn",2f);
await ButtonClickAnimationAsync(btns[0].gameObject);
GameObject.Instantiate(PanelList[0], canvse.transform).GetComponent<Battle_Selection>()._staminaBar=this._staminaBar;
});
}
void RecoverBtn()
{
btns[0].enabled = true;
}
}