/// <summary> /// Plays the "in" 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 AnimateIn(Transform transform, bool animateChildren) { if (transform.gameObject.activeSelf) { KAnimator uiAnimator = transform.gameObject.GetComponent <KAnimator>(); if ((uiAnimator != null) && uiAnimator.enabled) { uiAnimator.AnimateIn(); } Button button = transform.gameObject.GetComponent <Button>(); if (button != null) { button.interactable = true; } if (animateChildren) { foreach (Transform childTransform in transform) { AnimateIn(childTransform, animateChildren); } } } }
// Use this for initialization void Start() { SetupScoreLabel(); KAnimator mainAnimator = mainPanel.GetComponent <KAnimator>(); mainAnimator.AnimateIn(); }
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(); }