Beispiel #1
0
    /// <summary>
    /// 重建视图
    /// </summary>
    private void RebuildView(string describe = null)
    {
        DeleteHotKey("f");

        bool isBattle = IsBattling();

        HotKeyMapID   hotKeyMapID = IsInSpace() ? HotKeyMapID.SHIP : HotKeyMapID.HUMAN;
        string        hotKeyID    = m_MustUseHumanFBox ? HotKeyID.LeapStart : IsInSpace() ? HotKeyID.InteractiveForShip : HotKeyID.InteractiveForHuman;
        RectTransform box         = (!IsInSpace() || m_MustUseHumanFBox) ? m_HumanBox : m_ShipBox;
        string        text        = !string.IsNullOrEmpty(describe) ? TableUtil.GetLanguageString(describe) : "Interactoin";

        HotkeyManager.HotkeyStyle hotkeyStyle = (!IsInSpace() || m_MustUseHumanFBox) ? HotkeyManager.HotkeyStyle.HUMAN_INTERACTIVE : HotkeyManager.HotkeyStyle.SHIP_INTERACTIVE;

        if (m_FocusNpcTid != 0)
        {
            float time = 0;
            switch (m_FocusNpcVO.InteractionType)
            {
            case 0: time = 0.0f; break;

            case 1: time = 0.0f; break;

            case 2: time = 0.0f; break;

            case 3: time = 0.6f; break;
            }

            AddHotKey("f", hotKeyMapID, hotKeyID, OnHotKeyCallbackByHold, time, box, text, hotkeyStyle);
        }

        bool tipShowed = false;

        for (int i = 0; i < m_OtherTipBox.childCount; i++)
        {
            Transform          child   = m_OtherTipBox.GetChild(i);
            InteractiveTipType tipType = (InteractiveTipType)i;
            bool enabled = false;
            if (tipType == InteractiveTipType.LockChest)
            {
                enabled = /* m_FocusNpcTid == 0 &&*/ !tipShowed /*&& !isBattle*/ && m_CurrentTipTypes.ContainsKey(tipType) && m_CurrentTipTypes[tipType];
            }
            else
            {
                enabled = m_FocusNpcTid == 0 && !tipShowed && !isBattle && m_CurrentTipTypes.ContainsKey(tipType) && m_CurrentTipTypes[tipType];
            }

            child.gameObject.SetActive(enabled);
            if (enabled)
            {
                tipShowed = true;
                Transform hotkeyBox = child.Find("HotKey");
                if (hotkeyBox != null)
                {
                    AddHotKey("f", hotKeyMapID, HotKeyID.ShipSwitchMode, OnHotKeyCallbackByTip, hotkeyBox, string.Empty, HotkeyManager.HotkeyStyle.UI_SIMPLE);
                }
            }
        }
    }
Beispiel #2
0
 /// <summary>
 /// 当前输入表改变时
 /// </summary>
 /// <param name="a">改变前的输入表</param>
 /// <param name="b">改变后的输入表</param>
 private void OnInputMapChanged(HotKeyMapID b)
 {
     OnInputMapChanged();
 }
 /// <summary>
 /// 输入表改变时
 /// </summary>
 /// <param name="a"></param>
 /// <param name="b"></param>
 private void OnInputMapChanged(HotKeyMapID b)
 {
     m_EscPressed = false;
 }
Beispiel #4
0
 private void OnInputMapChanged(HotKeyMapID arg2)
 {
     m_EngineAxis   = Vector3.zero;
     m_CameraVector = Vector3.zero;
 }
Beispiel #5
0
 private void OnInputMapChanged(HotKeyMapID arg2)
 {
     m_EngineAxis = Vector3.zero;
     m_MouseStick = Vector3.zero;
 }
Beispiel #6
0
 /// <summary>
 /// 输入表改变时
 /// </summary>
 /// <param name="oldMap"></param>
 /// <param name="newMap"></param>
 private void OnInputMapChanged(HotKeyMapID newMap)
 {
     UpdateCursorStyle();
 }