/// <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); }
/// <summary> /// 释放骨骼动画 /// </summary> /// <param name="renderer"></param> public void ReleaseSpineRenderer(SpineRenderer renderer) { renderer.spineData.ReleaseSkeletonDataAsset(renderer.skeletonAnimation.SkeletonDataAsset); App.objectPoolManager.ReleaseObject(renderer); }