近期热门
首页 其他资源区 其他资源 动画特效教程
PSD导入AE 可分层控制方法

[动画特效教程] PSD导入AE 可分层控制方法

[复制链接]
using System.Collections;
using UnityEngine;
using Spine.Unity;
namespace Game
{
    //[ExecuteInEditMode]
    public class SpineForAnimator : MonoBehaviour
    {
      
        [SerializeField]
        public int index = 0;

        [SerializeField]
        public bool loop = false;

        private SkeletonGraphic _ui;
        private SkeletonAnimation _scene;
        private int _playingIdx = -1;

        private void Awake()
        {
            _ui = GetComponent<SkeletonGraphic>();
            _scene = GetComponent<SkeletonAnimation>();
        }

        private void Update()
        {
            if (_playingIdx == index)
            {
                return;
            }
            if (_ui != null)
            {
                PlayUISpine();
            }else if (_scene != null)
            {
                PlaySceneSpine();
            }

        }

        private void PlayUISpine()
        {
            var animations = _ui.Skeleton.Data.Animations;
            Debug.Assert(index < animations.Count, "property index can not more than animation count!");
            var state = _ui.AnimationState;
            var willName = animations.Items[index].Name;
            //播放Spine动画
            state.ClearTrack(0);
            _ui.Skeleton.SetToSetupPose();
            state.SetAnimation(0, willName, loop);
            _playingIdx = index;
        }

        private void PlaySceneSpine()
        {
            var animations = _scene.skeleton.Data.Animations;
            Debug.Assert(index < animations.Count, "property index can not more than animation count!");
            var state = _scene.AnimationState;
            var willName = animations.Items[index].Name;
            //播放Spine动画
            state.ClearTrack(0);
            _scene.Skeleton.SetToSetupPose();
            state.SetAnimation(0, willName, loop);
            _playingIdx = index;
        }
    }
}

spine for unity animator 动画
2年前  ·  17楼
回复

使用道具 举报

unity切换动画  动画循环  spine切换动作脚本(老何)












创建动画合并在控制器下.png
动画切换和动画循环.png
2年前  ·  16楼
回复

使用道具 举报

tvp2013中文版
2年前  ·  15楼
回复

使用道具 举报

云循环

云循环

云循环
2年前  ·  14楼
回复

使用道具 举报

unity 天空盒跑云

天空盒跑云

天空盒跑云
2年前  ·  13楼
回复

使用道具 举报

unity贴图particle中多个随机播放

unity 多贴图单个随机播放

unity 多贴图单个随机播放
2年前  ·  12楼
回复

使用道具 举报

模型线转换成点

线转换成点

线转换成点
3年前  ·  11楼
回复

使用道具 举报

uv动画修改器设置

uv动画

uv动画
3年前  ·  10楼
回复

使用道具 举报

C:\Users\Administrator\Desktop\
3年前  ·  9楼
回复

使用道具 举报

https://chengdu665/svn/witch

上传svn路径

上传svn路径
3年前  ·  8楼
回复

使用道具 举报

数据加载中....
没有更多评论了
您当前使用的浏览器IE内核版本过低会导致网站显示错误

请使用高速内核浏览器或其他浏览器