UTKAccodion 완료. UTKComponentList 수정 중
This commit is contained in:
@@ -118,8 +118,8 @@ public class UTKAccordionListWindowSample : MonoBehaviour
|
||||
Content = UTKAccordionContentSpec.FromText("Graphics", "open_graphics"),
|
||||
Tail = new List<UTKAccordionContentSpec>
|
||||
{
|
||||
UTKAccordionContentSpec.FromIconButton("Prefabs/UI/images/icon_refresh_22x22", "refresh_graphics", "새로고침"),
|
||||
UTKAccordionContentSpec.FromIconButton("Prefabs/UI/images/icon_setting_22x22", "setting_graphics", "설정"),
|
||||
UTKAccordionContentSpec.FromIconButton(UTKMaterialIcons.Refresh, 12, "refresh_graphics", "새로고침"),
|
||||
UTKAccordionContentSpec.FromIconButton(UTKMaterialIcons.Settings, 12, "setting_graphics", "설정"),
|
||||
}
|
||||
},
|
||||
new UTKAccordionHorizontalItemData
|
||||
@@ -128,8 +128,8 @@ public class UTKAccordionListWindowSample : MonoBehaviour
|
||||
Content = UTKAccordionContentSpec.FromText("Audio", "open_audio"),
|
||||
Tail = new List<UTKAccordionContentSpec>
|
||||
{
|
||||
UTKAccordionContentSpec.FromIconButton("Prefabs/UI/images/icon_refresh_22x22", "refresh_audio", "새로고침"),
|
||||
UTKAccordionContentSpec.FromIconButton("Prefabs/UI/images/icon_setting_22x22", "setting_audio", "설정"),
|
||||
UTKAccordionContentSpec.FromIconButton(UTKMaterialIcons.Refresh, 12, "refresh_audio", "새로고침"),
|
||||
UTKAccordionContentSpec.FromIconButton(UTKMaterialIcons.Settings, 12, "setting_audio", "설정"),
|
||||
}
|
||||
},
|
||||
new UTKAccordionHorizontalItemData
|
||||
@@ -138,7 +138,7 @@ public class UTKAccordionListWindowSample : MonoBehaviour
|
||||
Content = UTKAccordionContentSpec.FromText("Network", "open_network"),
|
||||
Tail = new List<UTKAccordionContentSpec>
|
||||
{
|
||||
UTKAccordionContentSpec.FromIconButton("Prefabs/UI/images/icon_refresh_22x22", "refresh_network", "새로고침"),
|
||||
UTKAccordionContentSpec.FromIconButton(UTKMaterialIcons.Refresh, 12, "refresh_network", "새로고침"),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -695,15 +695,15 @@ public class UTKAccordionListWindowSample : MonoBehaviour
|
||||
content: UTKAccordionContentSpec.FromText("Graphics", "open_graphics"),
|
||||
tail: new List<UTKAccordionContentSpec>
|
||||
{
|
||||
UTKAccordionContentSpec.FromIconButton("Prefabs/UI/images/icon_refresh_22x22", "refresh_graphics", "새로고침"),
|
||||
UTKAccordionContentSpec.FromIconButton("Prefabs/UI/images/icon_setting_22x22", "setting_graphics", "설정"),
|
||||
UTKAccordionContentSpec.FromIconButton(UTKMaterialIcons.Refresh, 12, "refresh_graphics", "새로고침"),
|
||||
UTKAccordionContentSpec.FromIconButton(UTKMaterialIcons.Settings, 12, "setting_graphics", "설정"),
|
||||
})
|
||||
.AddHorizontalItem(
|
||||
head: UTKAccordionContentSpec.FromImage("Prefabs/UI/images/icon_side_tab_fleet_128"),
|
||||
content: UTKAccordionContentSpec.FromText("Audio", "open_audio"),
|
||||
tail: new List<UTKAccordionContentSpec>
|
||||
{
|
||||
UTKAccordionContentSpec.FromIconButton("Prefabs/UI/images/icon_refresh_22x22", "refresh_audio", "새로고침"),
|
||||
UTKAccordionContentSpec.FromIconButton(UTKMaterialIcons.Refresh, 12, "refresh_audio", "새로고침"),
|
||||
});
|
||||
roots.Add(settingsSection);
|
||||
|
||||
|
||||
@@ -97,6 +97,12 @@ public class UTKStyleGuideSample : MonoBehaviour
|
||||
// Picker
|
||||
["UTKColorPicker"] = "UIToolkit/Sample/Picker/UTKColorPickerSample",
|
||||
["UTKDatePicker"] = "UIToolkit/Sample/Picker/UTKDatePickerSample",
|
||||
// Window
|
||||
["UTKAccordionListWindow"] = "UIToolkit/Sample/Window/UTKAccordionListWindowSample",
|
||||
["UTKComponentListWindow"] = "UIToolkit/Sample/Window/UTKComponentListWindowSample",
|
||||
["UTKComponentTabListWindow"] = "UIToolkit/Sample/Window/UTKComponentTabListWindowSample",
|
||||
["UTKImageListWindow"] = "UIToolkit/Sample/Window/UTKImageListWindowSample",
|
||||
["UTKTreeListWindow"] = "UIToolkit/Sample/Window/UTKTreeListWindowSample",
|
||||
};
|
||||
|
||||
private static readonly Dictionary<string, string[]> ControlCategories = new()
|
||||
@@ -112,6 +118,7 @@ public class UTKStyleGuideSample : MonoBehaviour
|
||||
["Tab"] = new[] { "UTKTabView" },
|
||||
["Modal"] = new[] { "UTKAlert", "UTKToast", "UTKTooltip" },
|
||||
["Picker"] = new[] { "UTKColorPicker", "UTKDatePicker" },
|
||||
["Window"] = new[] { "UTKAccordionListWindow", "UTKComponentListWindow", "UTKComponentTabListWindow", "UTKImageListWindow", "UTKTreeListWindow" },
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
@@ -449,6 +456,21 @@ public class UTKStyleGuideSample : MonoBehaviour
|
||||
case "UTKImage":
|
||||
InitializeUTKImageSample(root);
|
||||
break;
|
||||
case "UTKAccordionListWindow":
|
||||
InitializeAccordionListWindowSample(root);
|
||||
break;
|
||||
case "UTKComponentListWindow":
|
||||
InitializeComponentListWindowSample(root);
|
||||
break;
|
||||
case "UTKComponentTabListWindow":
|
||||
InitializeComponentTabListWindowSample(root);
|
||||
break;
|
||||
case "UTKImageListWindow":
|
||||
InitializeImageListWindowSample(root);
|
||||
break;
|
||||
case "UTKTreeListWindow":
|
||||
InitializeTreeListWindowSample(root);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1642,4 +1664,303 @@ public class UTKStyleGuideSample : MonoBehaviour
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#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);
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
// 테마 변경 이벤트 구독
|
||||
UTKThemeManager.Instance.OnThemeChanged += _ => UTKThemeManager.Instance.ApplyThemeToElement(componentWindow);
|
||||
|
||||
// 샘플 데이터
|
||||
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);
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
// 테마 변경 이벤트 구독
|
||||
UTKThemeManager.Instance.OnThemeChanged += _ => UTKThemeManager.Instance.ApplyThemeToElement(tabWindow);
|
||||
|
||||
// 샘플 데이터 (카테고리가 탭으로 자동 생성됨)
|
||||
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);
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
// 테마 변경 이벤트 구독
|
||||
UTKThemeManager.Instance.OnThemeChanged += _ => UTKThemeManager.Instance.ApplyThemeToElement(imageWindow);
|
||||
|
||||
// 샘플 데이터
|
||||
var data = new List<UTKImageListItemData>
|
||||
{
|
||||
new UTKImageListItemData { itemName = "Texture_01", externalId = "tex_001" },
|
||||
new UTKImageListItemData { itemName = "Texture_02", externalId = "tex_002" },
|
||||
new UTKImageListItemData { itemName = "Texture_03", externalId = "tex_003" },
|
||||
new UTKImageListItemData { itemName = "Texture_04", externalId = "tex_004" }
|
||||
};
|
||||
imageWindow.SetData(data);
|
||||
imageWindow.Show();
|
||||
|
||||
container.Add(imageWindow);
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
// 테마 변경 이벤트 구독
|
||||
UTKThemeManager.Instance.OnThemeChanged += _ => UTKThemeManager.Instance.ApplyThemeToElement(treeWindow);
|
||||
|
||||
// 샘플 데이터
|
||||
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);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user