using System; using System.Collections.Generic; using System.IO; using System.Text.RegularExpressions; using UnityEditor; using UnityEngine; public class TTAPIUpdate { private static string noteString = ""; public static void UpdateAPI(string path) { noteString = ""; Debug.Log("path " + path); string[] files = Directory.GetFiles(path, "*.cs", SearchOption.AllDirectories); for (int i = 0; i < files.Length; ++i) { NoteInFile(files[i]); Console.WriteLine(files[i]); ReplaceInFile(files[i], @"using\sStarkSDKSpace", "using TTSDK"); ReplaceInFile(files[i], @"using\sStarkSDKSpace", "using TTSDK"); ReplaceInFile(files[i], @"namespace\sStarkSDKSpace", "namespace TTSDK"); ReplaceInFile(files[i], @"StarkSDKSpace\.", "TTSDK."); ReplaceInFile(files[i], "EnableStarkSDKDebugToast", "EnableTTSDKDebugToast"); ReplaceInFile(files[i], @"StarkSDK\.API.Init\(\)", "TT.InitSDK()"); ReplaceInFile(files[i], @"StarkSDK\.API.", "TT."); ReplaceInFile(files[i], @"StarkSDK\.", @"TT."); ReplaceInFile(files[i], "StarkAudioManager", "TTAudioManager"); ReplaceInFile(files[i], "StarkAdManager", "TTAdManager"); ReplaceInFile(files[i], @"\.GetStarkAdManager\(\).", "."); ReplaceInFile(files[i], @"TTAdManager\.BannerAd", "TTBannerAd"); ReplaceInFile(files[i], @"TTAdManager\.BannerStyle", "TTBannerStyle"); ReplaceInFile(files[i], @"\.GetStarkDeviceMotion\(\)", ""); ReplaceInFile(files[i], "StarkDeviceMotion", "TTDeviceMotion"); ReplaceInFile(files[i], "GetStarkDouyinCloudManager", "CreateCloud"); ReplaceInFile(files[i], "StarkDouyinCloud", "DouyinCloud"); ReplaceInFile(files[i], "GetScUserInfo", "GetUserInfo"); ReplaceInFile(files[i], "ScUserInfo ", "TTUserInfo "); ReplaceInFile(files[i], @"\.GetAccountManager\(\)", ""); ReplaceInFile(files[i], "GetStarkFileSystemManager", "GetFileSystemManager"); ReplaceInFile(files[i], "StarkUIManager", "TTUIManager"); ReplaceInFile(files[i], @"\sStarkGameRecorder\s", @" TTGameRecorder "); ReplaceInFile(files[i], @"\sStarkGameRecorder\.", " TTGameRecorder."); ReplaceInFile(files[i], @" param\n"; noteString += str; Debug.Log(str); } } }