protected virtual void ToggleElement(GameObject givenObject, bool pointerState, bool actualState, VisibilityStates givenVisibility, ref bool currentVisible) { if (givenObject) { currentVisible = (givenVisibility == VisibilityStates.AlwaysOn ? true : pointerState); givenObject.SetActive(currentVisible); if (givenVisibility == VisibilityStates.AlwaysOff) { currentVisible = false; ToggleRendererVisibility(givenObject, false); } else { if (actualState && givenVisibility != VisibilityStates.AlwaysOn) { ToggleRendererVisibility(givenObject, false); AddVisibleRenderer(givenObject); } else { ToggleRendererVisibility(givenObject, true); } } } }
public void ShowView() { State = VisibilityStates.Visible; canvasGroup.alpha = 1; }
public static void SetIsVisible(DependencyObject obj, VisibilityStates value) { obj.SetValue(IsVisibleProperty, value); }
//============================================================ // Public Methods: //============================================================ public void HideView() { State = VisibilityStates.Hidden; canvasGroup.alpha = 0; }