Пример #1
0
 private static void ShowWarningOnUnexpectedScriptEditor(string path)
 {
     // Show warning, when Unity was started from Rider, but external editor is different https://github.com/JetBrains/resharper-unity/issues/1127
     try
     {
         var args = Environment.GetCommandLineArgs();
         var commandlineParser = new CommandLineParser(args);
         if (commandlineParser.Options.ContainsKey("-riderPath"))
         {
             var originRiderPath = commandlineParser.Options["-riderPath"];
             var originRealPath  = GetEditorRealPath(originRiderPath);
             var originVersion   = RiderPathLocator.GetBuildNumber(originRealPath);
             var version         = RiderPathLocator.GetBuildNumber(path);
             if (originVersion != null && originVersion != version)
             {
                 Debug.LogWarning("Unity was started by a version of Rider that is not the current default external editor. Advanced integration features cannot be enabled.");
                 Debug.Log($"Unity was started by Rider {originVersion}, but external editor is set to: {path}");
             }
         }
     }
     catch (Exception e)
     {
         Debug.LogException(e);
     }
 }
Пример #2
0
        public void Invalidate(string editorInstallationPath)
        {
            currentEditorVersion = RiderPathLocator.GetBuildNumber(editorInstallationPath);
            if (!Version.TryParse(currentEditorVersion, out var version))
            {
                shouldLoadEditorPlugin = false;
            }

            shouldLoadEditorPlugin = version >= new Version("191.7141.156");
        }
Пример #3
0
        public static bool ShouldLoadEditorPlugin(string path)
        {
            var ver = RiderPathLocator.GetBuildNumber(path);

            if (!Version.TryParse(ver, out var version))
            {
                return(false);
            }

            return(version >= new Version("191.7141.156"));
        }
Пример #4
0
        public void Invalidate(string editorInstallationPath)
        {
            editorBuildNumber = RiderPathLocator.GetBuildNumber(editorInstallationPath);
            productInfo       = RiderPathLocator.GetBuildVersion(editorInstallationPath);
            if (editorBuildNumber == null)
            {
                shouldLoadEditorPlugin = false;
            }

            shouldLoadEditorPlugin = editorBuildNumber >= new Version("191.7141.156");
        }
    public void Invalidate(string editorInstallationPath)
    {
      var riderBuildNumber = RiderPathLocator.GetBuildNumber(editorInstallationPath);
      editorBuildNumber = riderBuildNumber.ToSerializableVersion();
      productInfo = RiderPathLocator.GetBuildVersion(editorInstallationPath);
      if (riderBuildNumber == null)
        shouldLoadEditorPlugin = false;

      shouldLoadEditorPlugin = riderBuildNumber >= new Version("191.7141.156");

      if (RiderPathUtil.IsRiderDevEditor(editorInstallationPath))
      {
        shouldLoadEditorPlugin = true;
        editorBuildNumber = new SerializableVersion(new Version("999.999.999.999"));
      }
    }
Пример #6
0
    public void Invalidate(string editorInstallationPath, bool shouldInvalidatePrevEditorBuildNumber = false)
    {
      var riderBuildNumber = RiderPathLocator.GetBuildNumber(editorInstallationPath);
      editorBuildNumber = riderBuildNumber.ToSerializableVersion();
      if (shouldInvalidatePrevEditorBuildNumber)
        prevEditorBuildNumber = editorBuildNumber;
      productInfo = RiderPathLocator.GetBuildVersion(editorInstallationPath);
      if (riderBuildNumber == null) // if we fail to parse for some reason
        shouldLoadEditorPlugin = true;

      shouldLoadEditorPlugin = riderBuildNumber >= new Version("191.7141.156");

      if (RiderPathUtil.IsRiderDevEditor(editorInstallationPath))
      {
        shouldLoadEditorPlugin = true;
        editorBuildNumber = new SerializableVersion(new Version("999.999.999.999"));
      }
    }