public void ShowMainPanel() { KAnimator mainAnimator = mainPanel.GetComponent <KAnimator>(); KAnimator aboutAnimator = aboutPanel.GetComponent <KAnimator>(); mainAnimator.AnimateIn(); aboutAnimator.AnimateOut(); }
public void ShowAboutPanel() { aboutPanel.SetActive(true); KAnimator mainAnimator = mainPanel.GetComponent <KAnimator>(); KAnimator aboutAnimator = aboutPanel.GetComponent <KAnimator>(); mainAnimator.AnimateOut(); aboutAnimator.AnimateIn(); }
/// <summary> /// Plays the "out" animation of the game object associated with the given transform. /// </summary> /// <param name="transform">The transform of the game object to animate.</param> /// <param name="animateChildren">Whether the children of the given game object must be animated as well.</param> public void AnimateOut(Transform transform, bool animateChildren) { if (transform.gameObject.activeSelf) { KAnimator uiAnimator = transform.gameObject.GetComponent <KAnimator>(); if ((uiAnimator != null) && uiAnimator.enabled) { uiAnimator.AnimateOut(); } Button button = transform.gameObject.GetComponent <Button>(); if (button != null) { button.interactable = false; } if (animateChildren) { foreach (Transform childTransform in transform) { AnimateOut(childTransform, animateChildren); } } } }