示例#1
0
 /// <summary>
 /// 重置
 /// </summary>
 public virtual void Reset()
 {
     spineData = null;
     mpb.Clear();
     meshRenderer.SetPropertyBlock(null);
     skeletonAnimation.skeletonDataAsset = null;
     skeletonAnimation.Initialize(true);
 }
示例#2
0
        /// <summary>
        /// 创建骨骼动画
        /// </summary>
        /// <param name="spineData"></param>
        /// <param name="shared"></param>
        /// <returns></returns>
        public SpineRenderer CreateSpineRenderer(SpineData spineData, bool shared = false)
        {
            SpineRenderer renderer = App.objectPoolManager.GetObject <SpineRenderer>();

            renderer.spineData = spineData;
            renderer.skeletonAnimation.skeletonDataAsset = spineData.GetSkeletonDataAsset(shared);
            renderer.skeletonAnimation.Initialize(false);

            return(renderer);
        }
示例#3
0
        /// <summary>
        /// 创建骨骼动画
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public SpineRenderer CreateSpineRenderer(string name, bool shared = false)
        {
            SpineData spineData = GetSpineData(name);

            if (spineData == null)
            {
                return(null);
            }

            return(CreateSpineRenderer(spineData, shared));
        }
示例#4
0
        /// <summary>
        /// 创建骨骼数据
        /// </summary>
        /// <param name="name"></param>
        /// <param name="atlas"></param>
        /// <param name="texture"></param>
        /// <param name="json"></param>
        /// <param name="shader"></param>
        /// <returns></returns>
        public SpineData CreateSpineData(string name, TextAsset atlas, Texture texture, TextAsset json, Shader shader = null)
        {
            if (shader == null)
            {
                shader = defaultShader;
            }

            SpineData spineData = App.objectPoolManager.GetObject <SpineData>();

            spineData.name    = name;
            spineData.atlas   = atlas;
            spineData.texture = texture;
            spineData.json    = json;
            spineData.shader  = shader;
            spineData.scale   = defaultScale;

            return(spineData);
        }