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

25 lines
946 B
C#
Raw Normal View History

2026-01-08 16:50:20 +00:00
using UnityEditor;
using UnityEngine.UIElements;
namespace Unity.Cinemachine.Editor
{
[CustomPropertyDrawer(typeof(EmbeddedBlenderSettingsPropertyAttribute))]
class EmbeddedBlenderSettingsPropertyDrawer : PropertyDrawer
{
public override VisualElement CreatePropertyGUI(SerializedProperty property)
{
if (property.serializedObject.targetObject is CinemachineCameraManagerBase m)
{
return EmbeddedAssetEditorUtility.EmbeddedAssetInspector<CinemachineBlenderSettings>(property, (ed) =>
{
var editor = ed as CinemachineBlenderSettingsEditor;
if (editor != null)
editor.GetAllVirtualCameras = (list) => list.AddRange(m.ChildCameras);
});
}
return EmbeddedAssetEditorUtility.EmbeddedAssetInspector<CinemachineBlenderSettings>(property, null);
}
}
}