From da26749bc406145e91fb2b234661ce4dcc7eae54 Mon Sep 17 00:00:00 2001 From: Alee Date: Tue, 4 Jun 2019 17:27:39 -0400 Subject: reverted github --- Assets/Plugins/GitHub/Editor/ExtensionLoader.cs | 93 ------------------------- 1 file changed, 93 deletions(-) delete mode 100644 Assets/Plugins/GitHub/Editor/ExtensionLoader.cs (limited to 'Assets/Plugins/GitHub/Editor/ExtensionLoader.cs') diff --git a/Assets/Plugins/GitHub/Editor/ExtensionLoader.cs b/Assets/Plugins/GitHub/Editor/ExtensionLoader.cs deleted file mode 100644 index f3a7e9e..0000000 --- a/Assets/Plugins/GitHub/Editor/ExtensionLoader.cs +++ /dev/null @@ -1,93 +0,0 @@ -using UnityEditor; -using UnityEngine; -using System.IO; -using System; - -namespace GitHub.Unity -{ - [InitializeOnLoad] - public class ExtensionLoader : ScriptableSingleton - { - [SerializeField] private bool initialized = true; - - public bool Initialized - { - get - { - return initialized; - } - set - { - initialized = value; - Save(true); - } - } - - private static bool inSourceMode = false; - private const string sourceModePath = "Assets/Editor/build/"; - private const string realPath = "Assets/Plugins/GitHub/Editor/"; - - private static string[] assemblies20 = { "System.Threading.dll", "AsyncBridge.Net35.dll", "ReadOnlyCollectionsInterfaces.dll", "GitHub.Api.dll", "GitHub.Unity.dll" }; - private static string[] assemblies45 = { "GitHub.Api.45.dll", "GitHub.Unity.45.dll" }; - - private const string GITHUB_UNITY_DISABLE = "GITHUB_UNITY_DISABLE"; - private static bool IsDisabled { get { return Environment.GetEnvironmentVariable(GITHUB_UNITY_DISABLE) == "1"; } } - - static ExtensionLoader() - { - if (IsDisabled) - { - return; - } - EditorApplication.update += Initialize; - } - - private static void Initialize() - { - EditorApplication.update -= Initialize; - - // we're always doing this right now because if the plugin gets updated all the meta files will be disabled and we need to re-enable them - // we should probably detect if our assets change and re-run this instead of doing it every time - //if (!ExtensionLoader.instance.Initialized) - { - var scriptPath = Path.Combine(Application.dataPath, "Editor" + Path.DirectorySeparatorChar + "GitHub.Unity" + Path.DirectorySeparatorChar + "EntryPoint.cs"); - inSourceMode = File.Exists(scriptPath); - ToggleAssemblies(); - //ExtensionLoader.instance.Initialized = true; - AssetDatabase.SaveAssets(); - } - - } - - private static void ToggleAssemblies() - { - var path = inSourceMode ? sourceModePath : realPath; -#if NET_4_6 - ToggleAssemblies(path, assemblies20, false); - ToggleAssemblies(path, assemblies45, true); -#else - ToggleAssemblies(path, assemblies45, false); - ToggleAssemblies(path, assemblies20, true); -#endif - } - - private static void ToggleAssemblies(string path, string[] assemblies, bool enable) - { - foreach (var file in assemblies) - { - var filepath = path + file; - PluginImporter importer = AssetImporter.GetAtPath(filepath) as PluginImporter; - if (importer == null) - { - Debug.LogFormat("GitHub for Unity: Could not find importer for {0}. Some functionality may fail.", filepath); - continue; - } - if (importer.GetCompatibleWithEditor() != enable) - { - importer.SetCompatibleWithEditor(enable); - importer.SaveAndReimport(); - } - } - } - } -} -- cgit v1.2.3