Beispiel #1
0
        public static SkeletonGraphicLoader Load(SkeletonGraphic skeletonGraphic, string skeletonData, string[] actions = null)
        {
            if (string.IsNullOrEmpty(skeletonData))
            {
                AfterLoad(skeletonGraphic, null, actions);
                return(null);
            }

            SkeletonGraphicLoader loader = skeletonGraphic.gameObject.GetComponent <SkeletonGraphicLoader>();

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

            loader = skeletonGraphic.gameObject.AddComponent <SkeletonGraphicLoader>();
            loader.skeletonGraphic      = skeletonGraphic;
            loader.skeletonDataFileName = skeletonData;
            loader.actions = actions;

            return(loader);
        }
 public static SkeletonGraphicLoader UpdateSkeletonAnimation(this SkeletonGraphic animation, string name, string[] actions = null, string material = null)
 {
     return(SkeletonGraphicLoader.Load(animation, name, actions));
 }