case3
This commit is contained in:
28
Assets/ThirdParty/BOXOPHOBIC/Utils/Editor/StyledInspector/StyledInteractiveDrawer.cs
vendored
Normal file
28
Assets/ThirdParty/BOXOPHOBIC/Utils/Editor/StyledInspector/StyledInteractiveDrawer.cs
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
// Cristian Pop - https://boxophobic.com/
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
namespace Boxophobic.StyledGUI
|
||||
{
|
||||
[CustomPropertyDrawer(typeof(StyledInteractive))]
|
||||
public class StyledInteractiveAttributeDrawer : PropertyDrawer
|
||||
{
|
||||
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
|
||||
{
|
||||
if (property.boolValue == true)
|
||||
{
|
||||
GUI.enabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
GUI.enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
|
||||
{
|
||||
return -2;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user