Cute_demon_attacks/meng_yao/Assets/script/A_Fight/cardBox.cs
2024-12-12 23:04:13 +08:00

40 lines
1.0 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class cardBox : MonoBehaviour
{
public static cardBox instance;
[Header("萌妖数量")] public int mengyaoNumber=0;
[HideInInspector] public int inPlaceNumber=0;
[Header("开始按钮obj")] public GameObject btnObj;
[Header("怪物信息提示按钮obj")] public GameObject IconTipObj;
private void Awake()
{
instance = this;
if (btnObj==null)
{
Debug.LogError("btnObj==null");
return;
}
btnObj.SetActive(false);
}
public void ChangeInPlaceNumber(int number)
{
inPlaceNumber += number;
if (inPlaceNumber== mengyaoNumber)
{
gameGlobal.GameStart();
//Debug.Log("布置完成");
btnObj.SetActive(true);
btnObj.GetComponent<Button>().onClick.AddListener(() => {
IconTipObj.gameObject.SetActive(true);
btnObj.SetActive(false);
});
}
}
}