| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- 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<Canvas>();
- }
- 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()
- {
- }
- }
|