Dropdown popup 스타일 가이드 적용 및 다중 선택 Dropdown 추가
This commit is contained in:
653
Assets/Sample/UIToolkit/UTKMultiSelectDropdown.unity
Normal file
653
Assets/Sample/UIToolkit/UTKMultiSelectDropdown.unity
Normal file
@@ -0,0 +1,653 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!29 &1
|
||||
OcclusionCullingSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_OcclusionBakeSettings:
|
||||
smallestOccluder: 5
|
||||
smallestHole: 0.25
|
||||
backfaceThreshold: 100
|
||||
m_SceneGUID: 00000000000000000000000000000000
|
||||
m_OcclusionCullingData: {fileID: 0}
|
||||
--- !u!104 &2
|
||||
RenderSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 10
|
||||
m_Fog: 0
|
||||
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
|
||||
m_FogMode: 3
|
||||
m_FogDensity: 0.01
|
||||
m_LinearFogStart: 0
|
||||
m_LinearFogEnd: 300
|
||||
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
|
||||
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
|
||||
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
|
||||
m_AmbientIntensity: 1
|
||||
m_AmbientMode: 0
|
||||
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
|
||||
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_HaloStrength: 0.5
|
||||
m_FlareStrength: 1
|
||||
m_FlareFadeSpeed: 3
|
||||
m_HaloTexture: {fileID: 0}
|
||||
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_DefaultReflectionMode: 0
|
||||
m_DefaultReflectionResolution: 128
|
||||
m_ReflectionBounces: 1
|
||||
m_ReflectionIntensity: 1
|
||||
m_CustomReflection: {fileID: 0}
|
||||
m_Sun: {fileID: 0}
|
||||
m_UseRadianceAmbientProbe: 0
|
||||
--- !u!157 &3
|
||||
LightmapSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 13
|
||||
m_BakeOnSceneLoad: 0
|
||||
m_GISettings:
|
||||
serializedVersion: 2
|
||||
m_BounceScale: 1
|
||||
m_IndirectOutputScale: 1
|
||||
m_AlbedoBoost: 1
|
||||
m_EnvironmentLightingMode: 0
|
||||
m_EnableBakedLightmaps: 1
|
||||
m_EnableRealtimeLightmaps: 0
|
||||
m_LightmapEditorSettings:
|
||||
serializedVersion: 12
|
||||
m_Resolution: 2
|
||||
m_BakeResolution: 40
|
||||
m_AtlasSize: 1024
|
||||
m_AO: 0
|
||||
m_AOMaxDistance: 1
|
||||
m_CompAOExponent: 1
|
||||
m_CompAOExponentDirect: 0
|
||||
m_ExtractAmbientOcclusion: 0
|
||||
m_Padding: 2
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_LightmapsBakeMode: 1
|
||||
m_TextureCompression: 1
|
||||
m_ReflectionCompression: 2
|
||||
m_MixedBakeMode: 2
|
||||
m_BakeBackend: 1
|
||||
m_PVRSampling: 1
|
||||
m_PVRDirectSampleCount: 32
|
||||
m_PVRSampleCount: 512
|
||||
m_PVRBounces: 2
|
||||
m_PVREnvironmentSampleCount: 256
|
||||
m_PVREnvironmentReferencePointCount: 2048
|
||||
m_PVRFilteringMode: 1
|
||||
m_PVRDenoiserTypeDirect: 1
|
||||
m_PVRDenoiserTypeIndirect: 1
|
||||
m_PVRDenoiserTypeAO: 1
|
||||
m_PVRFilterTypeDirect: 0
|
||||
m_PVRFilterTypeIndirect: 0
|
||||
m_PVRFilterTypeAO: 0
|
||||
m_PVREnvironmentMIS: 1
|
||||
m_PVRCulling: 1
|
||||
m_PVRFilteringGaussRadiusDirect: 1
|
||||
m_PVRFilteringGaussRadiusIndirect: 1
|
||||
m_PVRFilteringGaussRadiusAO: 1
|
||||
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
|
||||
m_PVRFilteringAtrousPositionSigmaIndirect: 2
|
||||
m_PVRFilteringAtrousPositionSigmaAO: 1
|
||||
m_ExportTrainingData: 0
|
||||
m_TrainingDataDestination: TrainingData
|
||||
m_LightProbeSampleCountMultiplier: 4
|
||||
m_LightingDataAsset: {fileID: 20201, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_LightingSettings: {fileID: 0}
|
||||
--- !u!196 &4
|
||||
NavMeshSettings:
|
||||
serializedVersion: 2
|
||||
m_ObjectHideFlags: 0
|
||||
m_BuildSettings:
|
||||
serializedVersion: 3
|
||||
agentTypeID: 0
|
||||
agentRadius: 0.5
|
||||
agentHeight: 2
|
||||
agentSlope: 45
|
||||
agentClimb: 0.4
|
||||
ledgeDropHeight: 0
|
||||
maxJumpAcrossDistance: 0
|
||||
minRegionArea: 2
|
||||
manualCellSize: 0
|
||||
cellSize: 0.16666667
|
||||
manualTileSize: 0
|
||||
tileSize: 256
|
||||
buildHeightMesh: 0
|
||||
maxJobWorkers: 0
|
||||
preserveTilesOutsideBounds: 0
|
||||
debug:
|
||||
m_Flags: 0
|
||||
m_NavMeshData: {fileID: 0}
|
||||
--- !u!1 &1097328750
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1097328752}
|
||||
- component: {fileID: 1097328754}
|
||||
- component: {fileID: 1097328755}
|
||||
m_Layer: 0
|
||||
m_Name: Sample
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &1097328752
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1097328750}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &1097328754
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1097328750}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 19102, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: UnityEngine.dll::UnityEngine.UIElements.UIDocument
|
||||
m_PanelSettings: {fileID: 11400000, guid: 5ad7007b08a97b54d927c352279a18b6, type: 2}
|
||||
m_ParentUI: {fileID: 0}
|
||||
sourceAsset: {fileID: 9197481963319205126, guid: 7811bd1f07a45124d9706c043c3c1ee6, type: 3}
|
||||
m_SortingOrder: 0
|
||||
m_Position: 0
|
||||
m_WorldSpaceSizeMode: 1
|
||||
m_WorldSpaceWidth: 1920
|
||||
m_WorldSpaceHeight: 1080
|
||||
m_PivotReferenceSize: 0
|
||||
m_Pivot: 0
|
||||
m_WorldSpaceCollider: {fileID: 0}
|
||||
--- !u!114 &1097328755
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1097328750}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: ce8c9286a85a9bd4b8dc349cac435424, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Assembly-CSharp::UTKMultiSelectDropdownSample
|
||||
--- !u!1 &1192809690
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1192809694}
|
||||
- component: {fileID: 1192809693}
|
||||
- component: {fileID: 1192809692}
|
||||
- component: {fileID: 1192809691}
|
||||
m_Layer: 0
|
||||
m_Name: Plane
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!64 &1192809691
|
||||
MeshCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1192809690}
|
||||
m_Material: {fileID: 0}
|
||||
m_IncludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_ExcludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_LayerOverridePriority: 0
|
||||
m_IsTrigger: 0
|
||||
m_ProvidesContacts: 0
|
||||
m_Enabled: 1
|
||||
serializedVersion: 5
|
||||
m_Convex: 0
|
||||
m_CookingOptions: 30
|
||||
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
|
||||
--- !u!23 &1192809692
|
||||
MeshRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1192809690}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 1
|
||||
m_ReceiveShadows: 1
|
||||
m_DynamicOccludee: 1
|
||||
m_StaticShadowCaster: 0
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RayTracingMode: 2
|
||||
m_RayTraceProcedural: 0
|
||||
m_RayTracingAccelStructBuildFlagsOverride: 0
|
||||
m_RayTracingAccelStructBuildFlags: 1
|
||||
m_SmallMeshCulling: 1
|
||||
m_ForceMeshLod: -1
|
||||
m_MeshLodSelectionBias: 0
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, type: 2}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_LightProbeVolumeOverride: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_ReceiveGI: 1
|
||||
m_PreserveUVs: 0
|
||||
m_IgnoreNormalsForChartDetection: 0
|
||||
m_ImportantGI: 0
|
||||
m_StitchLightmapSeams: 1
|
||||
m_SelectedEditorRenderState: 3
|
||||
m_MinimumChartSize: 4
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_GlobalIlluminationMeshLod: 0
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
m_AdditionalVertexStreams: {fileID: 0}
|
||||
--- !u!33 &1192809693
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1192809690}
|
||||
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
|
||||
--- !u!4 &1192809694
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1192809690}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 10, y: 10, z: 10}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &1331954412
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1331954415}
|
||||
- component: {fileID: 1331954414}
|
||||
- component: {fileID: 1331954413}
|
||||
m_Layer: 0
|
||||
m_Name: EventSystem
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &1331954413
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1331954412}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 01614664b831546d2ae94a42149d80ac, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_SendPointerHoverToParent: 1
|
||||
m_MoveRepeatDelay: 0.5
|
||||
m_MoveRepeatRate: 0.1
|
||||
m_XRTrackingOrigin: {fileID: 0}
|
||||
m_ActionsAsset: {fileID: -944628639613478452, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
|
||||
m_PointAction: {fileID: -1654692200621890270, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
|
||||
m_MoveAction: {fileID: -8784545083839296357, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
|
||||
m_SubmitAction: {fileID: 392368643174621059, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
|
||||
m_CancelAction: {fileID: 7727032971491509709, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
|
||||
m_LeftClickAction: {fileID: 3001919216989983466, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
|
||||
m_MiddleClickAction: {fileID: -2185481485913320682, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
|
||||
m_RightClickAction: {fileID: -4090225696740746782, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
|
||||
m_ScrollWheelAction: {fileID: 6240969308177333660, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
|
||||
m_TrackedDevicePositionAction: {fileID: 6564999863303420839, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
|
||||
m_TrackedDeviceOrientationAction: {fileID: 7970375526676320489, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
|
||||
m_DeselectOnBackgroundClick: 1
|
||||
m_PointerBehavior: 0
|
||||
m_CursorLockBehavior: 0
|
||||
m_ScrollDeltaPerTick: 6
|
||||
--- !u!114 &1331954414
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1331954412}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_FirstSelected: {fileID: 0}
|
||||
m_sendNavigationEvents: 1
|
||||
m_DragThreshold: 10
|
||||
--- !u!4 &1331954415
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1331954412}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &1414861612
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1414861614}
|
||||
- component: {fileID: 1414861613}
|
||||
- component: {fileID: 1414861615}
|
||||
m_Layer: 0
|
||||
m_Name: Directional Light
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!108 &1414861613
|
||||
Light:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1414861612}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 11
|
||||
m_Type: 1
|
||||
m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
|
||||
m_Intensity: 1
|
||||
m_Range: 10
|
||||
m_SpotAngle: 30
|
||||
m_InnerSpotAngle: 21.80208
|
||||
m_CookieSize: 10
|
||||
m_Shadows:
|
||||
m_Type: 2
|
||||
m_Resolution: -1
|
||||
m_CustomResolution: -1
|
||||
m_Strength: 1
|
||||
m_Bias: 0.05
|
||||
m_NormalBias: 0.4
|
||||
m_NearPlane: 0.2
|
||||
m_CullingMatrixOverride:
|
||||
e00: 1
|
||||
e01: 0
|
||||
e02: 0
|
||||
e03: 0
|
||||
e10: 0
|
||||
e11: 1
|
||||
e12: 0
|
||||
e13: 0
|
||||
e20: 0
|
||||
e21: 0
|
||||
e22: 1
|
||||
e23: 0
|
||||
e30: 0
|
||||
e31: 0
|
||||
e32: 0
|
||||
e33: 1
|
||||
m_UseCullingMatrixOverride: 0
|
||||
m_Cookie: {fileID: 0}
|
||||
m_DrawHalo: 0
|
||||
m_Flare: {fileID: 0}
|
||||
m_RenderMode: 0
|
||||
m_CullingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_RenderingLayerMask: 1
|
||||
m_Lightmapping: 4
|
||||
m_LightShadowCasterMode: 0
|
||||
m_AreaSize: {x: 1, y: 1}
|
||||
m_BounceIntensity: 1
|
||||
m_ColorTemperature: 6570
|
||||
m_UseColorTemperature: 0
|
||||
m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_UseBoundingSphereOverride: 0
|
||||
m_UseViewFrustumForShadowCasterCull: 1
|
||||
m_ForceVisible: 0
|
||||
m_ShadowRadius: 0
|
||||
m_ShadowAngle: 0
|
||||
m_LightUnit: 1
|
||||
m_LuxAtDistance: 1
|
||||
m_EnableSpotReflector: 1
|
||||
--- !u!4 &1414861614
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1414861612}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
|
||||
m_LocalPosition: {x: 0, y: 3, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
|
||||
--- !u!114 &1414861615
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1414861612}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 474bcb49853aa07438625e644c072ee6, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_UsePipelineSettings: 1
|
||||
m_AdditionalLightsShadowResolutionTier: 2
|
||||
m_CustomShadowLayers: 0
|
||||
m_LightCookieSize: {x: 1, y: 1}
|
||||
m_LightCookieOffset: {x: 0, y: 0}
|
||||
m_SoftShadowQuality: 0
|
||||
m_RenderingLayersMask:
|
||||
serializedVersion: 0
|
||||
m_Bits: 1
|
||||
m_ShadowRenderingLayersMask:
|
||||
serializedVersion: 0
|
||||
m_Bits: 1
|
||||
m_Version: 4
|
||||
m_LightLayerMask: 1
|
||||
m_ShadowLayerMask: 1
|
||||
m_RenderingLayers: 1
|
||||
m_ShadowRenderingLayers: 1
|
||||
--- !u!1 &2136621999
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 2136622002}
|
||||
- component: {fileID: 2136622001}
|
||||
- component: {fileID: 2136622000}
|
||||
- component: {fileID: 2136622003}
|
||||
m_Layer: 0
|
||||
m_Name: Main Camera
|
||||
m_TagString: MainCamera
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!81 &2136622000
|
||||
AudioListener:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2136621999}
|
||||
m_Enabled: 1
|
||||
--- !u!20 &2136622001
|
||||
Camera:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2136621999}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_ClearFlags: 1
|
||||
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
|
||||
m_projectionMatrixMode: 1
|
||||
m_GateFitMode: 2
|
||||
m_FOVAxisMode: 0
|
||||
m_Iso: 200
|
||||
m_ShutterSpeed: 0.005
|
||||
m_Aperture: 16
|
||||
m_FocusDistance: 10
|
||||
m_FocalLength: 50
|
||||
m_BladeCount: 5
|
||||
m_Curvature: {x: 2, y: 11}
|
||||
m_BarrelClipping: 0.25
|
||||
m_Anamorphism: 0
|
||||
m_SensorSize: {x: 36, y: 24}
|
||||
m_LensShift: {x: 0, y: 0}
|
||||
m_NormalizedViewPortRect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 1
|
||||
height: 1
|
||||
near clip plane: 0.3
|
||||
far clip plane: 1000
|
||||
field of view: 60
|
||||
orthographic: 0
|
||||
orthographic size: 5
|
||||
m_Depth: -1
|
||||
m_CullingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_RenderingPath: -1
|
||||
m_TargetTexture: {fileID: 0}
|
||||
m_TargetDisplay: 0
|
||||
m_TargetEye: 3
|
||||
m_HDR: 1
|
||||
m_AllowMSAA: 1
|
||||
m_AllowDynamicResolution: 0
|
||||
m_ForceIntoRT: 0
|
||||
m_OcclusionCulling: 1
|
||||
m_StereoConvergence: 10
|
||||
m_StereoSeparation: 0.022
|
||||
--- !u!4 &2136622002
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2136621999}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0.42261827, y: 0, z: 0, w: 0.9063079}
|
||||
m_LocalPosition: {x: 0, y: 40, z: -50}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 50, y: 0, z: 0}
|
||||
--- !u!114 &2136622003
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2136621999}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Runtime::UnityEngine.Rendering.Universal.UniversalAdditionalCameraData
|
||||
m_RenderShadows: 1
|
||||
m_RequiresDepthTextureOption: 2
|
||||
m_RequiresOpaqueTextureOption: 2
|
||||
m_CameraType: 0
|
||||
m_Cameras: []
|
||||
m_RendererIndex: -1
|
||||
m_VolumeLayerMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 1
|
||||
m_VolumeTrigger: {fileID: 0}
|
||||
m_VolumeFrameworkUpdateModeOption: 2
|
||||
m_RenderPostProcessing: 0
|
||||
m_Antialiasing: 0
|
||||
m_AntialiasingQuality: 2
|
||||
m_StopNaN: 0
|
||||
m_Dithering: 0
|
||||
m_ClearDepth: 1
|
||||
m_AllowXRRendering: 1
|
||||
m_AllowHDROutput: 1
|
||||
m_UseScreenCoordOverride: 0
|
||||
m_ScreenSizeOverride: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_ScreenCoordScaleBias: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_RequiresDepthTexture: 0
|
||||
m_RequiresColorTexture: 0
|
||||
m_TaaSettings:
|
||||
m_Quality: 3
|
||||
m_FrameInfluence: 0.1
|
||||
m_JitterScale: 1
|
||||
m_MipBias: 0
|
||||
m_VarianceClampScale: 0.9
|
||||
m_ContrastAdaptiveSharpening: 0
|
||||
m_Version: 2
|
||||
--- !u!1660057539 &9223372036854775807
|
||||
SceneRoots:
|
||||
m_ObjectHideFlags: 0
|
||||
m_Roots:
|
||||
- {fileID: 2136622002}
|
||||
- {fileID: 1414861614}
|
||||
- {fileID: 1331954415}
|
||||
- {fileID: 1097328752}
|
||||
- {fileID: 1192809694}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 32c05d2a3d319574982705435757c865
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
593
Assets/Sample/UIToolkit/UTKMultiSelectDropdownSample.cs
Normal file
593
Assets/Sample/UIToolkit/UTKMultiSelectDropdownSample.cs
Normal file
@@ -0,0 +1,593 @@
|
||||
#nullable enable
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UIElements;
|
||||
using UVC.UIToolkit;
|
||||
|
||||
/// <summary>
|
||||
/// UTKMultiSelectDropdown 컴포넌트 샘플
|
||||
/// UXML 파일을 로드하여 쿼리 방식으로 사용하는 예제
|
||||
/// </summary>
|
||||
[RequireComponent(typeof(UIDocument))]
|
||||
public class UTKMultiSelectDropdownSample : MonoBehaviour
|
||||
{
|
||||
#region Enums
|
||||
/// <summary>게임 난이도</summary>
|
||||
public enum Difficulty
|
||||
{
|
||||
Easy,
|
||||
Normal,
|
||||
Hard,
|
||||
Expert
|
||||
}
|
||||
|
||||
/// <summary>품질 설정</summary>
|
||||
public enum QualityLevel
|
||||
{
|
||||
Low,
|
||||
Medium,
|
||||
High,
|
||||
Ultra
|
||||
}
|
||||
|
||||
/// <summary>파일 형식</summary>
|
||||
public enum FileFormat
|
||||
{
|
||||
PNG,
|
||||
JPG,
|
||||
GIF,
|
||||
BMP,
|
||||
TIFF
|
||||
}
|
||||
|
||||
/// <summary>정렬 방식</summary>
|
||||
public enum SortOrder
|
||||
{
|
||||
Ascending,
|
||||
Descending
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Fields
|
||||
[SerializeField]
|
||||
[Tooltip("UI를 표시할 UIDocument 컴포넌트")]
|
||||
public UIDocument? _uiDocument;
|
||||
|
||||
[SerializeField]
|
||||
[Tooltip("시작 시 적용할 테마")]
|
||||
private UTKTheme initialTheme = UTKTheme.Dark;
|
||||
|
||||
private UTKToggle _themeToggle;
|
||||
|
||||
private VisualElement? _root;
|
||||
|
||||
// 다중 선택 드롭다운 참조
|
||||
private UTKMultiSelectDropdown? _dropdownBasic;
|
||||
private UTKMultiSelectDropdown? _dropdownDefault;
|
||||
private UTKMultiSelectDropdown? _dropdownCategory;
|
||||
private UTKMultiSelectDropdown? _dropdownTag;
|
||||
private UTKMultiSelectDropdown? _dropdownSelectAll;
|
||||
private UTKMultiSelectDropdown? _dropdownDisabled;
|
||||
|
||||
// 다중 선택 결과 라벨 참조
|
||||
private Label? _resultBasic;
|
||||
private Label? _resultDefault;
|
||||
private Label? _resultCategory;
|
||||
private Label? _resultTag;
|
||||
private Label? _resultSelectAll;
|
||||
|
||||
// 버튼 참조
|
||||
private UTKButton? _btnSelectAll;
|
||||
private UTKButton? _btnClear;
|
||||
|
||||
// 단일 선택 드롭다운 참조
|
||||
private UTKDropdown? _dropdownSingleBasic;
|
||||
private UTKDropdown? _dropdownSingleDefault;
|
||||
private UTKDropdown? _dropdownSingleSort;
|
||||
private UTKDropdown? _dropdownSingleDisabled;
|
||||
|
||||
// 단일 선택 결과 라벨 참조
|
||||
private Label? _dropdownResultBasic;
|
||||
private Label? _dropdownResultDefault;
|
||||
private Label? _dropdownResultSort;
|
||||
|
||||
// Enum 드롭다운 참조
|
||||
private UTKEnumDropDown? _enumDropdownDifficulty;
|
||||
private UTKEnumDropDown? _enumDropdownQuality;
|
||||
private UTKEnumDropDown? _enumDropdownFormat;
|
||||
private UTKEnumDropDown? _enumDropdownDisabled;
|
||||
|
||||
// Enum 결과 라벨 참조
|
||||
private Label? _enumResultDifficulty;
|
||||
private Label? _enumResultQuality;
|
||||
private Label? _enumResultFormat;
|
||||
#endregion
|
||||
|
||||
#region Unity Lifecycle
|
||||
private void Start()
|
||||
{
|
||||
var doc = GetComponent<UIDocument>();
|
||||
if (doc == null)
|
||||
{
|
||||
Debug.LogError("UIDocument가 할당되지 않았습니다.");
|
||||
return;
|
||||
}
|
||||
_uiDocument = doc;
|
||||
|
||||
var toggle = _uiDocument.rootVisualElement.Q<UTKToggle>("toggle");
|
||||
if (toggle == null)
|
||||
{
|
||||
Debug.LogError("UXML에서 UTKToggle을 찾을 수 없습니다.");
|
||||
return;
|
||||
}
|
||||
_themeToggle = toggle;
|
||||
|
||||
UTKThemeManager.Instance.RegisterRoot(_uiDocument.rootVisualElement);
|
||||
UTKThemeManager.Instance.SetTheme(initialTheme);
|
||||
|
||||
_themeToggle.OnValueChanged += (isOn) =>
|
||||
{
|
||||
UTKThemeManager.Instance.SetTheme(!isOn ? UTKTheme.Dark : UTKTheme.Light);
|
||||
};
|
||||
|
||||
LoadUIFromUXML();
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
UnregisterEvents();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Setup
|
||||
private void LoadUIFromUXML()
|
||||
{
|
||||
// UIDocument 참조 확인
|
||||
var doc = GetComponent<UIDocument>();
|
||||
if (doc == null)
|
||||
{
|
||||
Debug.LogError("UIDocument가 할당되지 않았습니다.");
|
||||
return;
|
||||
}
|
||||
_uiDocument = doc;
|
||||
|
||||
|
||||
// UI 생성
|
||||
_root = _uiDocument.rootVisualElement;
|
||||
|
||||
|
||||
// 요소 쿼리
|
||||
QueryElements();
|
||||
|
||||
// 초기 설정
|
||||
SetupInitialValues();
|
||||
|
||||
// 이벤트 등록
|
||||
RegisterEvents();
|
||||
}
|
||||
|
||||
private void QueryElements()
|
||||
{
|
||||
if (_root == null) return;
|
||||
|
||||
// 다중 선택 드롭다운 쿼리
|
||||
_dropdownBasic = _root.Q<UTKMultiSelectDropdown>("dropdown-basic");
|
||||
_dropdownDefault = _root.Q<UTKMultiSelectDropdown>("dropdown-default");
|
||||
_dropdownCategory = _root.Q<UTKMultiSelectDropdown>("dropdown-category");
|
||||
_dropdownTag = _root.Q<UTKMultiSelectDropdown>("dropdown-tag");
|
||||
_dropdownSelectAll = _root.Q<UTKMultiSelectDropdown>("dropdown-selectall");
|
||||
_dropdownDisabled = _root.Q<UTKMultiSelectDropdown>("dropdown-disabled");
|
||||
|
||||
// 다중 선택 결과 라벨 쿼리
|
||||
_resultBasic = _root.Q<Label>("result-basic");
|
||||
_resultDefault = _root.Q<Label>("result-default");
|
||||
_resultCategory = _root.Q<Label>("result-category");
|
||||
_resultTag = _root.Q<Label>("result-tag");
|
||||
_resultSelectAll = _root.Q<Label>("result-selectall");
|
||||
|
||||
// 버튼 쿼리
|
||||
_btnSelectAll = _root.Q<UTKButton>("btn-selectall");
|
||||
_btnClear = _root.Q<UTKButton>("btn-clear");
|
||||
|
||||
// 단일 선택 드롭다운 쿼리
|
||||
_dropdownSingleBasic = _root.Q<UTKDropdown>("dropdown-single-basic");
|
||||
_dropdownSingleDefault = _root.Q<UTKDropdown>("dropdown-single-default");
|
||||
_dropdownSingleSort = _root.Q<UTKDropdown>("dropdown-single-sort");
|
||||
_dropdownSingleDisabled = _root.Q<UTKDropdown>("dropdown-single-disabled");
|
||||
|
||||
// 단일 선택 결과 라벨 쿼리
|
||||
_dropdownResultBasic = _root.Q<Label>("dropdown-result-basic");
|
||||
_dropdownResultDefault = _root.Q<Label>("dropdown-result-default");
|
||||
_dropdownResultSort = _root.Q<Label>("dropdown-result-sort");
|
||||
|
||||
// Enum 드롭다운 쿼리
|
||||
_enumDropdownDifficulty = _root.Q<UTKEnumDropDown>("enum-dropdown-difficulty");
|
||||
_enumDropdownQuality = _root.Q<UTKEnumDropDown>("enum-dropdown-quality");
|
||||
_enumDropdownFormat = _root.Q<UTKEnumDropDown>("enum-dropdown-format");
|
||||
_enumDropdownDisabled = _root.Q<UTKEnumDropDown>("enum-dropdown-disabled");
|
||||
|
||||
// Enum 결과 라벨 쿼리
|
||||
_enumResultDifficulty = _root.Q<Label>("enum-result-difficulty");
|
||||
_enumResultQuality = _root.Q<Label>("enum-result-quality");
|
||||
_enumResultFormat = _root.Q<Label>("enum-result-format");
|
||||
}
|
||||
|
||||
private void SetupInitialValues()
|
||||
{
|
||||
// [다중 선택] 샘플 2: 기본값 설정 (한국어, English 선택)
|
||||
_dropdownDefault?.SetSelectedIndices(new List<int> { 0, 1 }, notify: false);
|
||||
if (_resultDefault != null && _dropdownDefault != null)
|
||||
{
|
||||
_resultDefault.text = $"선택 언어: {string.Join(", ", _dropdownDefault.SelectedValues)}";
|
||||
}
|
||||
|
||||
// [다중 선택] 샘플 6: 비활성화 드롭다운 기본값 설정
|
||||
_dropdownDisabled?.SetSelectedIndices(new List<int> { 0, 2 }, notify: false);
|
||||
|
||||
// [단일 선택] 샘플 2: 기본값 설정 (한국어 선택)
|
||||
if (_dropdownResultDefault != null && _dropdownSingleDefault != null)
|
||||
{
|
||||
_dropdownResultDefault.text = $"선택 언어: {_dropdownSingleDefault.SelectedValue}";
|
||||
}
|
||||
|
||||
// [Enum] 샘플 1: 난이도 드롭다운 초기화
|
||||
_enumDropdownDifficulty?.Init(Difficulty.Normal);
|
||||
if (_enumResultDifficulty != null && _enumDropdownDifficulty != null)
|
||||
{
|
||||
_enumResultDifficulty.text = $"선택 난이도: {_enumDropdownDifficulty.Value}";
|
||||
}
|
||||
|
||||
// [Enum] 샘플 2: 품질 드롭다운 초기화
|
||||
_enumDropdownQuality?.Init(QualityLevel.High);
|
||||
|
||||
// [Enum] 샘플 3: 파일 형식 드롭다운 초기화
|
||||
_enumDropdownFormat?.Init(FileFormat.PNG);
|
||||
if (_enumResultFormat != null && _enumDropdownFormat != null)
|
||||
{
|
||||
_enumResultFormat.text = $"선택 형식: {_enumDropdownFormat.Value}";
|
||||
}
|
||||
|
||||
// [Enum] 샘플 4: 비활성화 드롭다운 초기화
|
||||
_enumDropdownDisabled?.Init(SortOrder.Ascending);
|
||||
}
|
||||
|
||||
private void RegisterEvents()
|
||||
{
|
||||
// [다중 선택] 샘플 1: 기본 다중 선택 드롭다운
|
||||
if (_dropdownBasic != null && _resultBasic != null)
|
||||
{
|
||||
_dropdownBasic.OnSelectionChanged += OnBasicSelectionChanged;
|
||||
}
|
||||
|
||||
// [다중 선택] 샘플 2: 기본값이 있는 드롭다운
|
||||
if (_dropdownDefault != null && _resultDefault != null)
|
||||
{
|
||||
_dropdownDefault.OnSelectionChanged += OnDefaultSelectionChanged;
|
||||
}
|
||||
|
||||
// [다중 선택] 샘플 3: 카테고리 필터
|
||||
if (_dropdownCategory != null && _resultCategory != null)
|
||||
{
|
||||
_dropdownCategory.OnSelectionChanged += OnCategorySelectionChanged;
|
||||
}
|
||||
|
||||
// [다중 선택] 샘플 4: 태그 선택기
|
||||
if (_dropdownTag != null && _resultTag != null)
|
||||
{
|
||||
_dropdownTag.OnSelectionChanged += OnTagSelectionChanged;
|
||||
}
|
||||
|
||||
// [다중 선택] 샘플 5: 전체 선택/해제
|
||||
if (_dropdownSelectAll != null && _resultSelectAll != null)
|
||||
{
|
||||
_dropdownSelectAll.OnSelectionChanged += OnSelectAllSelectionChanged;
|
||||
}
|
||||
|
||||
if (_btnSelectAll != null)
|
||||
{
|
||||
_btnSelectAll.OnClicked += OnSelectAllButtonClicked;
|
||||
}
|
||||
|
||||
if (_btnClear != null)
|
||||
{
|
||||
_btnClear.OnClicked += OnClearButtonClicked;
|
||||
}
|
||||
|
||||
// [단일 선택] 샘플 1: 기본 단일 선택 드롭다운
|
||||
if (_dropdownSingleBasic != null && _dropdownResultBasic != null)
|
||||
{
|
||||
_dropdownSingleBasic.OnSelectionChanged += OnDropdownBasicSelectionChanged;
|
||||
}
|
||||
|
||||
// [단일 선택] 샘플 2: 기본값이 있는 드롭다운
|
||||
if (_dropdownSingleDefault != null && _dropdownResultDefault != null)
|
||||
{
|
||||
_dropdownSingleDefault.OnSelectionChanged += OnDropdownDefaultSelectionChanged;
|
||||
}
|
||||
|
||||
// [단일 선택] 샘플 3: 정렬 옵션
|
||||
if (_dropdownSingleSort != null && _dropdownResultSort != null)
|
||||
{
|
||||
_dropdownSingleSort.OnSelectionChanged += OnDropdownSortSelectionChanged;
|
||||
}
|
||||
|
||||
// [Enum] 샘플 1: 난이도 선택
|
||||
if (_enumDropdownDifficulty != null && _enumResultDifficulty != null)
|
||||
{
|
||||
_enumDropdownDifficulty.OnValueChanged += OnEnumDifficultyChanged;
|
||||
}
|
||||
|
||||
// [Enum] 샘플 2: 품질 선택
|
||||
if (_enumDropdownQuality != null && _enumResultQuality != null)
|
||||
{
|
||||
_enumDropdownQuality.OnValueChanged += OnEnumQualityChanged;
|
||||
}
|
||||
|
||||
// [Enum] 샘플 3: 파일 형식 선택
|
||||
if (_enumDropdownFormat != null && _enumResultFormat != null)
|
||||
{
|
||||
_enumDropdownFormat.OnValueChanged += OnEnumFormatChanged;
|
||||
}
|
||||
}
|
||||
|
||||
private void UnregisterEvents()
|
||||
{
|
||||
if (_dropdownBasic != null)
|
||||
{
|
||||
_dropdownBasic.OnSelectionChanged -= OnBasicSelectionChanged;
|
||||
}
|
||||
|
||||
if (_dropdownDefault != null)
|
||||
{
|
||||
_dropdownDefault.OnSelectionChanged -= OnDefaultSelectionChanged;
|
||||
}
|
||||
|
||||
if (_dropdownCategory != null)
|
||||
{
|
||||
_dropdownCategory.OnSelectionChanged -= OnCategorySelectionChanged;
|
||||
}
|
||||
|
||||
if (_dropdownTag != null)
|
||||
{
|
||||
_dropdownTag.OnSelectionChanged -= OnTagSelectionChanged;
|
||||
}
|
||||
|
||||
if (_dropdownSelectAll != null)
|
||||
{
|
||||
_dropdownSelectAll.OnSelectionChanged -= OnSelectAllSelectionChanged;
|
||||
}
|
||||
|
||||
if (_btnSelectAll != null)
|
||||
{
|
||||
_btnSelectAll.OnClicked -= OnSelectAllButtonClicked;
|
||||
}
|
||||
|
||||
if (_btnClear != null)
|
||||
{
|
||||
_btnClear.OnClicked -= OnClearButtonClicked;
|
||||
}
|
||||
|
||||
// [단일 선택] 이벤트 해제
|
||||
if (_dropdownSingleBasic != null)
|
||||
{
|
||||
_dropdownSingleBasic.OnSelectionChanged -= OnDropdownBasicSelectionChanged;
|
||||
}
|
||||
|
||||
if (_dropdownSingleDefault != null)
|
||||
{
|
||||
_dropdownSingleDefault.OnSelectionChanged -= OnDropdownDefaultSelectionChanged;
|
||||
}
|
||||
|
||||
if (_dropdownSingleSort != null)
|
||||
{
|
||||
_dropdownSingleSort.OnSelectionChanged -= OnDropdownSortSelectionChanged;
|
||||
}
|
||||
|
||||
// [Enum] 이벤트 해제
|
||||
if (_enumDropdownDifficulty != null)
|
||||
{
|
||||
_enumDropdownDifficulty.OnValueChanged -= OnEnumDifficultyChanged;
|
||||
}
|
||||
|
||||
if (_enumDropdownQuality != null)
|
||||
{
|
||||
_enumDropdownQuality.OnValueChanged -= OnEnumQualityChanged;
|
||||
}
|
||||
|
||||
if (_enumDropdownFormat != null)
|
||||
{
|
||||
_enumDropdownFormat.OnValueChanged -= OnEnumFormatChanged;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Event Handlers
|
||||
private void OnBasicSelectionChanged(List<int> indices, List<string> values)
|
||||
{
|
||||
if (_resultBasic == null) return;
|
||||
|
||||
Debug.Log($"[기본 샘플] 선택된 개수: {values.Count}");
|
||||
Debug.Log($"[기본 샘플] 선택 항목: {string.Join(", ", values)}");
|
||||
|
||||
_resultBasic.text = values.Count > 0
|
||||
? $"선택 결과: {string.Join(", ", values)}"
|
||||
: "선택 결과: 없음";
|
||||
}
|
||||
|
||||
private void OnDefaultSelectionChanged(List<int> indices, List<string> values)
|
||||
{
|
||||
if (_resultDefault == null) return;
|
||||
|
||||
Debug.Log($"[기본값 샘플] 선택 언어: {string.Join(", ", values)}");
|
||||
|
||||
_resultDefault.text = values.Count > 0
|
||||
? $"선택 언어: {string.Join(", ", values)}"
|
||||
: "선택 언어: 없음";
|
||||
}
|
||||
|
||||
private void OnCategorySelectionChanged(List<int> indices, List<string> values)
|
||||
{
|
||||
if (_resultCategory == null) return;
|
||||
|
||||
var categoryText = values.Count > 0
|
||||
? string.Join(", ", values)
|
||||
: "전체";
|
||||
|
||||
Debug.Log($"[카테고리 필터] 선택된 카테고리: {categoryText}");
|
||||
|
||||
// 실제로는 여기서 필터링 로직 수행
|
||||
_resultCategory.text = values.Count > 0
|
||||
? $"필터링된 항목: {values.Count * 15}개 (예시)"
|
||||
: "필터링된 항목: 전체 120개";
|
||||
}
|
||||
|
||||
private void OnTagSelectionChanged(List<int> indices, List<string> values)
|
||||
{
|
||||
if (_resultTag == null) return;
|
||||
|
||||
_resultTag.text = values.Count > 0
|
||||
? $"적용된 태그: [{string.Join("] [", values)}]"
|
||||
: "적용된 태그: 없음";
|
||||
}
|
||||
|
||||
private void OnSelectAllSelectionChanged(List<int> indices, List<string> values)
|
||||
{
|
||||
if (_resultSelectAll == null) return;
|
||||
|
||||
_resultSelectAll.text = values.Count > 0
|
||||
? $"선택된 권한: {string.Join(", ", values)}"
|
||||
: "선택된 권한: 없음";
|
||||
}
|
||||
|
||||
private void OnSelectAllButtonClicked()
|
||||
{
|
||||
_dropdownSelectAll?.SelectAll();
|
||||
Debug.Log("[전체 선택] 모든 권한 선택됨");
|
||||
}
|
||||
|
||||
private void OnClearButtonClicked()
|
||||
{
|
||||
_dropdownSelectAll?.ClearSelection();
|
||||
Debug.Log("[전체 해제] 모든 권한 해제됨");
|
||||
}
|
||||
|
||||
// [단일 선택] 이벤트 핸들러
|
||||
private void OnDropdownBasicSelectionChanged(int index, string value)
|
||||
{
|
||||
if (_dropdownResultBasic == null) return;
|
||||
|
||||
Debug.Log($"[단일 선택 - 기본] 선택: [{index}] {value}");
|
||||
|
||||
_dropdownResultBasic.text = !string.IsNullOrEmpty(value)
|
||||
? $"선택 결과: {value}"
|
||||
: "선택 결과: 없음";
|
||||
}
|
||||
|
||||
private void OnDropdownDefaultSelectionChanged(int index, string value)
|
||||
{
|
||||
if (_dropdownResultDefault == null) return;
|
||||
|
||||
Debug.Log($"[단일 선택 - 기본값] 선택 언어: {value}");
|
||||
|
||||
_dropdownResultDefault.text = !string.IsNullOrEmpty(value)
|
||||
? $"선택 언어: {value}"
|
||||
: "선택 언어: 없음";
|
||||
}
|
||||
|
||||
private void OnDropdownSortSelectionChanged(int index, string value)
|
||||
{
|
||||
if (_dropdownResultSort == null) return;
|
||||
|
||||
Debug.Log($"[단일 선택 - 정렬] 정렬 방식: {value}");
|
||||
|
||||
// 실제로는 여기서 정렬 로직 수행
|
||||
_dropdownResultSort.text = !string.IsNullOrEmpty(value)
|
||||
? $"정렬 방식: {value}"
|
||||
: "정렬 방식: 없음";
|
||||
}
|
||||
|
||||
// [Enum] 이벤트 핸들러
|
||||
private void OnEnumDifficultyChanged(Enum? value)
|
||||
{
|
||||
if (_enumResultDifficulty == null) return;
|
||||
|
||||
if (value is Difficulty difficulty)
|
||||
{
|
||||
Debug.Log($"[Enum - 난이도] 선택: {difficulty}");
|
||||
_enumResultDifficulty.text = $"선택 난이도: {difficulty}";
|
||||
|
||||
// 실제로는 여기서 난이도 적용 로직 수행
|
||||
switch (difficulty)
|
||||
{
|
||||
case Difficulty.Easy:
|
||||
Debug.Log("쉬운 난이도 적용");
|
||||
break;
|
||||
case Difficulty.Normal:
|
||||
Debug.Log("보통 난이도 적용");
|
||||
break;
|
||||
case Difficulty.Hard:
|
||||
Debug.Log("어려운 난이도 적용");
|
||||
break;
|
||||
case Difficulty.Expert:
|
||||
Debug.Log("전문가 난이도 적용");
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_enumResultDifficulty.text = "선택 난이도: 없음";
|
||||
}
|
||||
}
|
||||
|
||||
private void OnEnumQualityChanged(Enum? value)
|
||||
{
|
||||
if (_enumResultQuality == null) return;
|
||||
|
||||
if (value is QualityLevel quality)
|
||||
{
|
||||
Debug.Log($"[Enum - 품질] 선택: {quality}");
|
||||
_enumResultQuality.text = $"선택 품질: {quality}";
|
||||
|
||||
// 실제로는 여기서 품질 설정 로직 수행
|
||||
switch (quality)
|
||||
{
|
||||
case QualityLevel.Low:
|
||||
Debug.Log("낮은 품질 적용");
|
||||
break;
|
||||
case QualityLevel.Medium:
|
||||
Debug.Log("중간 품질 적용");
|
||||
break;
|
||||
case QualityLevel.High:
|
||||
Debug.Log("높은 품질 적용");
|
||||
break;
|
||||
case QualityLevel.Ultra:
|
||||
Debug.Log("최고 품질 적용");
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_enumResultQuality.text = "선택 품질: 없음";
|
||||
}
|
||||
}
|
||||
|
||||
private void OnEnumFormatChanged(Enum? value)
|
||||
{
|
||||
if (_enumResultFormat == null) return;
|
||||
|
||||
if (value is FileFormat format)
|
||||
{
|
||||
Debug.Log($"[Enum - 파일 형식] 선택: {format}");
|
||||
_enumResultFormat.text = $"선택 형식: {format}";
|
||||
|
||||
// 실제로는 여기서 파일 형식 설정 로직 수행
|
||||
Debug.Log($"파일을 {format} 형식으로 저장합니다.");
|
||||
}
|
||||
else
|
||||
{
|
||||
_enumResultFormat.text = "선택 형식: 없음";
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ce8c9286a85a9bd4b8dc349cac435424
|
||||
97
Assets/Sample/UIToolkit/UTKMultiSelectDropdownSample.uxml
Normal file
97
Assets/Sample/UIToolkit/UTKMultiSelectDropdownSample.uxml
Normal file
@@ -0,0 +1,97 @@
|
||||
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:utk="UVC.UIToolkit" editor-extension-mode="False">
|
||||
<Style src="project://database/Assets/Sample/UIToolkit/UTKMultiSelectDropdownSampleUss.uss?fileID=7433441132597879392&guid=446b732074b6c7e438d1ae942f153f63&type=3#UTKMultiSelectDropdownSampleUss" />
|
||||
<ui:VisualElement name="root" style="padding: 20px; background-color: rgb(51, 51, 51); flex-grow: 1;">
|
||||
<ui:VisualElement style="flex-grow: 1; flex-direction: row;">
|
||||
<ui:VisualElement name="UTKMultiSelectDropdownRoot" style="padding: 20px; background-color: rgb(51, 51, 51); flex-grow: 1;">
|
||||
<ui:Label text="UTKMultiSelectDropdown Samples" style="font-size: 18px; margin-bottom: 20px; color: white;" />
|
||||
<ui:VisualElement style="flex-grow: 1; width: 300px;">
|
||||
<ui:VisualElement name="section-basic" class="sample-section">
|
||||
<ui:Label text="기본 다중 선택 드롭다운" class="section-title" />
|
||||
<utk:UTKMultiSelectDropdown name="dropdown-basic" label="과일 선택" choices="사과,바나나,오렌지,포도,딸기,수박" />
|
||||
<ui:Label name="result-basic" text="선택 결과: 없음" class="result-label" />
|
||||
</ui:VisualElement>
|
||||
<ui:VisualElement name="section-default" class="sample-section">
|
||||
<ui:Label text="기본값이 있는 드롭다운" class="section-title" />
|
||||
<utk:UTKMultiSelectDropdown name="dropdown-default" label="언어 선택" choices="한국어,English,日本語,中文,Español" />
|
||||
<ui:Label name="result-default" text="선택 언어: 없음" class="result-label" />
|
||||
</ui:VisualElement>
|
||||
<ui:VisualElement name="section-category" class="sample-section">
|
||||
<ui:Label text="카테고리 필터" class="section-title" />
|
||||
<utk:UTKMultiSelectDropdown name="dropdown-category" label="카테고리" choices="전자제품,의류,식품,가구,도서,스포츠,완구,화장품" />
|
||||
<ui:Label name="result-category" text="필터링된 항목: 전체 120개" class="result-label-info" />
|
||||
</ui:VisualElement>
|
||||
<ui:VisualElement name="section-tag" class="sample-section">
|
||||
<ui:Label text="태그 선택기" class="section-title" />
|
||||
<utk:UTKMultiSelectDropdown name="dropdown-tag" label="태그" placeholder="태그를 선택하세요" choices="중요,긴급,검토 필요,완료,진행 중,대기,보류,취소" />
|
||||
<ui:Label name="result-tag" text="적용된 태그: 없음" class="result-label-warning" />
|
||||
</ui:VisualElement>
|
||||
<ui:VisualElement name="section-selectall" class="sample-section">
|
||||
<ui:Label text="전체 선택/해제 기능" class="section-title" />
|
||||
<utk:UTKMultiSelectDropdown name="dropdown-selectall" label="권한 설정" choices="읽기,쓰기,수정,삭제,실행,관리" />
|
||||
<ui:VisualElement name="button-container" style="flex-direction: row; margin-top: 10px;">
|
||||
<utk:UTKButton name="btn-selectall" text="전체 선택" variant="Primary" style="margin-right: 10px;" />
|
||||
<utk:UTKButton name="btn-clear" text="전체 해제" variant="Normal" />
|
||||
</ui:VisualElement>
|
||||
<ui:Label name="result-selectall" text="선택된 권한: 없음" class="result-label" />
|
||||
</ui:VisualElement>
|
||||
<ui:VisualElement name="section-disabled" class="sample-section">
|
||||
<ui:Label text="비활성화 상태" class="section-title" />
|
||||
<utk:UTKMultiSelectDropdown name="dropdown-disabled" label="설정 (비활성화)" choices="옵션1,옵션2,옵션3" is-enabled="false" />
|
||||
<ui:Label text="※ 비활성화된 드롭다운은 클릭할 수 없습니다." class="note-label" />
|
||||
</ui:VisualElement>
|
||||
</ui:VisualElement>
|
||||
</ui:VisualElement>
|
||||
<ui:VisualElement name="UTKDropdownRoot" style="padding: 20px; background-color: rgb(51, 51, 51); flex-grow: 1;">
|
||||
<ui:Label text="UTKDropdown Samples" style="font-size: 18px; margin-bottom: 20px; color: white;" />
|
||||
<ui:VisualElement style="flex-grow: 1; width: 300px;">
|
||||
<ui:VisualElement name="dropdown-section-basic" class="sample-section">
|
||||
<ui:Label text="기본 단일 선택 드롭다운" class="section-title" />
|
||||
<utk:UTKDropdown name="dropdown-single-basic" label="과일 선택" choices="사과,바나나,오렌지,포도,딸기,수박" />
|
||||
<ui:Label name="dropdown-result-basic" text="선택 결과: 없음" class="result-label" />
|
||||
</ui:VisualElement>
|
||||
<ui:VisualElement name="dropdown-section-default" class="sample-section">
|
||||
<ui:Label text="기본값이 있는 드롭다운" class="section-title" />
|
||||
<utk:UTKDropdown name="dropdown-single-default" label="언어 선택" choices="한국어,English,日本語,中文,Español" index="0" />
|
||||
<ui:Label name="dropdown-result-default" text="선택 언어: 없음" class="result-label" />
|
||||
</ui:VisualElement>
|
||||
<ui:VisualElement name="dropdown-section-sort" class="sample-section">
|
||||
<ui:Label text="정렬 옵션" class="section-title" />
|
||||
<utk:UTKDropdown name="dropdown-single-sort" label="정렬" choices="이름순,날짜순,크기순,최신순" />
|
||||
<ui:Label name="dropdown-result-sort" text="정렬 방식: 없음" class="result-label-info" />
|
||||
</ui:VisualElement>
|
||||
<ui:VisualElement name="dropdown-section-disabled" class="sample-section">
|
||||
<ui:Label text="비활성화 상태" class="section-title" />
|
||||
<utk:UTKDropdown name="dropdown-single-disabled" label="설정 (비활성화)" choices="옵션1,옵션2,옵션3" index="1" is-enabled="false" />
|
||||
<ui:Label text="※ 비활성화된 드롭다운은 클릭할 수 없습니다." class="note-label" />
|
||||
</ui:VisualElement>
|
||||
</ui:VisualElement>
|
||||
</ui:VisualElement>
|
||||
<ui:VisualElement name="UTKEnumDropdownRoot" style="padding: 20px; background-color: rgb(51, 51, 51); flex-grow: 1;">
|
||||
<ui:Label text="UTKEnumDropDown Samples" style="font-size: 18px; margin-bottom: 20px; color: white;" />
|
||||
<ui:VisualElement style="flex-grow: 1; width: 300px;">
|
||||
<ui:VisualElement name="enum-section-difficulty" class="sample-section">
|
||||
<ui:Label text="게임 난이도 선택" class="section-title" />
|
||||
<utk:UTKEnumDropDown name="enum-dropdown-difficulty" label="난이도" />
|
||||
<ui:Label name="enum-result-difficulty" text="선택 난이도: 없음" class="result-label" />
|
||||
</ui:VisualElement>
|
||||
<ui:VisualElement name="enum-section-quality" class="sample-section">
|
||||
<ui:Label text="품질 설정" class="section-title" />
|
||||
<utk:UTKEnumDropDown name="enum-dropdown-quality" label="품질" placeholder="품질을 선택하세요" />
|
||||
<ui:Label name="enum-result-quality" text="선택 품질: 없음" class="result-label" />
|
||||
</ui:VisualElement>
|
||||
<ui:VisualElement name="enum-section-format" class="sample-section">
|
||||
<ui:Label text="파일 형식" class="section-title" />
|
||||
<utk:UTKEnumDropDown name="enum-dropdown-format" label="형식" />
|
||||
<ui:Label name="enum-result-format" text="선택 형식: 없음" class="result-label-info" />
|
||||
</ui:VisualElement>
|
||||
<ui:VisualElement name="enum-section-disabled" class="sample-section">
|
||||
<ui:Label text="비활성화 상태" class="section-title" />
|
||||
<utk:UTKEnumDropDown name="enum-dropdown-disabled" label="정렬 (비활성화)" is-enabled="false" />
|
||||
<ui:Label text="※ 비활성화된 드롭다운은 클릭할 수 없습니다." class="note-label" />
|
||||
</ui:VisualElement>
|
||||
</ui:VisualElement>
|
||||
</ui:VisualElement>
|
||||
</ui:VisualElement>
|
||||
</ui:VisualElement>
|
||||
<utk:UTKToggle name="toggle" label="테마 변경" style="position: absolute; top: 10px; right: 10px;" />
|
||||
</ui:UXML>
|
||||
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7811bd1f07a45124d9706c043c3c1ee6
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0}
|
||||
47
Assets/Sample/UIToolkit/UTKMultiSelectDropdownSampleUss.uss
Normal file
47
Assets/Sample/UIToolkit/UTKMultiSelectDropdownSampleUss.uss
Normal file
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* UTKMultiSelectDropdownSample 스타일
|
||||
*/
|
||||
|
||||
/* 샘플 섹션 */
|
||||
.sample-section {
|
||||
margin-bottom: 30px;
|
||||
padding: 15px;
|
||||
background-color: rgb(38, 38, 38);
|
||||
border-top-left-radius: 8px;
|
||||
border-top-right-radius: 8px;
|
||||
border-bottom-left-radius: 8px;
|
||||
border-bottom-right-radius: 8px;
|
||||
}
|
||||
|
||||
/* 섹션 타이틀 */
|
||||
.section-title {
|
||||
font-size: 16px;
|
||||
margin-bottom: 15px;
|
||||
color: rgb(77, 179, 255);
|
||||
-unity-font-style: bold;
|
||||
}
|
||||
|
||||
/* 결과 라벨 (기본) */
|
||||
.result-label {
|
||||
margin-top: 10px;
|
||||
color: rgb(204, 204, 204);
|
||||
}
|
||||
|
||||
/* 결과 라벨 (정보) */
|
||||
.result-label-info {
|
||||
margin-top: 10px;
|
||||
color: rgb(128, 204, 255);
|
||||
}
|
||||
|
||||
/* 결과 라벨 (경고) */
|
||||
.result-label-warning {
|
||||
margin-top: 10px;
|
||||
color: rgb(255, 204, 128);
|
||||
}
|
||||
|
||||
/* 참고 라벨 */
|
||||
.note-label {
|
||||
margin-top: 10px;
|
||||
font-size: 12px;
|
||||
color: rgb(153, 153, 153);
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 446b732074b6c7e438d1ae942f153f63
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 12385, guid: 0000000000000000e000000000000000, type: 0}
|
||||
disableValidation: 0
|
||||
Reference in New Issue
Block a user