コード例 #1
0
 protected void OnCreated()
 {
     if (PatchManagerSettings.PersistentActive(this.Id) && !PatchManager.IsActive(this.Id))
     {
         EnablePatch();
     }
 }
コード例 #2
0
        public static void DisableAllPatches(bool resetPersistence)
        {
            if (AllowDebugLogs)
            {
                Debug.Log("DISABLE ALL PATCHES");
            }
            foreach (var prov in patchProviders)
            {
                var instance = prov.Value.Instance;
                if (instance.GetIsActive())
                {
                    DisablePatch(instance, false);
                    if (resetPersistence)
                    {
                        continue;
                    }
                    // keep persistence state
                    PatchManagerSettings.SetPersistentActive(instance.ID(), true);
                }
            }

            foreach (var man in KnownPatches)
            {
                if (man.IsActive)
                {
                    man.DisablePatch();
                    if (resetPersistence)
                    {
                        continue;
                    }
                    // keep persistence state
                    PatchManagerSettings.SetPersistentActive(man.Id, true);
                }
            }
        }
コード例 #3
0
 private static void DelayedEnablePatchedThatHadBeenActivePreviously()
 {
     if (!AutomaticallyEnablePersistentPatches)
     {
         return;
     }
     foreach (var patch in registeredPatchProviders)
     {
         if (PatchManagerSettings.PersistentActive(patch))
         {
             EnablePatch(patch);
         }
     }
 }
コード例 #4
0
 public void DisablePatch()
 {
     requestedActivation = false;
     if (!IsActive)
     {
         return;
     }
     if (OnDisablePatch())
     {
         requestedActivation = false;
         IsActive            = false;
         PatchManagerSettings.SetPersistentActive(this.Id, false);
         InternalEditorUtility.RepaintAllViews();
     }
 }
コード例 #5
0
 private void HandleActivationRequestNow()
 {
     // while (!EditorApplication.isPlaying && requestedActivation && !Utils.GUISkinHasLoaded()) await Task.Delay(1);
     if (!requestedActivation || IsActive)
     {
         return;
     }
     if (PatchManager.IsActive(this.Id))
     {
         return;
     }
     requestedActivation = false;
     IsActive            = true;
     if (PatchManager.AllowDebugLogs)
     {
         Debug.Log("ENABLE " + Id);
     }
     if (OnEnablePatch())
     {
         PatchManagerSettings.SetPersistentActive(this.Id, true);
         InternalEditorUtility.RepaintAllViews();
     }
 }
コード例 #6
0
 public static void ClearSettingsCache()
 {
     PatchManagerSettings.Clear(true);
 }