发布时间:2019-09-05 07:06:33编辑:auto阅读(2322)
1、如图模型1是已经做好的文件,模型2是还没动画效果的模型
2、添加角色动画属性组件
3、代码控制动画播
using UnityEngine;
using System.Collections;
public class NewBehaviourScript : MonoBehaviour {
private Animation animation;//动画
// Use this for initialization
void Start () {
//取得游戏对象动画组件
animation = GetComponent<Animation>();
}
// Update is called once per frame
void Update () {
//播放行走动画
animation.Play ("Run");
//站立 play播放分别对应Animations中Element0和Element1中的动画名
//animation.Play ("Idle");
}
}以上就是Unity 3D控制角色动画的基本操作教程,附上demo
下载地址:http://www.kuaipan.cn/file/id_141868194330584496.htm?source=1
上一篇: php-eclipse集成配置(Ecli
下一篇: Workerman3.x 版本学习之入门
51677
51338
41778
38550
33025
30042
28714
23694
23617
21983
2178°
2870°
2396°
2339°
2884°
2345°
3135°
5152°
4982°
3557°