请问我在C#中写的几个方法,为什么不可以在unity中为动画添加事件呢?
以下为源码和unity的截图
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PausePanel : MonoBehaviour
{
private Animator anim;
private void Awake()
{
anim = GetComponent<Animator>();
}
public void Retry()
{
}
///<summary>
///点击了pause按钮
///</summary>
public void Pause()
{
//1、播放动画
//2、暂停
}
public void Home()
{
}
public void Resume()
{
}
}
鼠标在时间轴上双击就能添加事件了
PausePanel 这个脚本你得挂载到持有动画的物体上才能在事件列表里面显示并选择