Cute_demon_attacks/meng_yao/Assets/script/A_Fight/cardBox.cs

39 lines
976 B
C#
Raw Normal View History

2024-12-09 18:01:59 +08:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class cardBox : MonoBehaviour
{
public static cardBox instance;
[Header("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>")] public int mengyaoNumber=0;
[HideInInspector] public int inPlaceNumber=0;
[Header("<22><>ʼ<EFBFBD><CABC>ťobj")] public GameObject btnObj;
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("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
btnObj.SetActive(true);
btnObj.GetComponent<Button>().onClick.AddListener(() => {
gameGlobal.GamePlay();
2024-12-09 23:24:46 +08:00
btnObj.SetActive(false);
2024-12-09 18:01:59 +08:00
});
}
}
}