Added UI for DunGenExtender
Made DevOnly fields readonly
This commit is contained in:
parent
894645d85c
commit
32cebc67d6
12 changed files with 295 additions and 41 deletions
22
DunGenPlus/DunGenPlusEditor/ReadOnlyPropertyDrawer.cs
Normal file
22
DunGenPlus/DunGenPlusEditor/ReadOnlyPropertyDrawer.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue