forked from Shardstone/trail-into-darkness
changed directory structure
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Jovian.InspectorTools
|
||||
{
|
||||
/// <summary>
|
||||
/// Field will be Read-Only in Playmode
|
||||
/// </summary>
|
||||
public class InitializationFieldAttribute : PropertyAttribute
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
namespace Jovian.InspectorTools.Internal
|
||||
{
|
||||
using UnityEditor;
|
||||
|
||||
[CustomPropertyDrawer(typeof(InitializationFieldAttribute))]
|
||||
public class InitializationFieldAttributeDrawer : 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)
|
||||
{
|
||||
if (Application.isPlaying) GUI.enabled = false;
|
||||
EditorGUI.PropertyField(position, property, label, true);
|
||||
GUI.enabled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user