mirror of
https://github.com/codewriter-packages/Tri-Inspector.git
synced 2025-01-22 00:08:51 -05:00
Avoids TriProperty updating when possible
This commit is contained in:
parent
2d13c6421e
commit
48afdfa625
@ -54,7 +54,9 @@ namespace TriInspector.Drawers
|
||||
|
||||
public override void OnGUI(Rect position)
|
||||
{
|
||||
var value = (Enum) _property.Value;
|
||||
var value = _property.TryGetSerializedProperty(out var serializedProperty)
|
||||
? (Enum) Enum.ToObject(_property.FieldType, serializedProperty.intValue)
|
||||
: (Enum) _property.Value;
|
||||
|
||||
var controlId = GUIUtility.GetControlID(FocusType.Passive);
|
||||
position = EditorGUI.PrefixLabel(position, controlId, _property.DisplayNameContent);
|
||||
|
@ -208,6 +208,11 @@ namespace TriInspector
|
||||
{
|
||||
get
|
||||
{
|
||||
if (PropertyType != TriPropertyType.Reference)
|
||||
{
|
||||
return _definition.FieldType;
|
||||
}
|
||||
|
||||
UpdateIfRequired();
|
||||
return _valueType;
|
||||
}
|
||||
@ -217,6 +222,11 @@ namespace TriInspector
|
||||
{
|
||||
get
|
||||
{
|
||||
if (PropertyTree.TargetsCount == 1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
UpdateIfRequired();
|
||||
return _isValueMixed;
|
||||
}
|
||||
@ -239,6 +249,11 @@ namespace TriInspector
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_childrenProperties != null && PropertyType == TriPropertyType.Generic)
|
||||
{
|
||||
return _childrenProperties;
|
||||
}
|
||||
|
||||
UpdateIfRequired();
|
||||
|
||||
return PropertyType == TriPropertyType.Generic || PropertyType == TriPropertyType.Reference
|
||||
|
Loading…
Reference in New Issue
Block a user