private ImportedAnimationSheet ImportJob(AnimationImportJob job)
        {
            job.SetProgress(0);

            IAnimationImporterPlugin importer       = _importerPlugins[GetExtension(job.fileName)];
            ImportedAnimationSheet   animationSheet = importer.Import(job, sharedData);

            animationSheet.assetDirectory = job.assetDirectory;
            animationSheet.name           = job.name;

            animationSheet.ApplySpriteNamingScheme(sharedData.spriteNamingScheme);

            job.SetProgress(0.3f, "creating sprites");
            CreateSprites(animationSheet, job);

            job.SetProgress(0.7f, "creating animations");

            if (job.createUnityAnimations)
            {
                CreateAnimations(animationSheet, job);

                job.SetProgress(0.9f);

                if (job.importAnimatorController == ImportAnimatorController.AnimatorController)
                {
                    CreateAnimatorController(animationSheet);
                }
                else if (job.importAnimatorController == ImportAnimatorController.AnimatorOverrideController)
                {
                    CreateAnimatorOverrideController(animationSheet, job.useExistingAnimatorController);
                }
            }

            return(animationSheet);
        }
Ejemplo n.º 2
0
        private ImportedAnimationSheet ImportJob(AnimationImportJob job)
        {
            job.SetProgress(0);

            IAnimationImporterPlugin importer = _importerPlugins[GetExtension(job.fileName)];

            if (sharedData.namingScheme == NamingScheme.ItsName)
            {
                AssetDatabase.RenameAsset(job.directoryPathForSprites + "\\Sprites.png", job.name);
            }

            ImportedAnimationSheet animationSheet = importer.Import(job, sharedData);

            job.SetProgress(0.3f);

            if (animationSheet != null)
            {
                animationSheet.assetDirectory = job.assetDirectory;
                animationSheet.name           = job.name;

                animationSheet.ApplySpriteNamingScheme(sharedData.spriteNamingScheme);

                CreateSprites(animationSheet, job);

                job.SetProgress(0.6f);

                if (job.createUnityAnimations)
                {
                    CreateAnimations(animationSheet, job);

                    job.SetProgress(0.8f);

                    if (job.importAnimatorController == ImportAnimatorController.AnimatorController)
                    {
                        CreateAnimatorController(animationSheet, job);
                    }
                    else if (job.importAnimatorController == ImportAnimatorController.AnimatorOverrideController)
                    {
                        CreateAnimatorOverrideController(animationSheet, job);
                    }
                }

                if (sharedData.namingScheme == NamingScheme.ItsName)
                {
                    AssetDatabase.RenameAsset(job.imageAssetFilename, "Sprites");
                }
            }

            return(animationSheet);
        }
Ejemplo n.º 3
0
        private ImportedAnimationSheet ImportJob(AnimationImportJob job)
        {
            job.SetProgress(0);

            IAnimationImporterPlugin importer       = importerPlugins[GetExtension(job.FileName)];
            ImportedAnimationSheet   animationSheet = importer.Import(job, SharedData);

            job.SetProgress(0.3f);

            if (animationSheet != null)
            {
                animationSheet.AssetDirectory = job.AssetDirectory;
                animationSheet.Name           = job.Name;

                animationSheet.ApplySpriteNamingScheme(SharedData.SpriteNamingScheme);

                CreateSprites(animationSheet, job);

                job.SetProgress(0.6f);

                if (job.CreateUnityAnimations)
                {
                    CreateAnimations(animationSheet, job);

                    job.SetProgress(0.8f);

                    if (job.ImportAnimatorController == ImportAnimatorController.AnimatorController)
                    {
                        CreateAnimatorController(animationSheet);
                    }
                    else if (job.ImportAnimatorController == ImportAnimatorController.AnimatorOverrideController)
                    {
                        CreateAnimatorOverrideController(animationSheet, job.UseExistingAnimatorController);
                    }
                }
            }

            return(animationSheet);
        }