public override void OnShow(object msg) { base.OnShow(msg); m_LeapState = LEAP_PHASE.NORMAL; m_CurrentIndex = -1; m_Root.gameObject.SetActive(true); ResetJumpPoints(); AddHotKey("f_hold", HotKeyMapID.SHIP, HotKeyID.LeapStart, HOLD_TIME, OnHoldKeyEvent, m_HotKeyBox, "Transition", HotkeyManager.HotkeyStyle.HUMAN_INTERACTIVE); AddHotKey("f_press", HotKeyMapID.SHIP, HotKeyID.LeapStop, OnPressKeyEvent, m_HotKeyBox, "Cancel the transition", HotkeyManager.HotkeyStyle.HUMAN_INTERACTIVE); SetHotKeyVisible("f_hold", true); SetHotKeyVisible("f_press", false); StartUpdate(); }
/// <summary> /// 设置跃迁状态 /// </summary> /// <param name="newState">新的跃迁状态</param> private void SetLeapState(LEAP_PHASE newState) { if (m_LeapState == newState) { return; } //Debug.LogError(" -> " + m_LeapState + " > " + newState + " : " + m_CurrentIndex); m_LeapState = newState; m_ReadyBox.gameObject.SetActive(m_LeapState == LEAP_PHASE.READY); if (m_LeapState == LEAP_PHASE.NORMAL && m_CurrentIndex != -1) { m_HotKeyBox.SetParent(m_PointBox.GetChild(m_CurrentIndex).Find("JumpTips/TextBox/HotKeyBox")); m_HotKeyBox.gameObject.SetActive(false); m_HotKeyBox.gameObject.SetActive(true); SetHotKeyVisible("f_hold", true); SetHotKeyVisible("f_press", false); } else if (m_LeapState == LEAP_PHASE.READY) { m_HotKeyBox.SetParent(m_ReadyHotkeyBox); m_HotKeyBox.gameObject.SetActive(false); m_HotKeyBox.gameObject.SetActive(true); SetHotKeyVisible("f_hold", false); SetHotKeyVisible("f_press", true); } else { m_HotKeyBox.gameObject.SetActive(false); m_HotKeyBox.SetParent(GetTransform()); SetHotKeyVisible("f_hold", false); SetHotKeyVisible("f_press", false); } }