feat: Initial commit

This commit is contained in:
2025-02-14 16:06:00 +08:00
commit da75a84e02
1056 changed files with 163517 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
using UnityEngine;
namespace Cryville.Common.Unity.UI {
/// <summary>
/// A <see cref="DockLayoutGroup" /> that sets the aspect ratio of the docking element.
/// </summary>
[AddComponentMenu("Layout/Dock Aspect Ratio Layout Group")]
public sealed class DockAspectRatioLayoutGroup : DockLayoutGroup {
[SerializeField]
[Tooltip("The aspect ratio of the docking element.")]
private float m_dockAspectRatio = 1;
/// <summary>
/// The aspect ratio of the docking element.
/// </summary>
public float DockAspectRatio {
get { return m_dockAspectRatio; }
set { base.SetProperty(ref m_dockAspectRatio, value); }
}
protected override float GetDockElementSize(Vector2 groupSize) {
return groupSize.y * m_dockAspectRatio;
}
}
}