Files
Fishing2/Packages/com.waveharmonic.crest/Editor/Scripts/Utility/Shared/Attributes/Embedded.cs
2026-01-01 22:00:33 +08:00

30 lines
814 B
C#

// Crest Water System
// Copyright © 2024 Wave Harmonic. All rights reserved.
using UnityEditor;
using UnityEngine;
using WaveHarmonic.Crest.Attributes;
using WaveHarmonic.Crest.Editor;
namespace WaveHarmonic.Crest
{
sealed class Embedded : DecoratedProperty
{
internal EmbeddedAssetEditor _Editor;
readonly int _BottomMargin;
public Embedded(int margin = 0)
{
_Editor = new();
_BottomMargin = margin;
}
internal override void OnGUI(Rect position, SerializedProperty property, GUIContent label, DecoratedDrawer drawer)
{
_Editor.DrawEditorCombo(label, drawer, property, "asset", _BottomMargin);
}
internal override bool NeedsControlRectangle(SerializedProperty property) => false;
}
}