untiy AnimationEvent添加返回参数
2024-10-20 07:50:28
using UnityEngine;
using System.Collections; public class Try : MonoBehaviour { public class Action : ScriptableObject
{
public Transform Att;
public Transform Def;
} // Use this for initialization
void Start () {
Action act = new Action();
act.Att = this.transform;
act.Def = this.transform; AnimationEvent evt = new AnimationEvent();
evt.time = 0;
evt.functionName = "Test";
evt.objectReferenceParameter = act as Object;
animation.GetClip("ani").AddEvent(evt); Debug.Log(act.Att.gameObject.name);
} public void Test(Action obj) {
Action act = obj as Action;
Debug.Log(act.Att.gameObject.name);
}
}
貌似参数传多少个,类型为int float object都可以
http://blog.csdn.net/damenhanter/article/details/52561673
最新文章
- C#装箱和拆箱
- C#设计模式——单件模式
- SpringMVC 架构
- c/c++ main函数执行之前/后
- JS浏览器对象-window对象
- Hadoop学习笔记01——Hadoop分布式文件系统
- 【学习opencv第六篇】图像的反转操作
- Android重构篇——项目架构篇
- [BZOJ]4405: [wc2016]挑战NPC(带花树)
- Cross-Origin跨域问题
- vue 打开新窗口
- 如何在Windows命令行(DOS界面)中调用 编译器 来编译C/C++源程序
- 用ActiveX 创建自己的comboBox 控件(一)
- MySQL5.7 多实例
- springboot 错误处理
- Vue SSR的渲染性能
- TypeError: HashUpdate fail
- macbook下 go 语言的 helloworld
- ubuntu16.04 eclipse+pydev 配置
- BigData:值得了解的十大数据发展趋势
热门文章
- (*)(转)要快速学习SSM框架,你需要一套学习曲线平滑的教程
- .idea文件夹是干嘛的
- [2018-05-27]配置VSTS认证方式使用Personal Access Token
- 基于node开发的web应用,负载均衡的简单实践
- Spring Boot2.0之 yml的使用
- Winfrom和控制台中static修饰方法的问题
- 51nod 1537
- Spark- Spark Yarn模式下跑yarn-client无法初始化SparkConext,Over usage of virtual memory
- 单页导航菜单视觉设计HTML模板
- 一次php脚本出现段错误(Segment fault)的经历