protected virtual void CheckFocus(PanelStateEnum p_panelState) { if (p_panelState == PanelStateEnum.Opening || p_panelState == PanelStateEnum.Opened) { FocusContainer.SetFocus(this); FocusContainer.CorrectFullScreenRendering(p_panelState == PanelStateEnum.Opening); } else if (p_panelState == PanelStateEnum.Closing || p_panelState == PanelStateEnum.Closed) { FocusContainer.CorrectFullScreenRendering(p_panelState == PanelStateEnum.Closing); FocusContainer.RemoveFocus(this); if (p_panelState == PanelStateEnum.Closed) { //set Renderer To False Before Remove Canvas v_canvas = GetComponent <Canvas>(); UnityEngine.UI.GraphicRaycaster v_graphicsRayCaster = GetComponent <UnityEngine.UI.GraphicRaycaster>(); if (v_graphicsRayCaster != null) { v_graphicsRayCaster.enabled = false; } if (v_canvas != null) { v_canvas.enabled = false; } } } }
protected virtual void HandleOnGlobalPress(bool p_pressed) { if (KiltUICamera.currentTouch != null && p_pressed) { FocusContainer v_directParentFocus = GetDirectFocusContainerComponent(KiltUICamera.currentTouch.pressed); if (v_directParentFocus == this) { FocusContainer.SetFocus(this); } } }