纳金网

标题: 用代码在动画上添加事件 [打印本页]

作者: 狂风大尉    时间: 2014-7-31 02:06
标题: 用代码在动画上添加事件

AnimationEvent mEvent;
public AnimationClip Clip;
将需要编辑的动画拖到Clip上。
Start()
{
Clip.SetCurve("", typeof(Material), "_Color.a", AnimationCurve.EaseInOut(0, 1, 5, 0));
        mEvent = new AnimationEvent();
        mEvent.time = 0.7f;
        mEvent.functionName = "hehe";
        Clip.AddEvent(mEvent);
        animation.AddClip(Clip,"Attack1");
}

void hehe()
    {
        Debug.Log("终于弄出来了  T T");
    }



作者: Kadina    时间: 2014-7-31 07:20
thank you for sharing
作者: HIDEOKOJIMA    时间: 2014-7-31 08:42
Thanks for sharing this one !
作者: hyui    时间: 2014-7-31 19:06

thank you for sharing
作者: 嵐淵瑟    时间: 2014-10-16 16:17
支持一個,感謝分享~~




欢迎光临 纳金网 (http://go.narkii.com/club/) Powered by Discuz! X2.5