How do I specify each object in getcomponent
?
I did this script, but I do not know how to specify for each animator
.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class anim2: MonoBehaviour
{
Animator optionsubir;
Animator subirplay2;
Animator extralado;
public void ChamarAnimacao()
{
optionsubir.GetComponent<Animation>().Play ("optionsubir");
subirplay2.GetComponent<Animation>().Play ("optionsubir");
extralado.GetComponent<Animation>().Play ("optionsubir");
}
}