Example #1
0
        // This an entry point
        static PluginEntryPoint()
        {
            if (UnityUtils.IsInBatchModeAndNotInRiderTests)
            {
                return;
            }

            LogInitializer.InitLog(PluginSettings.SelectedLoggingLevel); // init log before doing any logging
            UnityEventLogSender.Start();                                 // start collecting Unity messages asap

            ourPluginSettings    = new PluginSettings();
            ourRiderPathProvider = new RiderPathProvider(ourPluginSettings);

            if (IsLoadedFromAssets()) // old mechanism, when EditorPlugin was copied to Assets folder
            {
                var riderPath = ourRiderPathProvider.GetActualRider(EditorPrefsWrapper.ExternalScriptEditor,
                                                                    RiderPathLocator.GetAllFoundPaths(ourPluginSettings.OperatingSystemFamilyRider));
                if (!string.IsNullOrEmpty(riderPath))
                {
                    AddRiderToRecentlyUsedScriptApp(riderPath);
                    if (IsRiderDefaultEditor() && PluginSettings.UseLatestRiderFromToolbox)
                    {
                        EditorPrefsWrapper.ExternalScriptEditor = riderPath;
                    }
                }

                if (!PluginSettings.RiderInitializedOnce)
                {
                    EditorPrefsWrapper.ExternalScriptEditor = riderPath;
                    PluginSettings.RiderInitializedOnce     = true;
                }

                InitForPluginLoadedFromAssets();
                Init();
            }
            else
            {
                Init();
            }
        }