Files
GameDevTVObstacleDodge/Library/PackageCache/com.unity.cinemachine@5342685532bb/Editor/PropertyDrawers/HideFoldoutPropertyDrawer.cs

26 lines
794 B
C#

using UnityEditor;
using UnityEditor.UIElements;
using UnityEngine.UIElements;
namespace Unity.Cinemachine.Editor
{
[CustomPropertyDrawer(typeof(HideFoldoutAttribute))]
partial class HideFoldoutPropertyDrawer : PropertyDrawer
{
public override VisualElement CreatePropertyGUI(SerializedProperty property)
{
var ux = new VisualElement();
var childProperty = property.Copy();
var endProperty = childProperty.GetEndProperty();
childProperty.NextVisible(true);
while (!SerializedProperty.EqualContents(childProperty, endProperty))
{
ux.Add(new PropertyField(childProperty));
childProperty.NextVisible(false);
}
return ux;
}
}
}