Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable the plugin completely on Silicon #101

Open
acornellier opened this issue Aug 18, 2023 · 2 comments
Open

Disable the plugin completely on Silicon #101

acornellier opened this issue Aug 18, 2023 · 2 comments
Assignees
Labels
nice-to-have Not critical to core functionality

Comments

@acornellier
Copy link

I have FSR installed for use on my Windows PC, but when I use my MacBook, I constantly get an error due it not being compatible with Silicon. I understand nothing can be done to add Silicon compatibility, but it would be nice to disable the plugin completely to avoid the error.

System.TypeInitializationException: The type initializer for 'HarmonyLib.HarmonySharedState' threw an exception. ---> System.Exception: mprotect returned EACCES
@handzlikchris handzlikchris added the nice-to-have Not critical to core functionality label Aug 21, 2023
@brunomikoski
Copy link

Yeah, would be great to have a global option to turn on/off

@handzlikchris handzlikchris self-assigned this Oct 20, 2023
@handzlikchris
Copy link
Owner

I'll check it out, it could really be as simple as not running init on mac at all (even without adding user-setting to GUI)

in

        static FastScriptReloadManager()
        {
#if UNITY_EDITOR_OSX
              return; //no silicon support
#endif

            //do not add init code in here as with domain reload turned off it won't be properly set on play-mode enter, use Init method instead
            EditorApplication.update += Instance.Update;
            EditorApplication.playModeStateChanged += Instance.OnEditorApplicationOnplayModeStateChanged;

            ///if <see cref="FastScriptReloadPreference.WatchOnlySpecified"/> is enabled, disable auto reload automatically when launching editor. Will be enabled automatically when adding file watcher manually
            if ((bool)FastScriptReloadPreference.WatchOnlySpecified.GetEditorPersistedValueOrDefault() && SessionState.GetBool("NEED_EDITOR_SESSION_INIT", true))
            {
                SessionState.SetBool("NEED_EDITOR_SESSION_INIT", false);
                ClearFileWatchersEntries();
            }
        }

Also the user-settings are per-machine, if you disable then it won't run on mac
image

There's some Harmony patching happening on init, that may need precompiler symbol as well
FastScriptReload.Editor.NewFields.NewFieldsRendererDefaultEditorPatch

I don't have immediate access to mac and have to spin it in the cloud - may be easier to quickly check on your end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
nice-to-have Not critical to core functionality
Projects
Status: No status
Development

No branches or pull requests

3 participants