- Validator: Added option to enable/disable certain validators - Project Settings: Fixed issue, where changes weren't always saved - Unity: Removed deprecated warnings in Unity 6.4
23 lines
No EOL
1,000 B
C#
23 lines
No EOL
1,000 B
C#
using UnityEditor;
|
|
using UnityEditor.UIElements;
|
|
using UnityEngine.UIElements;
|
|
|
|
namespace Module.ProjectValidator.Editor
|
|
{
|
|
[CustomPropertyDrawer(typeof(ProjectValidatorSettings.ValidatorEnabled))]
|
|
internal sealed class EditorProjectValidatorEnabledPropertyDrawer : PropertyDrawer
|
|
{
|
|
public override VisualElement CreatePropertyGUI(SerializedProperty property)
|
|
{
|
|
var spType = property.FindPropertyRelative(nameof(ProjectValidatorSettings.ValidatorEnabled.type));
|
|
var spEnabled = property.FindPropertyRelative(nameof(ProjectValidatorSettings.ValidatorEnabled.enabled));
|
|
|
|
var root = new VisualElement { style = { flexDirection = FlexDirection.Row } };
|
|
var veType = new PropertyField(spType, string.Empty) { style = { flexGrow = 1f } };
|
|
var veEnabled = new PropertyField(spEnabled, string.Empty);
|
|
root.Add(veEnabled);
|
|
root.Add(veType);
|
|
return root;
|
|
}
|
|
}
|
|
} |