mirror of
https://github.com/sinai-dev/UnityExplorer.git
synced 2025-06-16 22:27:45 +08:00
Cleanup toggle Enabled logic
This commit is contained in:
parent
93181f02be
commit
0479102db6
@ -182,8 +182,7 @@ namespace UnityExplorer.Hooks
|
|||||||
|
|
||||||
public void TogglePatch()
|
public void TogglePatch()
|
||||||
{
|
{
|
||||||
Enabled = !Enabled;
|
if (!Enabled)
|
||||||
if (Enabled)
|
|
||||||
Patch();
|
Patch();
|
||||||
else
|
else
|
||||||
Unpatch();
|
Unpatch();
|
||||||
@ -194,6 +193,7 @@ namespace UnityExplorer.Hooks
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
patchProcessor.Patch();
|
patchProcessor.Patch();
|
||||||
|
|
||||||
Enabled = true;
|
Enabled = true;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
@ -214,6 +214,7 @@ namespace UnityExplorer.Hooks
|
|||||||
patchProcessor.Unpatch(finalizer);
|
patchProcessor.Unpatch(finalizer);
|
||||||
if (transpiler != null)
|
if (transpiler != null)
|
||||||
patchProcessor.Unpatch(transpiler);
|
patchProcessor.Unpatch(transpiler);
|
||||||
|
|
||||||
Enabled = false;
|
Enabled = false;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user