Cute_demon_attacks/meng_yao/Assets/script/scene_Main/DownPanel.cs

34 lines
833 B
C#
Raw Normal View History

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>();
2024-12-13 05:40:51 +08:00
public List<GameObject> PanelList=new List<GameObject>();
public GameObject canvse;
2024-12-28 16:24:08 +08:00
public StaminaBar _staminaBar;
// Start is called before the first frame update
void Start()
{
btns[0].onClick.AddListener(async() => {
2024-12-29 23:34:20 +08:00
btns[0].enabled = false;
Invoke("RecoverBtn",2f);
await ButtonClickAnimationAsync(btns[0].gameObject);
2024-12-28 16:24:08 +08:00
GameObject.Instantiate(PanelList[0], canvse.transform).GetComponent<Battle_Selection>()._staminaBar=this._staminaBar;
2024-12-29 23:34:20 +08:00
});
}
2024-12-29 23:34:20 +08:00
void RecoverBtn()
{
btns[0].enabled = true;
}
}