Tri-Inspector/Editor/Elements/TriBuiltInPropertyElement.cs
2022-01-05 14:59:05 +03:00

33 lines
1.0 KiB
C#

using TriInspector.Utilities;
using UnityEditor;
using UnityEngine;
namespace TriInspector.Elements
{
internal class TriBuiltInPropertyElement : TriElement
{
private readonly TriProperty _property;
private readonly PropertyHandlerProxy _propertyHandler;
private readonly SerializedProperty _serializedProperty;
public TriBuiltInPropertyElement(
TriProperty property,
SerializedProperty serializedProperty,
PropertyHandlerProxy propertyHandler)
{
_property = property;
_serializedProperty = serializedProperty;
_propertyHandler = propertyHandler;
}
public override float GetHeight(float width)
{
return _propertyHandler.GetHeight(_serializedProperty, _property.DisplayNameContent, true);
}
public override void OnGUI(Rect position)
{
_propertyHandler.OnGUI(position, _serializedProperty, _property.DisplayNameContent, true);
}
}
}