UTKAccodion 완료. UTKComponentList 수정 중

This commit is contained in:
logonkhi
2026-01-22 20:12:22 +09:00
parent e00953de52
commit 59d473c87b
59 changed files with 2482 additions and 498 deletions

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<UXML xmlns="UnityEngine.UIElements" xmlns:utk="UVC.UIToolkit">
<Style src="../UTKSampleCommon.uss" />
<Style src="UTKWindowSample.uss" />
<VisualElement class="utk-sample-container">
<Label class="utk-sample-desc" text="컴포넌트 리스트에 탭 기능을 추가한 윈도우입니다. 카테고리별 자동 탭 생성과 검색 기능을 제공합니다." />
<VisualElement class="utk-sample-section">
<Label class="utk-sample-section__title" text="UTKComponentTabListWindow" />
<VisualElement name="component-tab-list-window-container" class="utk-window-sample-container" />
</VisualElement>
<!-- Code Sample -->
<VisualElement class="utk-code-sample-container">
<utk:UTKCodeBlock title="C#" code="// 1. 윈도우 참조 획득&#10;var tabWindow = root.Q&lt;UTKComponentTabListWindow&gt;(&quot;tab-window&quot;);&#10;&#10;// 2. 윈도우 제목 설정&#10;tabWindow.Title = &quot;모델 라이브러리&quot;;&#10;tabWindow.ShowCloseButton = true;&#10;&#10;// 3. 데이터 구성 (카테고리가 탭으로 자동 생성)&#10;var data = new List&lt;UTKComponentListItemDataBase&gt;&#10;{&#10; new UTKComponentListCategoryData&#10; {&#10; name = &quot;캐릭터&quot;, // -&gt; 첫 번째 탭&#10; children = new List&lt;UTKComponentListItemDataBase&gt;&#10; {&#10; new UTKComponentListItemData { name = &quot;Player&quot; }&#10; }&#10; },&#10; new UTKComponentListCategoryData&#10; {&#10; name = &quot;환경&quot;, // -&gt; 두 번째 탭&#10; children = new List&lt;UTKComponentListItemDataBase&gt;&#10; {&#10; new UTKComponentListItemData { name = &quot;Tree&quot; }&#10; }&#10; }&#10;};&#10;tabWindow.SetData(data);&#10;&#10;// 4. 탭 선택 (인덱스 기반)&#10;tabWindow.SelectTab(-1); // 전체 (All)&#10;tabWindow.SelectTab(0); // 첫 번째 카테고리&#10;&#10;// 5. 탭 변경 이벤트&#10;tabWindow.OnTabSelected = (tabIndex) =&gt;&#10;{&#10; Debug.Log($&quot;선택된 탭: {tabIndex}&quot;);&#10;};&#10;&#10;// 6. 선택/가시성/삭제 이벤트 (UTKComponentListWindow와 동일)&#10;tabWindow.OnItemSelected = (items) =&gt; { };&#10;tabWindow.OnItemVisibilityChanged += (item, visible) =&gt; { };&#10;tabWindow.OnItemDeleted = (item) =&gt; { };" />
<utk:UTKCodeBlock title="UXML" code="&lt;utk:UTKComponentTabListWindow name=&quot;tab-window&quot; /&gt;" />
</VisualElement>
</VisualElement>
</UXML>