using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; /// /// 底部栏界面 /// public class SwithPanel : MonoBehaviour { [SerializeField] private Button storeButton; [SerializeField] private Button drawingButton; [SerializeField] private Button shopButton; [SerializeField] private Button battleButton; // Start is called before the first frame update void Start() { } private void OnEnable() { storeButton.onClick.AddListener(StoreEvent); drawingButton.onClick.AddListener(DrawingEvent); shopButton.onClick.AddListener(ShopEvent); battleButton.onClick.AddListener(BattleEvent); } // Update is called once per frame void Update() { } private void OnDisable() { storeButton.onClick.RemoveListener(StoreEvent); drawingButton.onClick.RemoveListener(DrawingEvent); shopButton.onClick.RemoveListener(ShopEvent); battleButton.onClick.RemoveListener(BattleEvent); } private void StoreEvent() { UIMgr.ins.OpenStorePanel(); } private void DrawingEvent() { UIMgr.ins.OpenDrawingPanel(); } private void ShopEvent() { UIMgr.ins.OpenForgePanel(); } private void BattleEvent() { UIMgr.ins.OpenBattlePanel(); } }