博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
给animator动态添加事件
阅读量:4497 次
发布时间:2019-06-08

本文共 830 字,大约阅读时间需要 2 分钟。

using UnityEngine;using System.Collections;public class setAnimationEvent : MonoBehaviour {    public RuntimeAnimatorController m_runtimeAnimatorController;    // Use this for initialization    void Start () {        m_runtimeAnimatorController = this.GetComponent
().runtimeAnimatorController; AnimationEvent newEvent = new AnimationEvent(); newEvent.functionName = "print"; newEvent.time = 0.2f; m_runtimeAnimatorController.animationClips[0].AddEvent(newEvent); Debug.Log(m_runtimeAnimatorController.animationClips.Length.ToString()); this.GetComponent
().Rebind(); } // Update is called once per frame void Update () { } void print() { Debug.Log("ssss"); }}

 

转载于:https://www.cnblogs.com/softimagewht/p/4942032.html

你可能感兴趣的文章
纯C语言跑分(详细注释)
查看>>
.Net分布式架构(一):Nginx实现负载均衡
查看>>
POJ 2485 Highways(最小生成树Prim算法)
查看>>
文本界面听歌神器--moc
查看>>
Ubuntu上安装谷歌第二代机器学习系统TensorFlow
查看>>
Linux:xargs命令详解
查看>>
Flex 布局教程:语法篇
查看>>
明天你好
查看>>
Spring 分散装配
查看>>
漫话爬取
查看>>
sublime js插件
查看>>
C# 添加,修改,删除Xml节点
查看>>
float浮点数的四舍五入
查看>>
QQ消息记录、接收文件、图片、拍照照片等保存位置
查看>>
IOC与AOP介绍
查看>>
关于求最大公约数
查看>>
Git常用命令学习总结
查看>>
【转载】C#通过Rows.Count属性获取总行数
查看>>
【转载】通过百度站长平台查看网站搜索流量及关键字
查看>>
【转载】Visual Studio2017如何打包发布Winform窗体程序
查看>>