Exemplo n.º 1
0
		public AnimationBuilder (ScmlProcessingInfo info, IDictionary<int, IDictionary<int, Sprite>> folders,
		                         IDictionary<string, Transform> transforms, IDictionary<string, SpatialInfo> defaultBones,
		                         IDictionary<string, SpriteInfo> defaultSprites,
		                         string prefabPath, AnimatorController controller)
		{
			if (S2USettings.Settings.followScmlSprite) {
				scmlFollower.Build ();
			}
			ProcessingInfo = info;
			Folders = folders;
			Transforms = transforms;
			PrefabPath = prefabPath; 
			DefaultBones = defaultBones;
			DefaultSprites = defaultSprites; 
			Root = Transforms ["rootTransform"];
			Controller = controller;
			AnimationsPath = PrefabPath.Substring (0, PrefabPath.LastIndexOf ('.')) + "_Anims";


			foreach (var item in GetOrigClips ()) {
				var clip = item as AnimationClip;
				if (clip != null)
					OriginalClips [clip.name] = clip;
			}
		}
Exemplo n.º 2
0
		private static void ProcessFiles (IList<string> paths) {
			var info = new ScmlProcessingInfo ();
			var builder = new PrefabBuilder (info);
			foreach (var path in paths) 
				if (!builder.Build (Deserialize (path), path))  //Process will fail if texture import settings need to be updated
					cachedPaths.Add (path); //Failed processes will be saved and re-attempted during the next import cycle
			AssetDatabase.Refresh ();
			AssetDatabase.SaveAssets ();
			PostProcess (info);
		}
		public AnimationBuilder (ScmlProcessingInfo info, IDictionary<int, IDictionary<int, Sprite>> folders,
		                         IDictionary<string, Transform> transforms, IDictionary<string, SpatialInfo> defaultBones,
		                         IDictionary<string, SpriteInfo> defaultSprites,
		                         string prefabPath, AnimatorController controller) {
			ProcessingInfo = info; Folders = folders; Transforms = transforms; PrefabPath = prefabPath; 
			DefaultBones = defaultBones; DefaultSprites = defaultSprites; 
			Root = Transforms ["rootTransform"]; Controller = controller;

			foreach (var item in AssetDatabase.LoadAllAssetRepresentationsAtPath(prefabPath)) {
				var clip = item as AnimationClip;
				if (clip != null) OriginalClips [clip.name] = clip;
			}
		}
Exemplo n.º 4
0
        private static void ProcessFiles(IList <string> paths)
        {
            var info    = new ScmlProcessingInfo();
            var builder = new PrefabBuilder(info);

            foreach (var path in paths)
            {
                if (!builder.Build(Deserialize(path), path))    //Process will fail if texture import settings need to be updated
                {
                    cachedPaths.Add(path);                      //Failed processes will be saved and re-attempted during the next import cycle
                }
            }
            AssetDatabase.Refresh();
            AssetDatabase.SaveAssets();
            PostProcess(info);
        }
Exemplo n.º 5
0
        public AnimationBuilder(ScmlProcessingInfo info, IDictionary <int, IDictionary <int, Sprite> > folders,
                                IDictionary <string, Transform> transforms, IDictionary <string, SpatialInfo> defaultBones,
                                IDictionary <string, SpriteInfo> defaultSprites,
                                string prefabPath, AnimatorController controller)
        {
            ProcessingInfo = info; Folders = folders; Transforms = transforms; PrefabPath = prefabPath;
            DefaultBones   = defaultBones; DefaultSprites = defaultSprites;
            Root           = Transforms ["rootTransform"]; Controller = controller;

            foreach (var item in AssetDatabase.LoadAllAssetRepresentationsAtPath(prefabPath))
            {
                var clip = item as AnimationClip;
                if (clip != null)
                {
                    OriginalClips [clip.name] = clip;
                }
            }
        }
Exemplo n.º 6
0
        public AnimationBuilder(ScmlProcessingInfo info, IDictionary <int, IDictionary <int, Sprite> > folders,
                                IDictionary <string, Transform> transforms, IDictionary <string, SpatialInfo> defaultBones,
                                IDictionary <string, SpriteInfo> defaultSprites,
                                string prefabPath, AnimatorController controller)
        {
            ProcessingInfo = info; Folders = folders; Transforms = transforms; PrefabPath = prefabPath;
            DefaultBones   = defaultBones; DefaultSprites = defaultSprites;
            Root           = Transforms ["rootTransform"]; Controller = controller;
            AnimationsPath = PrefabPath.Substring(0, PrefabPath.LastIndexOf('.')) + "_Anims";

            foreach (var item in GetOrigClips())
            {
                var clip = item as AnimationClip;
                if (clip != null)
                {
                    OriginalClips [clip.name] = clip;
                }
            }
        }
Exemplo n.º 7
0
 public PrefabBuilder(ScmlProcessingInfo info)
 {
     ProcessingInfo = info;
 }
 public PrefabBuilder(ScmlProcessingInfo info)
 {
     ProcessingInfo = info;
 }
Exemplo n.º 9
0
 private static void PostProcess(ScmlProcessingInfo info)
 {
     //You can put your own code or references to your own code here
     //If you want to do any work on these assets
 }
Exemplo n.º 10
0
		private static void PostProcess (ScmlProcessingInfo info) {
			//You can put your own code or references to your own code here
			//If you want to do any work on these assets
		}