using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using JC.Unity.UI; using JC.Unity; public class MouseConfirm : MonoBehaviour { [NonSerialized] public Selectable _targetSelectable; [NonSerialized] public Action OnResumeTarget; void Update() { if (!SB_EventSystem.ins.simulateMouseIsAwaked) { Hide(); return; } if (!_targetSelectable) { Hide(); } } void Show() { if (KeyBoardSelector.ins) return; if (!gameObject.activeSelf) gameObject.SetActive(true); } public void Hide() { ResumeTarget(); _targetSelectable = null; if (KeyBoardSelector.ins) return; if (gameObject.activeSelf) gameObject.SetActive(false); } public void OnClikc_Confirm(bool hide = true) { try { if (_targetSelectable && _targetSelectable.interactable) { Button btn = _targetSelectable.GetComponent