StyleGuide Sample 완료
This commit is contained in:
@@ -9,6 +9,27 @@ namespace UVC.UIToolkit
|
||||
/// 실수 입력 필드 컴포넌트.
|
||||
/// Unity FloatField를 래핑하여 커스텀 스타일을 적용합니다.
|
||||
/// </summary>
|
||||
/// <example>
|
||||
/// <para><b>C# 코드에서 사용:</b></para>
|
||||
/// <code>
|
||||
/// // 기본 실수 필드
|
||||
/// var floatField = new UTKFloatField();
|
||||
/// floatField.label = "가격";
|
||||
/// floatField.value = 99.99f;
|
||||
///
|
||||
/// // 값 변경 이벤트
|
||||
/// floatField.OnValueChanged += (value) => Debug.Log($"가격: {value}");
|
||||
///
|
||||
/// // 현재 값 접근
|
||||
/// float current = floatField.Value;
|
||||
/// </code>
|
||||
/// <para><b>UXML에서 사용:</b></para>
|
||||
/// <code>
|
||||
/// <ui:UXML xmlns:utk="UVC.UIToolkit">
|
||||
/// <utk:UTKFloatField label="가격" value="99.99" />
|
||||
/// </ui:UXML>
|
||||
/// </code>
|
||||
/// </example>
|
||||
[UxmlElement]
|
||||
public partial class UTKFloatField : FloatField, IDisposable
|
||||
{
|
||||
|
||||
@@ -9,6 +9,47 @@ namespace UVC.UIToolkit
|
||||
/// 입력 필드 컴포넌트.
|
||||
/// Unity TextField를 래핑하여 커스텀 스타일을 적용합니다.
|
||||
/// </summary>
|
||||
/// <example>
|
||||
/// <para><b>C# 코드에서 사용:</b></para>
|
||||
/// <code>
|
||||
/// // 기본 입력 필드
|
||||
/// var input = new UTKInputField();
|
||||
/// input.Label = "이름";
|
||||
/// input.Placeholder = "이름을 입력하세요";
|
||||
/// input.OnValueChanged += (value) => Debug.Log($"입력값: {value}");
|
||||
///
|
||||
/// // 비밀번호 입력 필드
|
||||
/// var password = new UTKInputField();
|
||||
/// password.Label = "비밀번호";
|
||||
/// password.isPasswordField = true;
|
||||
///
|
||||
/// // 검증 오류 표시
|
||||
/// input.SetError("이름은 필수입니다.");
|
||||
/// input.ClearError();
|
||||
///
|
||||
/// // 변형 스타일
|
||||
/// input.Variant = UTKInputField.InputFieldVariant.Outlined;
|
||||
/// </code>
|
||||
/// <para><b>UXML에서 사용:</b></para>
|
||||
/// <code>
|
||||
/// <ui:UXML xmlns:utk="UVC.UIToolkit">
|
||||
/// <!-- 기본 입력 필드 -->
|
||||
/// <utk:UTKInputField label="이름" />
|
||||
///
|
||||
/// <!-- 플레이스홀더 -->
|
||||
/// <utk:UTKInputField label="이메일" Placeholder="example@email.com" />
|
||||
///
|
||||
/// <!-- 비밀번호 필드 -->
|
||||
/// <utk:UTKInputField label="비밀번호" is-password-field="true" />
|
||||
///
|
||||
/// <!-- 여러 줄 입력 -->
|
||||
/// <utk:UTKInputField label="설명" multiline="true" />
|
||||
///
|
||||
/// <!-- 비활성화 -->
|
||||
/// <utk:UTKInputField label="읽기전용" IsEnabled="false" value="수정 불가" />
|
||||
/// </ui:UXML>
|
||||
/// </code>
|
||||
/// </example>
|
||||
[UxmlElement]
|
||||
public partial class UTKInputField : TextField, IDisposable
|
||||
{
|
||||
@@ -133,6 +174,12 @@ namespace UVC.UIToolkit
|
||||
SetupStyles();
|
||||
SetupEvents();
|
||||
SubscribeToThemeChanges();
|
||||
|
||||
// UXML에서 로드될 때 속성이 설정된 후 UI 갱신
|
||||
RegisterCallback<AttachToPanelEvent>(_ =>
|
||||
{
|
||||
UpdateVariant();
|
||||
});
|
||||
}
|
||||
|
||||
public UTKInputField(string label, string placeholder = "") : this()
|
||||
|
||||
@@ -9,6 +9,27 @@ namespace UVC.UIToolkit
|
||||
/// 정수 입력 필드 컴포넌트.
|
||||
/// Unity IntegerField를 래핑하여 커스텀 스타일을 적용합니다.
|
||||
/// </summary>
|
||||
/// <example>
|
||||
/// <para><b>C# 코드에서 사용:</b></para>
|
||||
/// <code>
|
||||
/// // 기본 정수 필드
|
||||
/// var intField = new UTKIntegerField();
|
||||
/// intField.label = "수량";
|
||||
/// intField.value = 10;
|
||||
///
|
||||
/// // 값 변경 이벤트
|
||||
/// intField.OnValueChanged += (value) => Debug.Log($"수량: {value}");
|
||||
///
|
||||
/// // 현재 값 접근
|
||||
/// int current = intField.Value;
|
||||
/// </code>
|
||||
/// <para><b>UXML에서 사용:</b></para>
|
||||
/// <code>
|
||||
/// <ui:UXML xmlns:utk="UVC.UIToolkit">
|
||||
/// <utk:UTKIntegerField label="수량" value="10" />
|
||||
/// </ui:UXML>
|
||||
/// </code>
|
||||
/// </example>
|
||||
[UxmlElement]
|
||||
public partial class UTKIntegerField : IntegerField, IDisposable
|
||||
{
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UIElements;
|
||||
using UVC.UIToolkit.Common;
|
||||
|
||||
namespace UVC.UIToolkit.Input
|
||||
{
|
||||
@@ -217,15 +218,17 @@ namespace UVC.UIToolkit.Input
|
||||
buttonContainer.AddToClassList("utk-number-stepper__buttons");
|
||||
|
||||
// Up Button
|
||||
_upButton = new Button { name = "stepper-up", text = "\u25B2" }; // ▲
|
||||
_upButton = new Button { name = "stepper-up", text = UTKMaterialIcons.KeyboardArrowUp };
|
||||
_upButton.AddToClassList("utk-number-stepper__btn");
|
||||
_upButton.AddToClassList("utk-number-stepper__btn--up");
|
||||
UTKMaterialIcons.ApplyIconStyle(_upButton, 14);
|
||||
buttonContainer.Add(_upButton);
|
||||
|
||||
// Down Button
|
||||
_downButton = new Button { name = "stepper-down", text = "\u25BC" }; // ▼
|
||||
_downButton = new Button { name = "stepper-down", text = UTKMaterialIcons.KeyboardArrowDown };
|
||||
_downButton.AddToClassList("utk-number-stepper__btn");
|
||||
_downButton.AddToClassList("utk-number-stepper__btn--down");
|
||||
UTKMaterialIcons.ApplyIconStyle(_downButton, 14);
|
||||
buttonContainer.Add(_downButton);
|
||||
|
||||
Add(buttonContainer);
|
||||
|
||||
@@ -9,6 +9,29 @@ namespace UVC.UIToolkit
|
||||
/// Vector3 입력 필드 컴포넌트.
|
||||
/// Unity Vector3Field를 래핑하여 커스텀 스타일을 적용합니다.
|
||||
/// </summary>
|
||||
/// <example>
|
||||
/// <para><b>C# 코드에서 사용:</b></para>
|
||||
/// <code>
|
||||
/// // 기본 Vector3 필드
|
||||
/// var vec3Field = new UTKVector3Field();
|
||||
/// vec3Field.label = "위치";
|
||||
/// vec3Field.Value = new Vector3(1, 2, 3);
|
||||
///
|
||||
/// // 값 변경 이벤트
|
||||
/// vec3Field.OnValueChanged += (vec) => Debug.Log($"위치: {vec}");
|
||||
///
|
||||
/// // 라벨 커스터마이징
|
||||
/// vec3Field.XLabel = "X위치";
|
||||
/// vec3Field.YLabel = "Y위치";
|
||||
/// vec3Field.ZLabel = "Z위치";
|
||||
/// </code>
|
||||
/// <para><b>UXML에서 사용:</b></para>
|
||||
/// <code>
|
||||
/// <ui:UXML xmlns:utk="UVC.UIToolkit">
|
||||
/// <utk:UTKVector3Field label="위치" />
|
||||
/// </ui:UXML>
|
||||
/// </code>
|
||||
/// </example>
|
||||
[UxmlElement]
|
||||
public partial class UTKVector3Field : Vector3Field, IDisposable
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user