ShowOnlyAttribute
This commit is contained in:
parent
13472c4a72
commit
06b096b907
|
@ -0,0 +1,21 @@
|
||||||
|
using UnityEditor;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
[CustomPropertyDrawer(typeof(ShowOnlyAttribute))]
|
||||||
|
public class ShowOnlyDrawer : PropertyDrawer
|
||||||
|
{
|
||||||
|
public override float GetPropertyHeight(SerializedProperty property,
|
||||||
|
GUIContent label)
|
||||||
|
{
|
||||||
|
return EditorGUI.GetPropertyHeight(property, label, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void OnGUI(Rect position,
|
||||||
|
SerializedProperty property,
|
||||||
|
GUIContent label)
|
||||||
|
{
|
||||||
|
GUI.enabled = false;
|
||||||
|
EditorGUI.PropertyField(position, property, label, true);
|
||||||
|
GUI.enabled = true;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: adbb53bc6865b2f44adf93532a11a80e
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -0,0 +1,8 @@
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Das Feld wird im Inspector nur angezeigt und kann nicht verändert werden.
|
||||||
|
/// </summary>
|
||||||
|
public class ShowOnlyAttribute : PropertyAttribute
|
||||||
|
{
|
||||||
|
}
|
|
@ -0,0 +1,3 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 4218f171d49f43e9aaa8d2856e98fc06
|
||||||
|
timeCreated: 1712225177
|
Loading…
Reference in New Issue