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

40 lines
1.0 KiB
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;
[Header("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>ʾ<EFBFBD><CABE>ťobj")] public GameObject IconTipObj;
2024-12-09 18:01:59 +08:00
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();
2024-12-12 23:04:13 +08:00
//Debug.Log("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
2024-12-09 18:01:59 +08:00
btnObj.SetActive(true);
btnObj.GetComponent<Button>().onClick.AddListener(() => {
IconTipObj.gameObject.SetActive(true);
2024-12-09 23:24:46 +08:00
btnObj.SetActive(false);
2024-12-09 18:01:59 +08:00
});
}
}
}