using System.Collections; using System.Collections.Generic; using JetBrains.Annotations; using UnityEngine; public interface IPinBallUIBase { void ShowUI(object[] args); void BroadcastUI(object[] args); void HideUI(); } public enum PinBallUILevel { BG, Content, Pop, } public class PinBallUIBase : MonoBehaviour, IPinBallUIBase { private bool m_bIsInit; protected Canvas canvas; public PinBallUILevel uILevel = PinBallUILevel.Content; public bool IsInit { get { return m_bIsInit; } } protected virtual void Init() { canvas = this.GetComponent(); } public void ShowUI(object[] args) { if (!m_bIsInit) { m_bIsInit = true; Init(); } //this.gameObject.SetActive(true); this.canvas.enabled = true; ShowUIOpt(args); } protected virtual void ShowUIOpt(object[] args) { } public void BroadcastUI(object[] args) { Broadcast(args); } protected virtual void Broadcast(object[] args) { } public void HideUI() { HideUIOpt(); //this.gameObject.SetActive(false); this.canvas.enabled = false; } protected virtual void HideUIOpt() { } }