1.4.0: Added ReadableScriptableObjectAttribute and fixed an GUI.enable isssue

* Attribute: Added ReadableScriptableObjectAttribute to allow for inline editing of ScriptableObjects in the inspector
* Attribute: Fixed issue, where root drawer wouldn't use existing value of GUI.enabled, when setting GUI.enabled state with new access value
This commit is contained in:
Anders Ejlersen 2021-12-19 13:45:23 +01:00
parent 05f04657c5
commit ee7326c33a
8 changed files with 198 additions and 31 deletions

View file

@ -0,0 +1,22 @@
#if UNITY_2019_3_OR_NEWER
using System;
namespace Module.Inspector
{
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
public sealed class ReadableScriptableObjectAttribute : DrawerPropertyAttribute
{
public readonly bool editable;
public ReadableScriptableObjectAttribute()
{
editable = true;
}
public ReadableScriptableObjectAttribute(bool editable)
{
this.editable = editable;
}
}
}
#endif

View file

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 319dfc0b017247d69fbe91575384ccf8
timeCreated: 1639910607