Convenience function to get the Animator component on the GameObject.
#pragma strict // Required when Using UI elements. private var buttonAnimator; public var button; function Start() { //Assigns the "buttonAnimator" with the button's animator. buttonAnimator = button.animator; }
using UnityEngine; using System.Collections; using UnityEngine.UI; // Required when Using UI elements.
public class ExampleClass : MonoBehaviour { private Animator buttonAnimator; public Button button;
void Start() { //Assigns the "buttonAnimator" with the button's animator. buttonAnimator = button.animator; } }
Did you find this page useful? Please give it a rating: