2026-01-20 20:18:47 +09:00
|
|
|
<?xml version="1.0" encoding="utf-8"?>
|
|
|
|
|
<UXML xmlns="UnityEngine.UIElements" xmlns:utk="UVC.UIToolkit">
|
|
|
|
|
<Style src="../UTKSampleCommon.uss" />
|
|
|
|
|
<Style src="UTKInputFieldSample.uss" />
|
|
|
|
|
|
|
|
|
|
<VisualElement class="utk-sample-container">
|
|
|
|
|
<Label class="utk-sample-desc" text="정수 입력 필드" />
|
|
|
|
|
|
|
|
|
|
<!-- Normal -->
|
|
|
|
|
<VisualElement class="utk-sample-section">
|
|
|
|
|
<Label class="utk-sample-section__title" text="Normal" />
|
|
|
|
|
<VisualElement class="utk-sample-row">
|
|
|
|
|
<utk:UTKIntegerField name="int-count" label="Count" value="42" class="utk-sample-input-field--narrow" />
|
|
|
|
|
</VisualElement>
|
|
|
|
|
</VisualElement>
|
|
|
|
|
|
|
|
|
|
<!-- Disabled -->
|
|
|
|
|
<VisualElement class="utk-sample-section">
|
|
|
|
|
<Label class="utk-sample-section__title" text="Disabled" />
|
|
|
|
|
<VisualElement class="utk-sample-row">
|
|
|
|
|
<utk:UTKIntegerField name="int-disabled" label="Disabled" value="100" is-enabled="false" class="utk-sample-input-field--narrow" />
|
|
|
|
|
</VisualElement>
|
|
|
|
|
</VisualElement>
|
2026-01-21 20:43:54 +09:00
|
|
|
|
|
|
|
|
<!-- Code Sample -->
|
|
|
|
|
<VisualElement class="utk-code-sample-container">
|
|
|
|
|
<utk:UTKCodeBlock title="C#" code="// 기본 정수 필드 생성 var intField = new UTKIntegerField(); intField.label = "수량"; intField.Value = 10; // 값 변경 이벤트 intField.OnValueChanged += (value) => { Debug.Log($"수량: {value}"); }; // 라벨과 기본값을 지정하는 생성자 var countField = new UTKIntegerField("아이템 개수", 5); // 현재 값 읽기/쓰기 int currentValue = intField.Value; intField.Value = 20; // 비활성화 intField.IsEnabled = false;" />
|
|
|
|
|
<utk:UTKCodeBlock title="UXML" code="<!-- 기본 정수 필드 --> <utk:UTKIntegerField label="수량" value="10" /> <!-- 비활성화 상태 --> <utk:UTKIntegerField label="고정 값" value="100" is-enabled="false" />" />
|
|
|
|
|
</VisualElement>
|
2026-01-20 20:18:47 +09:00
|
|
|
</VisualElement>
|
|
|
|
|
</UXML>
|