module-project-validator/Editor/Window/Objects/EditorProjectValidatorEnabledPropertyDrawer.cs
Anders Ejlersen dd55a87740 - Validator: Added asset validators with material texture and shader validation
- 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
2026-05-24 18:06:56 +02:00

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;
}
}
}