예제 #1
0
        private void ReplaceGameEvent()
        {
            List <string> allControllerPath = RefactorUtils.GetAllCodeFilesInDirectory(MyGameScriptsPath);

            foreach (string path in allControllerPath)
            {
                string allContent    = File.ReadAllText(path);
                string newAllContent = ReplaceGameEventThisFile(allContent);
                if (allContent != newAllContent)
                {
                    File.WriteAllText(path, newAllContent);
                }
            }
        }
예제 #2
0
        private void RefactorModule()
        {
            List <string> allModulePath = RefactorUtils.GetAllCodeFilesInDirectory(MyGameScriptsPath);

            allModulePath.Add(@"D:\AllProject\xclient_trunk\Assets\Scripts\MyGameScripts\Module\BackpackModule\Model\FashionModel.cs");
            foreach (string path in allModulePath)
            {
                string allContent = File.ReadAllText(path);
                string moduleName = RefactorUtils.GetH1ModuleName(allContent);
                if (string.IsNullOrEmpty(moduleName) == false)
                {
                    Debug.LogWarning(path);
                    string newAllContent = RefactorThisModule(allContent, moduleName);
                    if (newAllContent != allContent)
                    {
                        File.WriteAllText(path, newAllContent);
                    }
                }
            }
        }
예제 #3
0
 public static void LogFile(string pSaveFilePath, string pFileContent)
 {
     RefactorUtils.CreateFileDirectory(pSaveFilePath, true);
     File.AppendAllText(pSaveFilePath, pFileContent + "\n");
 }