UTKAccodion 완료. UTKComponentList 수정 중
This commit is contained in:
@@ -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. 윈도우 참조 획득 var tabWindow = root.Q<UTKComponentTabListWindow>("tab-window"); // 2. 윈도우 제목 설정 tabWindow.Title = "모델 라이브러리"; tabWindow.ShowCloseButton = true; // 3. 데이터 구성 (카테고리가 탭으로 자동 생성) var data = new List<UTKComponentListItemDataBase> { new UTKComponentListCategoryData { name = "캐릭터", // -> 첫 번째 탭 children = new List<UTKComponentListItemDataBase> { new UTKComponentListItemData { name = "Player" } } }, new UTKComponentListCategoryData { name = "환경", // -> 두 번째 탭 children = new List<UTKComponentListItemDataBase> { new UTKComponentListItemData { name = "Tree" } } } }; tabWindow.SetData(data); // 4. 탭 선택 (인덱스 기반) tabWindow.SelectTab(-1); // 전체 (All) tabWindow.SelectTab(0); // 첫 번째 카테고리 // 5. 탭 변경 이벤트 tabWindow.OnTabSelected = (tabIndex) => { Debug.Log($"선택된 탭: {tabIndex}"); }; // 6. 선택/가시성/삭제 이벤트 (UTKComponentListWindow와 동일) tabWindow.OnItemSelected = (items) => { }; tabWindow.OnItemVisibilityChanged += (item, visible) => { }; tabWindow.OnItemDeleted = (item) => { };" />
|
||||
<utk:UTKCodeBlock title="UXML" code="<utk:UTKComponentTabListWindow name="tab-window" />" />
|
||||
</VisualElement>
|
||||
</VisualElement>
|
||||
</UXML>
|
||||
Reference in New Issue
Block a user