Initial Commit
This commit is contained in:
parent
53eb92e9af
commit
270ab7d11f
15341 changed files with 700234 additions and 0 deletions
|
@ -0,0 +1,57 @@
|
|||
using System;
|
||||
using System.Linq;
|
||||
using Packages.Rider.Editor.Util;
|
||||
using Rider.Editor.Util;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Packages.Rider.Editor
|
||||
{
|
||||
internal class RiderScriptEditorData : ScriptableSingleton<RiderScriptEditorData>
|
||||
{
|
||||
[SerializeField] internal bool hasChanges = true; // sln/csproj files were changed
|
||||
[SerializeField] internal bool shouldLoadEditorPlugin;
|
||||
[SerializeField] internal bool initializedOnce;
|
||||
[SerializeField] internal SerializableVersion editorBuildNumber;
|
||||
[SerializeField] internal RiderPathLocator.ProductInfo productInfo;
|
||||
[SerializeField] internal string[] activeScriptCompilationDefines;
|
||||
|
||||
public void Init()
|
||||
{
|
||||
if (editorBuildNumber == null)
|
||||
{
|
||||
Invalidate(RiderScriptEditor.CurrentEditor);
|
||||
}
|
||||
}
|
||||
|
||||
public void InvalidateSavedCompilationDefines()
|
||||
{
|
||||
activeScriptCompilationDefines = EditorUserBuildSettings.activeScriptCompilationDefines;
|
||||
}
|
||||
|
||||
public bool HasChangesInCompilationDefines()
|
||||
{
|
||||
if (activeScriptCompilationDefines == null)
|
||||
return false;
|
||||
|
||||
return !EditorUserBuildSettings.activeScriptCompilationDefines.SequenceEqual(activeScriptCompilationDefines);
|
||||
}
|
||||
|
||||
public void Invalidate(string editorInstallationPath)
|
||||
{
|
||||
var riderBuildNumber = RiderPathLocator.GetBuildNumber(editorInstallationPath);
|
||||
editorBuildNumber = riderBuildNumber.ToSerializableVersion();
|
||||
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"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue