2026-01-23 19:04:12 +09:00
|
|
|
|
#nullable enable
|
|
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using Cysharp.Threading.Tasks;
|
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
using UnityEngine.UIElements;
|
|
|
|
|
|
using UVC.UIToolkit;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// UTKStyleGuideSample의 Window 카테고리 Initialize 메서드들
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public partial class UTKStyleGuideSample
|
|
|
|
|
|
{
|
|
|
|
|
|
#region Window Initializers
|
|
|
|
|
|
|
|
|
|
|
|
private void InitializeAccordionListWindowSample(VisualElement root)
|
|
|
|
|
|
{
|
|
|
|
|
|
var container = root.Q<VisualElement>("accordion-list-window-container");
|
|
|
|
|
|
if (container == null) return;
|
|
|
|
|
|
|
|
|
|
|
|
var accordionWindow = new UTKAccordionListWindow();
|
|
|
|
|
|
accordionWindow.Title = "프리팹 라이브러리";
|
|
|
|
|
|
accordionWindow.ShowCloseButton = true;
|
|
|
|
|
|
|
|
|
|
|
|
var data = new UTKAccordionData();
|
|
|
|
|
|
|
|
|
|
|
|
// ========================================
|
|
|
|
|
|
// 수평 레이아웃 섹션 1: Settings
|
|
|
|
|
|
// ========================================
|
|
|
|
|
|
var settingsSection = new UTKAccordionSectionData
|
|
|
|
|
|
{
|
|
|
|
|
|
Title = "Settings",
|
|
|
|
|
|
IsExpanded = true,
|
|
|
|
|
|
LayoutType = UTKAccordionLayoutType.Horizontal,
|
|
|
|
|
|
HorizontalItems = new List<UTKAccordionHorizontalItemData>
|
|
|
|
|
|
{
|
|
|
|
|
|
new UTKAccordionHorizontalItemData
|
|
|
|
|
|
{
|
|
|
|
|
|
Head = UTKAccordionContentSpec.FromImage(UTKMaterialIcons.LibraryAdd),
|
|
|
|
|
|
Content = UTKAccordionContentSpec.FromText("Graphics", "open_graphics"),
|
|
|
|
|
|
Tail = new List<UTKAccordionContentSpec>
|
|
|
|
|
|
{
|
|
|
|
|
|
UTKAccordionContentSpec.FromIconButton(UTKMaterialIcons.Refresh, 12, "refresh_graphics", "새로고침"),
|
|
|
|
|
|
UTKAccordionContentSpec.FromIconButton(UTKMaterialIcons.Settings, 12, "setting_graphics", "설정"),
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
new UTKAccordionHorizontalItemData
|
|
|
|
|
|
{
|
|
|
|
|
|
Head = UTKAccordionContentSpec.FromImage(UTKMaterialIcons.AudioFile),
|
|
|
|
|
|
Content = UTKAccordionContentSpec.FromText("Audio", "open_audio"),
|
|
|
|
|
|
Tail = new List<UTKAccordionContentSpec>
|
|
|
|
|
|
{
|
|
|
|
|
|
UTKAccordionContentSpec.FromIconButton(UTKMaterialIcons.Refresh, 12, "refresh_audio", "새로고침"),
|
|
|
|
|
|
UTKAccordionContentSpec.FromIconButton(UTKMaterialIcons.Settings, 12, "setting_audio", "설정"),
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
new UTKAccordionHorizontalItemData
|
|
|
|
|
|
{
|
|
|
|
|
|
Head = UTKAccordionContentSpec.FromImage(UTKMaterialIcons.Explore),
|
|
|
|
|
|
Content = UTKAccordionContentSpec.FromText("Network", "open_network"),
|
|
|
|
|
|
Tail = new List<UTKAccordionContentSpec>
|
|
|
|
|
|
{
|
|
|
|
|
|
UTKAccordionContentSpec.FromIconButton(UTKMaterialIcons.Refresh, 12, "refresh_network", "새로고침"),
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
data.Sections.Add(settingsSection);
|
|
|
|
|
|
|
|
|
|
|
|
// ========================================
|
|
|
|
|
|
// 수평 레이아웃 섹션 2: Components
|
|
|
|
|
|
// ========================================
|
|
|
|
|
|
var componentsSection = new UTKAccordionSectionData
|
|
|
|
|
|
{
|
|
|
|
|
|
Title = "Components",
|
|
|
|
|
|
IsExpanded = false,
|
|
|
|
|
|
LayoutType = UTKAccordionLayoutType.Horizontal,
|
|
|
|
|
|
HorizontalItems = new List<UTKAccordionHorizontalItemData>
|
|
|
|
|
|
{
|
|
|
|
|
|
new UTKAccordionHorizontalItemData
|
|
|
|
|
|
{
|
|
|
|
|
|
Content = UTKAccordionContentSpec.FromText("Transform", "open_transform"),
|
|
|
|
|
|
},
|
|
|
|
|
|
new UTKAccordionHorizontalItemData
|
|
|
|
|
|
{
|
|
|
|
|
|
Content = UTKAccordionContentSpec.FromText("Rigidbody", "open_rigidbody"),
|
|
|
|
|
|
},
|
|
|
|
|
|
new UTKAccordionHorizontalItemData
|
|
|
|
|
|
{
|
|
|
|
|
|
Content = UTKAccordionContentSpec.FromText("Collider", "open_collider"),
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
data.Sections.Add(componentsSection);
|
|
|
|
|
|
|
|
|
|
|
|
// ========================================
|
|
|
|
|
|
// 그리드 레이아웃 섹션 1: Vehicles
|
|
|
|
|
|
// ========================================
|
|
|
|
|
|
var vehiclesSection = new UTKAccordionSectionData
|
|
|
|
|
|
{
|
|
|
|
|
|
Title = "Vehicles",
|
|
|
|
|
|
IsExpanded = true,
|
|
|
|
|
|
LayoutType = UTKAccordionLayoutType.Grid,
|
|
|
|
|
|
GridItems = new List<UTKAccordionGridItemData>
|
|
|
|
|
|
{
|
|
|
|
|
|
new UTKAccordionGridItemData
|
|
|
|
|
|
{
|
|
|
|
|
|
Caption = "Forklift",
|
|
|
|
|
|
ImagePath = "Simulator/Images/lib_forklift_400x300",
|
|
|
|
|
|
PrefabPath = "Simulator/FreeForkLift/Prefabs/Forklift",
|
|
|
|
|
|
Tag = "vehicle"
|
|
|
|
|
|
},
|
|
|
|
|
|
new UTKAccordionGridItemData
|
|
|
|
|
|
{
|
|
|
|
|
|
Caption = "Truck",
|
|
|
|
|
|
ImagePath = "Simulator/Images/lib_forklift_400x300",
|
|
|
|
|
|
PrefabPath = "Simulator/FreeForkLift/Prefabs/Forklift",
|
|
|
|
|
|
Tag = "vehicle"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
data.Sections.Add(vehiclesSection);
|
|
|
|
|
|
|
|
|
|
|
|
// ========================================
|
|
|
|
|
|
// 그리드 레이아웃 섹션 2: Objects
|
|
|
|
|
|
// ========================================
|
|
|
|
|
|
var objectsSection = new UTKAccordionSectionData
|
|
|
|
|
|
{
|
|
|
|
|
|
Title = "Objects",
|
|
|
|
|
|
IsExpanded = true,
|
|
|
|
|
|
LayoutType = UTKAccordionLayoutType.Grid,
|
|
|
|
|
|
GridItems = new List<UTKAccordionGridItemData>
|
|
|
|
|
|
{
|
|
|
|
|
|
new UTKAccordionGridItemData
|
|
|
|
|
|
{
|
|
|
|
|
|
Caption = "Pallet",
|
|
|
|
|
|
ImagePath = "Simulator/Images/lib_pallet_400x300",
|
|
|
|
|
|
PrefabPath = "Simulator/FreeForkLift/Prefabs/PalletEmpty",
|
|
|
|
|
|
Tag = "object"
|
|
|
|
|
|
},
|
|
|
|
|
|
new UTKAccordionGridItemData
|
|
|
|
|
|
{
|
|
|
|
|
|
Caption = "Pallet (Full)",
|
|
|
|
|
|
ImagePath = "Simulator/Images/lib_pallet_400x300",
|
|
|
|
|
|
PrefabPath = "Simulator/FreeForkLift/Prefabs/PalletEmpty",
|
|
|
|
|
|
Tag = "object"
|
|
|
|
|
|
},
|
|
|
|
|
|
new UTKAccordionGridItemData
|
|
|
|
|
|
{
|
|
|
|
|
|
Caption = "Box",
|
|
|
|
|
|
ImagePath = "Simulator/Images/lib_pallet_400x300",
|
|
|
|
|
|
PrefabPath = "Simulator/FreeForkLift/Prefabs/PalletEmpty",
|
|
|
|
|
|
Tag = "object"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
data.Sections.Add(objectsSection);
|
|
|
|
|
|
|
|
|
|
|
|
// ========================================
|
|
|
|
|
|
// 그리드 레이아웃 섹션 3: Characters
|
|
|
|
|
|
// ========================================
|
|
|
|
|
|
var charactersSection = new UTKAccordionSectionData
|
|
|
|
|
|
{
|
|
|
|
|
|
Title = "Characters",
|
|
|
|
|
|
IsExpanded = true,
|
|
|
|
|
|
LayoutType = UTKAccordionLayoutType.Grid,
|
|
|
|
|
|
GridItems = new List<UTKAccordionGridItemData>
|
|
|
|
|
|
{
|
|
|
|
|
|
new UTKAccordionGridItemData
|
|
|
|
|
|
{
|
|
|
|
|
|
Caption = "Worker",
|
|
|
|
|
|
ImagePath = "Simulator/Images/lib_worker_400x300",
|
|
|
|
|
|
PrefabPath = "Simulator/CharCrafter – Free Preset Characters Pack (Vol. 1)/Prefabs/Male Young Guy",
|
|
|
|
|
|
Tag = "character"
|
|
|
|
|
|
},
|
|
|
|
|
|
new UTKAccordionGridItemData
|
|
|
|
|
|
{
|
|
|
|
|
|
Caption = "Manager",
|
|
|
|
|
|
ImagePath = "Simulator/Images/lib_worker_400x300",
|
|
|
|
|
|
PrefabPath = "Simulator/CharCrafter – Free Preset Characters Pack (Vol. 1)/Prefabs/Male Young Guy",
|
|
|
|
|
|
Tag = "character"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
data.Sections.Add(charactersSection);
|
|
|
|
|
|
accordionWindow.SetData(data);
|
|
|
|
|
|
accordionWindow.Show();
|
|
|
|
|
|
|
|
|
|
|
|
container.Add(accordionWindow);
|
2026-01-26 20:00:21 +09:00
|
|
|
|
|
|
|
|
|
|
SetCodeSamples(root,
|
|
|
|
|
|
csharpCode: @"// 아코디언 리스트 윈도우 생성
|
|
|
|
|
|
var accordionWindow = new UTKAccordionListWindow();
|
|
|
|
|
|
accordionWindow.Title = ""프리펍 라이브러리"";
|
|
|
|
|
|
accordionWindow.ShowCloseButton = true;
|
|
|
|
|
|
|
|
|
|
|
|
var data = new UTKAccordionData();
|
|
|
|
|
|
|
|
|
|
|
|
// 수평 레이아웃 섹션
|
|
|
|
|
|
var settingsSection = new UTKAccordionSectionData
|
|
|
|
|
|
{
|
|
|
|
|
|
Title = ""Settings"",
|
|
|
|
|
|
IsExpanded = true,
|
|
|
|
|
|
LayoutType = UTKAccordionLayoutType.Horizontal,
|
|
|
|
|
|
HorizontalItems = new List<UTKAccordionHorizontalItemData>
|
|
|
|
|
|
{
|
|
|
|
|
|
new UTKAccordionHorizontalItemData
|
|
|
|
|
|
{
|
|
|
|
|
|
Head = UTKAccordionContentSpec.FromImage(UTKMaterialIcons.LibraryAdd),
|
|
|
|
|
|
Content = UTKAccordionContentSpec.FromText(""Graphics"", ""open_graphics""),
|
|
|
|
|
|
Tail = new List<UTKAccordionContentSpec>
|
|
|
|
|
|
{
|
|
|
|
|
|
UTKAccordionContentSpec.FromIconButton(UTKMaterialIcons.Refresh, 12, ""refresh_graphics"", ""새로고침""),
|
|
|
|
|
|
UTKAccordionContentSpec.FromIconButton(UTKMaterialIcons.Settings, 12, ""setting_graphics"", ""설정""),
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
data.Sections.Add(settingsSection);
|
|
|
|
|
|
|
|
|
|
|
|
// 그리드 레이아웃 섹션
|
|
|
|
|
|
var vehiclesSection = new UTKAccordionSectionData
|
|
|
|
|
|
{
|
|
|
|
|
|
Title = ""Vehicles"",
|
|
|
|
|
|
IsExpanded = true,
|
|
|
|
|
|
LayoutType = UTKAccordionLayoutType.Grid,
|
|
|
|
|
|
GridItems = new List<UTKAccordionGridItemData>
|
|
|
|
|
|
{
|
|
|
|
|
|
new UTKAccordionGridItemData
|
|
|
|
|
|
{
|
|
|
|
|
|
Caption = ""Forklift"",
|
|
|
|
|
|
ImagePath = ""Simulator/Images/lib_forklift_400x300"",
|
|
|
|
|
|
PrefabPath = ""Simulator/FreeForkLift/Prefabs/Forklift"",
|
|
|
|
|
|
Tag = ""vehicle""
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
data.Sections.Add(vehiclesSection);
|
|
|
|
|
|
|
|
|
|
|
|
accordionWindow.SetData(data);
|
|
|
|
|
|
accordionWindow.Show();");
|
2026-01-23 19:04:12 +09:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void InitializeComponentListWindowSample(VisualElement root)
|
|
|
|
|
|
{
|
|
|
|
|
|
var container = root.Q<VisualElement>("component-list-window-container");
|
|
|
|
|
|
if (container == null) return;
|
|
|
|
|
|
|
|
|
|
|
|
var componentWindow = new UTKComponentListWindow();
|
|
|
|
|
|
componentWindow.Title = "모델 리스트";
|
|
|
|
|
|
componentWindow.ShowCloseButton = true;
|
2026-01-29 20:14:39 +09:00
|
|
|
|
componentWindow.OnItemIconClicked += (itemType, itemData) =>
|
|
|
|
|
|
{
|
|
|
|
|
|
Debug.Log($"아이콘 클릭됨: {itemType}, {itemData.name})");
|
|
|
|
|
|
};
|
|
|
|
|
|
componentWindow.OnItemVisibilityChanged += (itemData, isVisible) =>
|
|
|
|
|
|
{
|
|
|
|
|
|
Debug.Log($"가시성 변경됨: {itemData.name}, IsVisible={isVisible})");
|
|
|
|
|
|
};
|
2026-01-23 19:04:12 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 샘플 데이터
|
|
|
|
|
|
var category1 = new UTKComponentListCategoryData { name = "캐릭터", isExpanded = true };
|
|
|
|
|
|
category1.Add(new UTKComponentListItemData { name = "플레이어", ExternalKey = "player_001", IsVisible = true });
|
|
|
|
|
|
category1.Add(new UTKComponentListItemData { name = "NPC_01", ExternalKey = "npc_001", IsVisible = true });
|
|
|
|
|
|
category1.Add(new UTKComponentListItemData { name = "NPC_02", ExternalKey = "npc_002", IsVisible = false });
|
|
|
|
|
|
|
|
|
|
|
|
var category2 = new UTKComponentListCategoryData { name = "환경", isExpanded = false };
|
|
|
|
|
|
category2.Add(new UTKComponentListItemData { name = "나무", ExternalKey = "tree_001", IsVisible = true });
|
|
|
|
|
|
category2.Add(new UTKComponentListItemData { name = "바위", ExternalKey = "rock_001", IsVisible = true });
|
|
|
|
|
|
|
|
|
|
|
|
var data = new List<UTKComponentListItemDataBase> { category1, category2 };
|
|
|
|
|
|
componentWindow.SetData(data);
|
|
|
|
|
|
componentWindow.Show();
|
|
|
|
|
|
|
|
|
|
|
|
container.Add(componentWindow);
|
2026-01-26 20:00:21 +09:00
|
|
|
|
|
|
|
|
|
|
SetCodeSamples(root,
|
|
|
|
|
|
csharpCode: @"// 컴포넌트 리스트 윈도우 생성
|
|
|
|
|
|
var componentWindow = new UTKComponentListWindow();
|
|
|
|
|
|
componentWindow.Title = ""모델 리스트"";
|
|
|
|
|
|
componentWindow.ShowCloseButton = true;
|
|
|
|
|
|
|
|
|
|
|
|
// 샘플 데이터
|
|
|
|
|
|
var category1 = new UTKComponentListCategoryData { name = ""캐릭터"", isExpanded = true };
|
|
|
|
|
|
category1.Add(new UTKComponentListItemData { name = ""플레이어"", ExternalKey = ""player_001"", IsVisible = true });
|
|
|
|
|
|
category1.Add(new UTKComponentListItemData { name = ""NPC_01"", ExternalKey = ""npc_001"", IsVisible = true });
|
|
|
|
|
|
category1.Add(new UTKComponentListItemData { name = ""NPC_02"", ExternalKey = ""npc_002"", IsVisible = false });
|
|
|
|
|
|
|
|
|
|
|
|
var category2 = new UTKComponentListCategoryData { name = ""환경"", isExpanded = false };
|
|
|
|
|
|
category2.Add(new UTKComponentListItemData { name = ""나무"", ExternalKey = ""tree_001"", IsVisible = true });
|
|
|
|
|
|
category2.Add(new UTKComponentListItemData { name = ""바위"", ExternalKey = ""rock_001"", IsVisible = true });
|
|
|
|
|
|
|
|
|
|
|
|
var data = new List<UTKComponentListItemDataBase> { category1, category2 };
|
|
|
|
|
|
componentWindow.SetData(data);
|
|
|
|
|
|
componentWindow.Show();");
|
2026-01-23 19:04:12 +09:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void InitializeComponentTabListWindowSample(VisualElement root)
|
|
|
|
|
|
{
|
|
|
|
|
|
var container = root.Q<VisualElement>("component-tab-list-window-container");
|
|
|
|
|
|
if (container == null) return;
|
|
|
|
|
|
|
|
|
|
|
|
var tabWindow = new UTKComponentTabListWindow();
|
|
|
|
|
|
tabWindow.Title = "모델 라이브러리";
|
|
|
|
|
|
tabWindow.ShowCloseButton = true;
|
|
|
|
|
|
|
|
|
|
|
|
// 샘플 데이터 (카테고리가 탭으로 자동 생성됨)
|
|
|
|
|
|
var category1 = new UTKComponentListCategoryData { name = "캐릭터", isExpanded = true };
|
|
|
|
|
|
category1.Add(new UTKComponentListItemData { name = "플레이어", IsVisible = true });
|
|
|
|
|
|
category1.Add(new UTKComponentListItemData { name = "몬스터", IsVisible = true });
|
|
|
|
|
|
|
|
|
|
|
|
var category2 = new UTKComponentListCategoryData { name = "환경", isExpanded = true };
|
|
|
|
|
|
category2.Add(new UTKComponentListItemData { name = "나무", IsVisible = true });
|
|
|
|
|
|
category2.Add(new UTKComponentListItemData { name = "풀", IsVisible = true });
|
|
|
|
|
|
|
|
|
|
|
|
var category3 = new UTKComponentListCategoryData { name = "아이템", isExpanded = true };
|
|
|
|
|
|
category3.Add(new UTKComponentListItemData { name = "검", IsVisible = true });
|
|
|
|
|
|
category3.Add(new UTKComponentListItemData { name = "방패", IsVisible = true });
|
|
|
|
|
|
|
|
|
|
|
|
var data = new List<UTKComponentListItemDataBase> { category1, category2, category3 };
|
|
|
|
|
|
tabWindow.SetData(data);
|
|
|
|
|
|
tabWindow.Show();
|
|
|
|
|
|
|
|
|
|
|
|
container.Add(tabWindow);
|
2026-01-26 20:00:21 +09:00
|
|
|
|
|
|
|
|
|
|
SetCodeSamples(root,
|
|
|
|
|
|
csharpCode: @"// 컴포넌트 탭 리스트 윈도우 생성
|
|
|
|
|
|
var tabWindow = new UTKComponentTabListWindow();
|
|
|
|
|
|
tabWindow.Title = ""모델 라이브러리"";
|
|
|
|
|
|
tabWindow.ShowCloseButton = true;
|
|
|
|
|
|
|
|
|
|
|
|
// 샘플 데이터 (카테고리가 탭으로 자동 생성됨)
|
|
|
|
|
|
var category1 = new UTKComponentListCategoryData { name = ""캐릭터"", isExpanded = true };
|
|
|
|
|
|
category1.Add(new UTKComponentListItemData { name = ""플레이어"", IsVisible = true });
|
|
|
|
|
|
category1.Add(new UTKComponentListItemData { name = ""몬스터"", IsVisible = true });
|
|
|
|
|
|
|
|
|
|
|
|
var category2 = new UTKComponentListCategoryData { name = ""환경"", isExpanded = true };
|
|
|
|
|
|
category2.Add(new UTKComponentListItemData { name = ""나무"", IsVisible = true });
|
|
|
|
|
|
category2.Add(new UTKComponentListItemData { name = ""풀"", IsVisible = true });
|
|
|
|
|
|
|
|
|
|
|
|
var category3 = new UTKComponentListCategoryData { name = ""아이템"", isExpanded = true };
|
|
|
|
|
|
category3.Add(new UTKComponentListItemData { name = ""검"", IsVisible = true });
|
|
|
|
|
|
category3.Add(new UTKComponentListItemData { name = ""방패"", IsVisible = true });
|
|
|
|
|
|
|
|
|
|
|
|
var data = new List<UTKComponentListItemDataBase> { category1, category2, category3 };
|
|
|
|
|
|
tabWindow.SetData(data);
|
|
|
|
|
|
tabWindow.Show();");
|
2026-01-23 19:04:12 +09:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void InitializeImageListWindowSample(VisualElement root)
|
|
|
|
|
|
{
|
|
|
|
|
|
var container = root.Q<VisualElement>("image-list-window-container");
|
|
|
|
|
|
if (container == null) return;
|
|
|
|
|
|
|
|
|
|
|
|
var imageWindow = new UTKImageListWindow();
|
|
|
|
|
|
imageWindow.Title = "텍스처 라이브러리";
|
|
|
|
|
|
imageWindow.ShowCloseButton = true;
|
|
|
|
|
|
|
|
|
|
|
|
// 샘플 데이터
|
|
|
|
|
|
var data = new List<UTKImageListItemData>
|
|
|
|
|
|
{
|
2026-01-29 20:14:39 +09:00
|
|
|
|
new UTKImageListItemData { itemName = "Texture_01", externalId = "tex_001", imagePath = "Simulator/Images/lib_forklift_400x300", objectPrefabPath = "Simulator/FreeForkLift/Prefabs/Forklift" },
|
|
|
|
|
|
new UTKImageListItemData { itemName = "Texture_02", externalId = "tex_002", imagePath = "Simulator/Images/lib_pallet_400x300", objectPrefabPath = "Simulator/FreeForkLift/Prefabs/PalletEmpty" },
|
|
|
|
|
|
new UTKImageListItemData { itemName = "Texture_03", externalId = "tex_003", imagePath = "Simulator/Images/lib_worker_400x300", objectPrefabPath = "Simulator/CharCrafter – Free Preset Characters Pack (Vol. 1)/Prefabs/Male Young Guy" },
|
|
|
|
|
|
new UTKImageListItemData { itemName = "Texture_04", externalId = "tex_004", imagePath = "Simulator/Images/lib_forklift_400x300", objectPrefabPath = "Simulator/FreeForkLift/Prefabs/Forklift" }
|
2026-01-23 19:04:12 +09:00
|
|
|
|
};
|
|
|
|
|
|
imageWindow.SetData(data);
|
|
|
|
|
|
imageWindow.Show();
|
|
|
|
|
|
|
|
|
|
|
|
container.Add(imageWindow);
|
2026-01-26 20:00:21 +09:00
|
|
|
|
|
|
|
|
|
|
SetCodeSamples(root,
|
|
|
|
|
|
csharpCode: @"// 이미지 리스트 윈도우 생성
|
|
|
|
|
|
var imageWindow = new UTKImageListWindow();
|
|
|
|
|
|
imageWindow.Title = ""텍스처 라이브러리"";
|
|
|
|
|
|
imageWindow.ShowCloseButton = true;
|
|
|
|
|
|
|
|
|
|
|
|
// 샘플 데이터
|
|
|
|
|
|
var data = new List<UTKImageListItemData>
|
|
|
|
|
|
{
|
2026-01-29 20:14:39 +09:00
|
|
|
|
new UTKImageListItemData { itemName = ""Texture_01"", externalId = ""tex_001"", imagePath = ""Simulator/Images/lib_forklift_400x300"", objectPrefabPath = ""Simulator/FreeForkLift/Prefabs/Forklift"" },
|
|
|
|
|
|
new UTKImageListItemData { itemName = ""Texture_02"", externalId = ""tex_002"", imagePath = ""Simulator/Images/lib_pallet_400x300"", objectPrefabPath = ""Simulator/FreeForkLift/Prefabs/PalletEmpty"" },
|
|
|
|
|
|
new UTKImageListItemData { itemName = ""Texture_03"", externalId = ""tex_003"", imagePath = ""Simulator/Images/lib_worker_400x300"", objectPrefabPath = ""Simulator/CharCrafter – Free Preset Characters Pack (Vol. 1)/Prefabs/Male Young Guy"" },
|
|
|
|
|
|
new UTKImageListItemData { itemName = ""Texture_04"", externalId = ""tex_004"", imagePath = ""Simulator/Images/lib_forklift_400x300"", objectPrefabPath = ""Simulator/FreeForkLift/Prefabs/Forklift"" }
|
2026-01-26 20:00:21 +09:00
|
|
|
|
};
|
|
|
|
|
|
imageWindow.SetData(data);
|
|
|
|
|
|
imageWindow.Show();");
|
2026-01-23 19:04:12 +09:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void InitializeTreeListWindowSample(VisualElement root)
|
|
|
|
|
|
{
|
|
|
|
|
|
var container = root.Q<VisualElement>("tree-list-window-container");
|
|
|
|
|
|
if (container == null) return;
|
|
|
|
|
|
|
|
|
|
|
|
var treeWindow = new UTKTreeListWindow();
|
|
|
|
|
|
treeWindow.Title = "씬 계층 구조";
|
|
|
|
|
|
treeWindow.ShowCloseButton = true;
|
|
|
|
|
|
|
2026-01-29 20:14:39 +09:00
|
|
|
|
treeWindow.OnItemSelected += (itemDataList) =>
|
|
|
|
|
|
{
|
|
|
|
|
|
Debug.Log($"선택된 아이템: {string.Join(", ", itemDataList.ConvertAll(i => i.name))}");
|
|
|
|
|
|
};
|
2026-01-23 19:04:12 +09:00
|
|
|
|
|
|
|
|
|
|
// 샘플 데이터
|
|
|
|
|
|
var environment = new UTKTreeListItemData { name = "Environment", isExpanded = true };
|
|
|
|
|
|
environment.Add(new UTKTreeListItemData { name = "Terrain", ExternalKey = "terrain_001", IsVisible = true });
|
|
|
|
|
|
environment.Add(new UTKTreeListItemData { name = "Trees", ExternalKey = "trees_001", IsVisible = true });
|
|
|
|
|
|
|
|
|
|
|
|
var characters = new UTKTreeListItemData { name = "Characters", isExpanded = false };
|
|
|
|
|
|
characters.Add(new UTKTreeListItemData { name = "Player", ExternalKey = "player_001", IsVisible = true });
|
|
|
|
|
|
characters.Add(new UTKTreeListItemData { name = "Enemies", ExternalKey = "enemies_001", IsVisible = true });
|
|
|
|
|
|
|
|
|
|
|
|
var rootNode = new UTKTreeListItemData { name = "Root", isExpanded = true };
|
|
|
|
|
|
rootNode.Add(environment);
|
|
|
|
|
|
rootNode.Add(characters);
|
|
|
|
|
|
|
|
|
|
|
|
var data = new List<UTKTreeListItemData> { rootNode };
|
|
|
|
|
|
treeWindow.SetData(data);
|
|
|
|
|
|
treeWindow.Show();
|
|
|
|
|
|
|
|
|
|
|
|
container.Add(treeWindow);
|
2026-01-26 20:00:21 +09:00
|
|
|
|
|
|
|
|
|
|
SetCodeSamples(root,
|
|
|
|
|
|
csharpCode: @"// 트리 리스트 윈도우 생성
|
|
|
|
|
|
var treeWindow = new UTKTreeListWindow();
|
|
|
|
|
|
treeWindow.Title = ""씬 계층 구조"";
|
|
|
|
|
|
treeWindow.ShowCloseButton = true;
|
|
|
|
|
|
|
|
|
|
|
|
// 샘플 데이터
|
|
|
|
|
|
var environment = new UTKTreeListItemData { name = ""Environment"", isExpanded = true };
|
|
|
|
|
|
environment.Add(new UTKTreeListItemData { name = ""Terrain"", ExternalKey = ""terrain_001"", IsVisible = true });
|
|
|
|
|
|
environment.Add(new UTKTreeListItemData { name = ""Trees"", ExternalKey = ""trees_001"", IsVisible = true });
|
|
|
|
|
|
|
|
|
|
|
|
var characters = new UTKTreeListItemData { name = ""Characters"", isExpanded = false };
|
|
|
|
|
|
characters.Add(new UTKTreeListItemData { name = ""Player"", ExternalKey = ""player_001"", IsVisible = true });
|
|
|
|
|
|
characters.Add(new UTKTreeListItemData { name = ""Enemies"", ExternalKey = ""enemies_001"", IsVisible = true });
|
|
|
|
|
|
|
|
|
|
|
|
var rootNode = new UTKTreeListItemData { name = ""Root"", isExpanded = true };
|
|
|
|
|
|
rootNode.Add(environment);
|
|
|
|
|
|
rootNode.Add(characters);
|
|
|
|
|
|
|
|
|
|
|
|
var data = new List<UTKTreeListItemData> { rootNode };
|
|
|
|
|
|
treeWindow.SetData(data);
|
|
|
|
|
|
treeWindow.Show();");
|
2026-01-23 19:04:12 +09:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
}
|