Firstborn/Library/PackageCache/com.unity.visualscripting@1.../Editor/SettingsProvider/EditorPreferencesProviderVi...
Schaken-Mods 9092858a58 updated to the latest editor
I updated everything to the latest Unity Editor. Also realized I had the wrong shaders on my hairs, those are fixed and the hairs look MUCH better!
2023-05-07 17:43:11 -05:00

47 lines
1.4 KiB
C#

using UnityEngine;
using UnityEditor;
namespace Unity.VisualScripting
{
internal class EditorPreferencesProviderView : SettingsProvider
{
private const string Path = "Preferences/Visual Scripting";
private const string Title = "Visual Scripting";
private const string ID = "Bolt";
private readonly GUIStyle marginStyle = new GUIStyle() { margin = new RectOffset(10, 10, 10, 10) };
public EditorPreferencesProviderView() : base(Path, SettingsScope.User)
{
label = Title;
}
private void EnsureConfig()
{
if (BoltCore.instance == null || BoltCore.Configuration == null)
{
PluginContainer.Initialize();
}
}
public override void OnGUI(string searchContext)
{
EnsureConfig();
GUILayout.BeginVertical(marginStyle);
// happens when opening unity with the settings window already opened. there's a delay until the singleton is assigned
if (BoltCore.instance == null)
{
EditorGUILayout.HelpBox("Loading Configuration...", MessageType.Info);
return;
}
var instance = (BoltProduct)ProductContainer.GetProduct(ID);
instance.configurationPanel.PreferenceItem();
GUILayout.EndVertical();
}
}
}