如何在同一个类别下应用2个或更多虚拟按钮,以从单个动画师调用多个动画。
下面是一个按钮,如何在其中添加一个按钮
public class Vb_ball : MonoBehaviour, IVirtualButtonEventHandler
{
public GameObject vbBtnObj;
public Animator Ballanimation;
// Use this for initialization
void Start()
{
vbBtnObj = GameObject.Find("Openbutton");
vbBtnObj.GetComponent<VirtualButtonBehaviour>().RegisterEventHandler(this);
Ballanimation.GetComponent<Animator>();
}
public void OnButtonPressed(VirtualButtonBehaviour vb)
{
Ballanimation.Play("Opn_close");
Debug.Log("Button pressed");
}
public void OnButtonReleased(VirtualButtonBehaviour vb)
{
Ballanimation.Play("Static");
Debug.Log("Button released");
}
// Update is called once per frame
void Update () {
}
}