/// <summary> /// 设置是否接收射线 /// </summary> /// <param name="state"></param> public virtual void SetUIState(EnumUIState state) { active = state == EnumUIState.Enable ? true : false; if (!active) { StopAllCoroutines(); cg.alpha = 1; transform.localScale = Vector3.one; } }
/// <summary> /// 设置是否接收射线 /// </summary> /// <param name="state"></param> protected virtual void OnUIStateChanged(EnumUIState state) { active = state == EnumUIState.Enable ? true : false; if (!active) { StopAllCoroutines(); cg.alpha = 1; transform.localScale = Vector3.one; } }
public event Action <InputWheelInfo> onSpunWheel; //鼠标滑轮事件 public void Init() { currentState = EnumUIState.Enable; // 光标是否初始化 if (Input.mousePresent) { mouseInfos = new InputMouseButtonInfo[trackMouseButtons]; cursorInfo = new InputCursorInfo { currentPosition = Input.mousePosition }; for (int i = 0; i < mouseInfos.Length; ++i) { mouseInfos[i] = new InputMouseButtonInfo { mouseButtonId = i, currentPosition = Input.mousePosition }; } } //UnityInput.simulateMouseWithTouches = false; }
/// <summary> /// 设置UI是否可用 /// </summary> /// <param name="state"></param> public void setUIState(EnumUIState state) { currentState = state; onUIStateChanged?.Invoke(currentState); }
/// <summary> /// 设置状态 /// </summary> /// <param name="state"></param> public override void SetUIState(EnumUIState state) { base.SetUIState(state); }