コード例 #1
0
        public static SkeletonAnimationLoader Load(SkeletonAnimation skeletonAnimation, string name, string[] actions = null, bool flip = false)
        {
            if (string.IsNullOrEmpty(name))
            {
                AfterLoad(skeletonAnimation, null, actions, flip);
                return(null);
            }

            SkeletonAnimationLoader loader = skeletonAnimation.gameObject.GetComponent <SkeletonAnimationLoader>();

            if (loader != null)
            {
                Destroy(loader);
            }

            loader = skeletonAnimation.gameObject.AddComponent <SkeletonAnimationLoader>();
            loader.skeletonAnimation = skeletonAnimation;
            loader.fileName          = name;
            loader.actions           = actions;
            loader.flip = flip;

            return(loader);
        }
コード例 #2
0
 public static SkeletonAnimationLoader UpdateSkeletonAnimation(this SkeletonAnimation animation, string name, string[] actions = null, bool flip = false)
 {
     return(SkeletonAnimationLoader.Load(animation, name, actions, flip));
 }