Пример #1
0
        public void Analyze()
        {
            Logger.LogAllLine("Analyze Scripts================>");
            MissionScripts.Clear();
            HeroScripts.Clear();
            MonsterScripts.Clear();
            SkillScripts.Clear();
            BufferScripts.Clear();


            {
                var files = SystemTool.GetDirectoryFiles(PathManager.InputMissionScriptPath);
                foreach (var scriptFile in files)
                {
                    MissionScripts.Add(scriptFile.Name, false);
                }
            }

            {
                var files = SystemTool.GetDirectoryFiles(PathManager.InputHeroScriptPath);
                foreach (var scriptFile in files)
                {
                    HeroScripts.Add(scriptFile.Name, false);
                }
            }

            {
                var files = SystemTool.GetDirectoryFiles(PathManager.InputMonsterScriptPath);
                foreach (var scriptFile in files)
                {
                    MonsterScripts.Add(scriptFile.Name, false);
                }
            }

            {
                var files = SystemTool.GetDirectoryFiles(PathManager.InputSkillScriptPath);
                foreach (var scriptFile in files)
                {
                    SkillScripts.Add(scriptFile.Name, false);
                }
            }

            {
                var files = SystemTool.GetDirectoryFiles(PathManager.InputBufferScriptPath);
                foreach (var scriptFile in files)
                {
                    BufferScripts.Add(scriptFile.Name, false);
                }
            }

            //copy all scripts
            {
                var files = SystemTool.GetDirectoryFiles(PathManager.InputScriptPath);
                foreach (var scriptFile in files)
                {
                    var resourceFile = new FileListFile(scriptFile, true, true);
                    FileSystemGenerator.CopyFileToOutput(resourceFile);
                }
            }
        }
Пример #2
0
        public void Analyze()
        {
            Logger.LogAllLine("Analyze Other================>");

            var files = SystemTool.GetDirectoryFiles(PathManager.InputOtherPath);

            foreach (var animationFile in files)
            {
                var resourceFile = new FileListFile(animationFile);
                FileSystemGenerator.CopyFileToOutput(resourceFile);
            }
        }
Пример #3
0
        public void Analyze()
        {
            Logger.LogAllLine("Analyze Audio================>");

            var files = SystemTool.GetDirectoryFiles(PathManager.InputAudioPath);

            foreach (var file in files)
            {
                if (file.Extension == ".wav" || file.Extension == ".mp3")
                {
                    var resourceFile = new FileListFile(file);
                    FileSystemGenerator.CopyFileToOutput(resourceFile);
                }
            }
        }
        public static List <FileInfo> GetSrcFiles(DirectoryInfo path)
        {
            List <string> acceptExtensions = new List <string>()
            {
                ".cc", ".c", ".cpp", ".S"
            };
            List <FileInfo> srcFiles = new List <FileInfo>();
            var             files    = SystemTool.GetDirectoryFiles(path);

            foreach (var fileInfo in files)
            {
                if (acceptExtensions.Contains(fileInfo.Extension))
                {
                    srcFiles.Add(fileInfo);
                }
            }

            return(srcFiles);
        }
Пример #5
0
        private void GetImagesRecursively(DirectoryInfo dirPath, string prefix)
        {
            var files = SystemTool.GetDirectoryFiles(dirPath);

            foreach (var file in files)
            {
                if (!file.Name.EndsWith(".png"))
                {
                    Logger.LogInfoLine("{0}Only accept png image:{1}", prefix, file);
                    continue;
                }
                var imageFile = new ImageFile(file, true, true);
                //Logger.LogInfoLine("{0}File:\t{1}", prefix, file.FullName.Replace(PathManager.InputImagesPath.FullName, string.Empty));
                bool isPacked = !file.Directory.FullName.Contains(PathManager.InputImageOtherPath.FullName);

                bool isPVREnabled = false;
                if (PublishTarget.Current.IsPVR)
                {
                    isPVREnabled = mPVREnabledDirectoryNames.Any(pvrEnabledDirectoryName => file.Directory.FullName.Contains(pvrEnabledDirectoryName));
                }
                //bool isEffectAnimation = file.Directory.FullName.Contains("EffectAnimation");
                //isPacked &= !isEffectAnimation;
                //bool isOptimzed = !isEffectAnimation;
                if (!PublishTarget.Current.IsPack)
                {
                    isPacked = false;
                }

                bool isOptimzed = PublishTarget.Current.IsOptimzed;
                bool isPOT      = PublishTarget.Current.IsPOT;
                bool isSquare   = PublishTarget.Current.IsSquare;
                if (isPVREnabled)
                {
                    isPOT    = true;
                    isSquare = true;
                }

                ImagePacker.AddImage(imageFile, PublishTarget.Current, isPacked, isOptimzed, isPVREnabled, isPOT, isSquare);
                FilterImage(file);
            }
        }