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);
                    }
                }
            }
        }
Exemple #2
0
 public void ShowView()
 {
     State             = VisibilityStates.Visible;
     canvasGroup.alpha = 1;
 }
Exemple #3
0
 public static void SetIsVisible(DependencyObject obj, VisibilityStates value)
 {
     obj.SetValue(IsVisibleProperty, value);
 }
Exemple #4
0
    //============================================================
    // Public Methods:
    //============================================================

    public void HideView()
    {
        State             = VisibilityStates.Hidden;
        canvasGroup.alpha = 0;
    }