mirror of
https://github.com/originalnicodr/CinematicUnityExplorer.git
synced 2026-10-11 01:48:07 +08:00
Cleanup toggle Enabled logic
This commit is contained in:
1 parent
93181f02be
commit
0479102db6
1 file changed
+3
-2
@@ -182,8 +182,7 @@ namespace UnityExplorer.Hooks
|
||||
|
||||
public void TogglePatch()
|
||||
{
|
||||
Enabled = !Enabled;
|
||||
if (Enabled)
|
||||
if (!Enabled)
|
||||
Patch();
|
||||
else
|
||||
Unpatch();
|
||||
@@ -194,6 +193,7 @@ namespace UnityExplorer.Hooks
|
||||
try
|
||||
{
|
||||
patchProcessor.Patch();
|
||||
|
||||
Enabled = true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -214,6 +214,7 @@ namespace UnityExplorer.Hooks
|
||||
patchProcessor.Unpatch(finalizer);
|
||||
if (transpiler != null)
|
||||
patchProcessor.Unpatch(transpiler);
|
||||
|
||||
Enabled = false;
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
Reference in new issue
Block a user