Added UI for DunGenExtender

Made DevOnly fields readonly
This commit is contained in:
LadyAliceMargatroid 2024-09-10 23:06:32 -07:00
parent 894645d85c
commit 32cebc67d6
12 changed files with 295 additions and 41 deletions

View file

@ -0,0 +1,22 @@
using DunGenPlus.Attributes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEditor;
using UnityEngine;
using UnityEditor.UIElements;
using UnityEngine.UIElements;
namespace DunGenPlusEditor {
[CustomPropertyDrawer(typeof(ReadOnlyAttribute))]
public class ReadOnlyPropertyDrawer : PropertyDrawer {
public override VisualElement CreatePropertyGUI(SerializedProperty property) {
var item = new PropertyField(property);
item.SetEnabled(false);
return item;
}
}
}