WXMC/proj/unity/Assets/WishGodPageUI.cs
2024-12-04 16:18:46 +08:00

78 lines
1.7 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
public class WishGodPageUI : MonoBehaviour
{
[SerializeField]
private bool m_isLock;
public GameObject lockedPanel;
public GameObject lockedGroup;
public GameObject unlockGroup;
public GameObject wishRing;
public GameObject wishGroup;
public string LeftScene;
public string RightScene;
private LotsManager lotsManager;
public bool isLock {
get
{
return m_isLock;
}
set
{
m_isLock = value;
RefreshWishGodPageUI();
}
}
private void Awake()
{
RefreshWishGodPageUI();
}
private void OnEnable()
{
if (wishRing) { wishRing.SetActive(true); }
Debug.Log("OnEnable" + name);
RefreshWishGodPageUI();
}
private void OnDisable()
{
if (wishRing) { wishRing.SetActive(false); }
}
private void Start()
{
RefreshWishGodPageUI();
/* Add DrawLot to Wish Ring */
lotsManager = GetComponentInChildren<LotsManager>();
//if (wishRing) wishRing.GetComponentInChildren<Button>().onClick.AddListener(lotsManager.DrawLot);
}
void RefreshWishGodPageUI()
{
if (m_isLock)
{
unlockGroup.SetActive(false);
if (wishRing) wishRing.SetActive(false);
lockedGroup.SetActive(true);
lockedPanel.SetActive(true);
}
else
{
unlockGroup.SetActive(true);
if (wishRing) wishRing.SetActive(true);
lockedGroup.SetActive(false);
lockedPanel.SetActive(false);
}
}
}