123456789101112131415161718192021222324252627282930313233 |
- using System;
- using UnityEngine;
- namespace Fort23.Mono
- {
- public class UIToggleObjectCustomStateWidget : UIToggleWidgetBasic
- {
- public CustomStateController CustomStateController;
-
- [HideInInspector] public Action showCallback;
- [HideInInspector] public Action hideCallback;
- private void Awake()
- {
- if (CustomStateController == null)
- {
- CustomStateController = gameObject.GetComponent<CustomStateController>();
- }
- }
- public override void Show()
- {
- CustomStateController?.ChangeState(1);
- showCallback?.Invoke();
- }
- public override void Hind()
- {
- CustomStateController?.ChangeState(0);
- hideCallback?.Invoke();
- }
- }
- }
|