using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class JCFruitMaster : MonoBehaviour { [SerializeField] Canvas menuUI; [SerializeField] Canvas gamingUI; [SerializeField] GameObject btnStart; [SerializeField] GameObject btnResume; bool _mouseAwaked = true; bool _needMouseAwaked; [SerializeField] Image aimingCross; public static JCFruitMaster ins; void Start() { ins = this; menuUI.sortingOrder = 4; gamingUI.sortingOrder = 4; } void OnDestroy() { if (ins == this) ins = null; } void Update() { _needMouseAwaked = btnStart.activeInHierarchy || btnResume.activeInHierarchy; if (_mouseAwaked && !_needMouseAwaked) { SimulateMouseController.ins?.RemoveOpenLocker("NotGame"); _mouseAwaked = false; } else if (!_mouseAwaked && _needMouseAwaked) { SimulateMouseController.ins?.AddOpenLocker("NotGame"); _mouseAwaked = true; } aimingCross.enabled = !SB_EventSystem.ins.simulateMouseIsAwaked; } public void ResetAim() { if (_needMouseAwaked) { AimHandler.ins?.DoIdentity(); } else { AutoResetView.DoIdentity(); } } }