InitHelper.cs 956 B

123456789101112131415161718192021222324252627282930313233
  1. using UnityEditor;
  2. using UnityEngine;
  3. namespace ET
  4. {
  5. public static class InitHelper
  6. {
  7. [InitializeOnLoadMethod]
  8. public static void ReGenerateProjectFiles()
  9. {
  10. Unity.CodeEditor.CodeEditor.CurrentEditor.SyncAll();
  11. foreach (string s in FileHelper.GetAllFiles(".", "Ignore.ET*.csproj"))
  12. {
  13. System.IO.File.Delete(s);
  14. }
  15. Debug.Log("regenerate csproj");
  16. }
  17. [MenuItem("ET/Packages Refresh")]
  18. public static void Refresh()
  19. {
  20. AsmdefEditor.UpdateAssemblyDefinition();
  21. GlobalConfig globalConfig = AssetDatabase.LoadAssetAtPath<GlobalConfig>("Packages/cn.etetet.init/Resources/GlobalConfig.asset");
  22. CodeModeChangeHelper.ChangeToCodeMode(globalConfig.CodeMode);
  23. AssetDatabase.Refresh();
  24. Debug.Log("packages refresh finish!");
  25. }
  26. }
  27. }