override public void OnUpdate() { if (View.detectMouseInWnd()) { m_HideTime = Time.time; } // 时间超过3s,隐藏外框 if (m_HideTime > 0f && m_HideTime + 3f <= Time.time) { View.SetHide(true); m_HideTime = 0f; } // 输入框激活状态是否变化 if (View.m_isInputFieldFocus != View.inputField.isFocused) { if (View.m_isInputFieldFocus) { m_HideTime = Time.time; } else { View.SetHide(false); } View.m_isInputFieldFocus = View.inputField.isFocused; InputManager.Available = !View.m_isInputFieldFocus; ImeManager.ActiveIme(View.m_isInputFieldFocus); } }
public override void OnUpdate() { // 拖拽状态,不处理 if (View.resizer.IsDraging) { return; } // 最小化状态,不处理 if (View.m_isMin) { return; } // 输入框激活状态是否变化 if (View.m_isInputFieldFocus != View.inputField.isFocused) { View.m_isInputFieldFocus = View.inputField.isFocused; InputManager.Available = !View.m_isInputFieldFocus; ImeManager.ActiveIme(View.m_isInputFieldFocus); } //检测鼠标是否在聊天窗内 bool isMouseInWnd = View.detectMouseInWnd(); if (m_isActive) // 激活状态 { if (isMouseInWnd || View.inputField.isFocused) { // 取消3s后切换为非激活状态 m_PlayUnActiveTime = 0f; } else { // 开始3s后切换为非激活状态 if (m_PlayUnActiveTime < float.Epsilon) { m_PlayUnActiveTime = Time.time; } } // 3s后切换为非激活状态 if (m_PlayUnActiveTime > 0f && Time.time - m_PlayUnActiveTime > 3f) { m_PlayUnActiveTime = 0; // 切换聊天框为非激活状态 setUnActiveState(); } } else // 非激活状态 { if (isMouseInWnd || View.inputField.isFocused) { // 切换聊天框为激活状态 SetActiveState(); } } }
public override void OnUpdate() { // 输入框激活状态是否变化 if (View.m_isInputFieldFocus != View.inputField.isFocused) { View.m_isInputFieldFocus = View.inputField.isFocused; InputManager.Available = !View.m_isInputFieldFocus; ImeManager.ActiveIme(View.m_isInputFieldFocus); } }
public void Update() { if (null != m_InputField && bIsFocused != m_InputField.isFocused) { bIsFocused = m_InputField.isFocused; //GameLogicConfigApi.ActiveIME(bIsFocused); InputManager.Available = !bIsFocused; if (m_InputField.inputType != InputField.InputType.Password && !ForbidIME) { ImeManager.ActiveIme(bIsFocused); } } }