Adding HUD!
This commit is contained in:
parent
ff62b1e9f1
commit
f7720a9915
20 changed files with 1482 additions and 92 deletions
|
|
@ -4,7 +4,9 @@
|
||||||
"Bash(grep -E \"\\\\.\\(prefab|fbx|controller\\)$\")",
|
"Bash(grep -E \"\\\\.\\(prefab|fbx|controller\\)$\")",
|
||||||
"Bash(dir /s /b \"C:\\\\Users\\\\catos\\\\UnityTowerDefense\\\\*.md\")",
|
"Bash(dir /s /b \"C:\\\\Users\\\\catos\\\\UnityTowerDefense\\\\*.md\")",
|
||||||
"Bash(findstr /v \"Library\\\\PackageCache\")",
|
"Bash(findstr /v \"Library\\\\PackageCache\")",
|
||||||
"Bash(dir \"C:\\\\Users\\\\catos\\\\UnityTowerDefense\" /a-d)"
|
"Bash(dir \"C:\\\\Users\\\\catos\\\\UnityTowerDefense\" /a-d)",
|
||||||
|
"Bash(mkdir -p \"C:\\\\Users\\\\catos\\\\UnityTowerDefense\\\\Assets\\\\_Project\\\\UI\")",
|
||||||
|
"Bash(mkdir -p \"C:\\\\Users\\\\catos\\\\UnityTowerDefense\\\\Assets\\\\_Project\\\\Scripts\\\\UI\")"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
8
Assets/UI Toolkit.meta
Normal file
8
Assets/UI Toolkit.meta
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 16af2c8f9644a2d43a61b66e4591081e
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
8
Assets/UI Toolkit/UnityThemes.meta
Normal file
8
Assets/UI Toolkit/UnityThemes.meta
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: d7a4b3dca14ed5542bf0b20bc30efbb6
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
@import url("unity-theme://default");
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: b37fce804ca93da429eeb014b35d9cc2
|
||||||
|
ScriptedImporter:
|
||||||
|
internalIDToNameTable: []
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
script: {fileID: 12388, guid: 0000000000000000e000000000000000, type: 0}
|
||||||
|
disableValidation: 0
|
||||||
|
unsupportedSelectorAction: 0
|
||||||
39
Assets/_Project/Art/Textures/MinimapRT.renderTexture
Normal file
39
Assets/_Project/Art/Textures/MinimapRT.renderTexture
Normal file
|
|
@ -0,0 +1,39 @@
|
||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!84 &8400000
|
||||||
|
RenderTexture:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_Name: MinimapRT
|
||||||
|
m_ImageContentsHash:
|
||||||
|
serializedVersion: 2
|
||||||
|
Hash: 00000000000000000000000000000000
|
||||||
|
m_IsAlphaChannelOptional: 0
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Width: 256
|
||||||
|
m_Height: 256
|
||||||
|
m_AntiAliasing: 1
|
||||||
|
m_MipCount: -1
|
||||||
|
m_DepthStencilFormat: 94
|
||||||
|
m_ColorFormat: 8
|
||||||
|
m_MipMap: 0
|
||||||
|
m_GenerateMips: 1
|
||||||
|
m_SRGB: 0
|
||||||
|
m_UseDynamicScale: 0
|
||||||
|
m_UseDynamicScaleExplicit: 0
|
||||||
|
m_BindMS: 0
|
||||||
|
m_EnableCompatibleFormat: 1
|
||||||
|
m_EnableRandomWrite: 0
|
||||||
|
m_TextureSettings:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_FilterMode: 1
|
||||||
|
m_Aniso: 0
|
||||||
|
m_MipBias: 0
|
||||||
|
m_WrapU: 1
|
||||||
|
m_WrapV: 1
|
||||||
|
m_WrapW: 1
|
||||||
|
m_Dimension: 2
|
||||||
|
m_VolumeDepth: 1
|
||||||
|
m_ShadowSamplingMode: 2
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: e640b4de7a1dee049b38712e7eff82ea
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 8400000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|
@ -185,8 +185,8 @@ BoxCollider:
|
||||||
m_ProvidesContacts: 0
|
m_ProvidesContacts: 0
|
||||||
m_Enabled: 1
|
m_Enabled: 1
|
||||||
serializedVersion: 3
|
serializedVersion: 3
|
||||||
m_Size: {x: 20, y: 1, z: 34}
|
m_Size: {x: 29, y: 1, z: 34}
|
||||||
m_Center: {x: -13.5, y: 0, z: 8.5}
|
m_Center: {x: -14, y: 0, z: 8.5}
|
||||||
--- !u!1 &167151707
|
--- !u!1 &167151707
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -237,6 +237,134 @@ Transform:
|
||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!1 &260379225
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 260379229}
|
||||||
|
- component: {fileID: 260379228}
|
||||||
|
- component: {fileID: 260379226}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: MinimapCamera
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!114 &260379226
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 260379225}
|
||||||
|
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!20 &260379228
|
||||||
|
Camera:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 260379225}
|
||||||
|
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: 1
|
||||||
|
orthographic size: 80
|
||||||
|
m_Depth: 0
|
||||||
|
m_CullingMask:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Bits: 983
|
||||||
|
m_RenderingPath: -1
|
||||||
|
m_TargetTexture: {fileID: 8400000, guid: e640b4de7a1dee049b38712e7eff82ea, type: 2}
|
||||||
|
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 &260379229
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 260379225}
|
||||||
|
serializedVersion: 2
|
||||||
|
m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068}
|
||||||
|
m_LocalPosition: {x: 14, y: 100, z: 39}
|
||||||
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
m_ConstrainProportionsScale: 0
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 0}
|
||||||
|
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
|
||||||
--- !u!1 &304575571
|
--- !u!1 &304575571
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -745,6 +873,118 @@ Transform:
|
||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 90, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 90, z: 0}
|
||||||
|
--- !u!1 &643505902
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 643505906}
|
||||||
|
- component: {fileID: 643505905}
|
||||||
|
- component: {fileID: 643505904}
|
||||||
|
- component: {fileID: 643505903}
|
||||||
|
m_Layer: 7
|
||||||
|
m_Name: Cube (6)
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!65 &643505903
|
||||||
|
BoxCollider:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 643505902}
|
||||||
|
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: 3
|
||||||
|
m_Size: {x: 1, y: 1, z: 1}
|
||||||
|
m_Center: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!23 &643505904
|
||||||
|
MeshRenderer:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 643505902}
|
||||||
|
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_MaskInteraction: 0
|
||||||
|
m_AdditionalVertexStreams: {fileID: 0}
|
||||||
|
--- !u!33 &643505905
|
||||||
|
MeshFilter:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 643505902}
|
||||||
|
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
|
||||||
|
--- !u!4 &643505906
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 643505902}
|
||||||
|
serializedVersion: 2
|
||||||
|
m_LocalRotation: {x: -0, y: 0.70710576, z: -0, w: 0.70710784}
|
||||||
|
m_LocalPosition: {x: 4, y: 2, z: 41}
|
||||||
|
m_LocalScale: {x: 8, y: 5, z: 12.6126}
|
||||||
|
m_ConstrainProportionsScale: 0
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 0}
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 90, z: 0}
|
||||||
--- !u!1 &832575517
|
--- !u!1 &832575517
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -860,6 +1100,78 @@ BoxCollider:
|
||||||
serializedVersion: 3
|
serializedVersion: 3
|
||||||
m_Size: {x: 32, y: 0.5, z: 87}
|
m_Size: {x: 32, y: 0.5, z: 87}
|
||||||
m_Center: {x: 14.5, y: 0, z: 41}
|
m_Center: {x: 14.5, y: 0, z: 41}
|
||||||
|
--- !u!1 &1058315973
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 1058315976}
|
||||||
|
- component: {fileID: 1058315975}
|
||||||
|
- component: {fileID: 1058315974}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: HUD
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!114 &1058315974
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1058315973}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 1c69cd177f09f0c419288f73b49df886, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier: Assembly-CSharp::TD.UI.HUDController
|
||||||
|
placementController: {fileID: 1597884411}
|
||||||
|
placementManager: {fileID: 1507514108}
|
||||||
|
minimapRenderTexture: {fileID: 8400000, guid: e640b4de7a1dee049b38712e7eff82ea, type: 2}
|
||||||
|
rejectionMessageDuration: 2.5
|
||||||
|
--- !u!114 &1058315975
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1058315973}
|
||||||
|
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: 6aa0af71585acea4db4995c3931dc946, type: 2}
|
||||||
|
m_ParentUI: {fileID: 0}
|
||||||
|
sourceAsset: {fileID: 9197481963319205126, guid: eba711c1def2b194584102ceb5517c48, 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!4 &1058315976
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1058315973}
|
||||||
|
serializedVersion: 2
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: 16.40712, y: 52.13432, z: 9.76984}
|
||||||
|
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 &1064792475
|
--- !u!1 &1064792475
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -928,8 +1240,8 @@ BoxCollider:
|
||||||
m_ProvidesContacts: 0
|
m_ProvidesContacts: 0
|
||||||
m_Enabled: 1
|
m_Enabled: 1
|
||||||
serializedVersion: 3
|
serializedVersion: 3
|
||||||
m_Size: {x: 6, y: 1, z: 1}
|
m_Size: {x: 6, y: 1, z: 8}
|
||||||
m_Center: {x: 2, y: 0, z: 2}
|
m_Center: {x: 2, y: 0, z: -1.5}
|
||||||
--- !u!1 &1078485323
|
--- !u!1 &1078485323
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -957,7 +1269,7 @@ Transform:
|
||||||
m_GameObject: {fileID: 1078485323}
|
m_GameObject: {fileID: 1078485323}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
m_LocalPosition: {x: 27, y: 0, z: 36}
|
m_LocalPosition: {x: 13, y: 0, z: 38}
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
m_ConstrainProportionsScale: 0
|
m_ConstrainProportionsScale: 0
|
||||||
m_Children: []
|
m_Children: []
|
||||||
|
|
@ -977,7 +1289,7 @@ MonoBehaviour:
|
||||||
m_EditorClassIdentifier: Assembly-CSharp::TD.Levels.SpawnerVolume
|
m_EditorClassIdentifier: Assembly-CSharp::TD.Levels.SpawnerVolume
|
||||||
owner: 2
|
owner: 2
|
||||||
spawnerIdInZone: 0
|
spawnerIdInZone: 0
|
||||||
spawnFacing: 3
|
spawnFacing: 1
|
||||||
placementValidity: 0
|
placementValidity: 0
|
||||||
--- !u!65 &1078485326
|
--- !u!65 &1078485326
|
||||||
BoxCollider:
|
BoxCollider:
|
||||||
|
|
@ -998,8 +1310,8 @@ BoxCollider:
|
||||||
m_ProvidesContacts: 0
|
m_ProvidesContacts: 0
|
||||||
m_Enabled: 1
|
m_Enabled: 1
|
||||||
serializedVersion: 3
|
serializedVersion: 3
|
||||||
m_Size: {x: 7, y: 1, z: 6}
|
m_Size: {x: 7, y: 1, z: 7}
|
||||||
m_Center: {x: 0, y: 0, z: 2}
|
m_Center: {x: 0, y: 0, z: 0}
|
||||||
--- !u!1 &1222526236
|
--- !u!1 &1222526236
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -1129,7 +1441,7 @@ Transform:
|
||||||
m_GameObject: {fileID: 1360337262}
|
m_GameObject: {fileID: 1360337262}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
m_LocalPosition: {x: 13, y: 0, z: 3.5}
|
m_LocalPosition: {x: 13, y: 0, z: -3}
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
m_ConstrainProportionsScale: 0
|
m_ConstrainProportionsScale: 0
|
||||||
m_Children: []
|
m_Children: []
|
||||||
|
|
@ -1441,7 +1753,7 @@ MonoBehaviour:
|
||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 1597884408}
|
m_GameObject: {fileID: 1597884408}
|
||||||
m_Enabled: 1
|
m_Enabled: 0
|
||||||
m_EditorHideFlags: 0
|
m_EditorHideFlags: 0
|
||||||
m_Script: {fileID: 11500000, guid: ea0e3a4681be19e4e9c359c1123bf68d, type: 3}
|
m_Script: {fileID: 11500000, guid: ea0e3a4681be19e4e9c359c1123bf68d, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
|
|
@ -1711,7 +2023,7 @@ Transform:
|
||||||
m_GameObject: {fileID: 1975687919}
|
m_GameObject: {fileID: 1975687919}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
m_LocalPosition: {x: 24, y: 0, z: 37.75}
|
m_LocalPosition: {x: 24, y: 0, z: 31.25}
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
m_ConstrainProportionsScale: 0
|
m_ConstrainProportionsScale: 0
|
||||||
m_Children: []
|
m_Children: []
|
||||||
|
|
@ -1750,7 +2062,7 @@ BoxCollider:
|
||||||
m_ProvidesContacts: 0
|
m_ProvidesContacts: 0
|
||||||
m_Enabled: 1
|
m_Enabled: 1
|
||||||
serializedVersion: 3
|
serializedVersion: 3
|
||||||
m_Size: {x: 19, y: 1, z: 34}
|
m_Size: {x: 29, y: 1, z: 34}
|
||||||
m_Center: {x: -10.5, y: 0, z: -13.5}
|
m_Center: {x: -10.5, y: 0, z: -13.5}
|
||||||
--- !u!1 &2024858685
|
--- !u!1 &2024858685
|
||||||
GameObject:
|
GameObject:
|
||||||
|
|
@ -1864,6 +2176,118 @@ Transform:
|
||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!1 &2105067734
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 2105067738}
|
||||||
|
- component: {fileID: 2105067737}
|
||||||
|
- component: {fileID: 2105067736}
|
||||||
|
- component: {fileID: 2105067735}
|
||||||
|
m_Layer: 7
|
||||||
|
m_Name: Cube (7)
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!65 &2105067735
|
||||||
|
BoxCollider:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 2105067734}
|
||||||
|
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: 3
|
||||||
|
m_Size: {x: 1, y: 1, z: 1}
|
||||||
|
m_Center: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!23 &2105067736
|
||||||
|
MeshRenderer:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 2105067734}
|
||||||
|
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_MaskInteraction: 0
|
||||||
|
m_AdditionalVertexStreams: {fileID: 0}
|
||||||
|
--- !u!33 &2105067737
|
||||||
|
MeshFilter:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 2105067734}
|
||||||
|
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
|
||||||
|
--- !u!4 &2105067738
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 2105067734}
|
||||||
|
serializedVersion: 2
|
||||||
|
m_LocalRotation: {x: -0, y: 0.70710576, z: -0, w: 0.70710784}
|
||||||
|
m_LocalPosition: {x: 24, y: 2, z: 41}
|
||||||
|
m_LocalScale: {x: 8, y: 5, z: 12.6126}
|
||||||
|
m_ConstrainProportionsScale: 0
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 0}
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 90, z: 0}
|
||||||
--- !u!1660057539 &9223372036854775807
|
--- !u!1660057539 &9223372036854775807
|
||||||
SceneRoots:
|
SceneRoots:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -1880,5 +2304,9 @@ SceneRoots:
|
||||||
- {fileID: 1239994224}
|
- {fileID: 1239994224}
|
||||||
- {fileID: 2024858689}
|
- {fileID: 2024858689}
|
||||||
- {fileID: 1949204945}
|
- {fileID: 1949204945}
|
||||||
|
- {fileID: 643505906}
|
||||||
|
- {fileID: 2105067738}
|
||||||
- {fileID: 611926976}
|
- {fileID: 611926976}
|
||||||
- {fileID: 1222526238}
|
- {fileID: 1222526238}
|
||||||
|
- {fileID: 1058315976}
|
||||||
|
- {fileID: 260379229}
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -1,3 +1,3 @@
|
||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:3c98285c3a823f2942e9dff02edf75918e7336b4f1496570f2e32a2ffc80e55e
|
oid sha256:57a63c71a6e777bc1d8852d8ba23b96474946cb7aa9b424f35a64cf7fd3149b4
|
||||||
size 8745
|
size 8744
|
||||||
|
|
|
||||||
|
|
@ -594,6 +594,22 @@ namespace TD.Gameplay
|
||||||
return TryGetDefinition(typeId, out var def) ? def : null;
|
return TryGetDefinition(typeId, out var def) ? def : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Enumerates all valid (definition, typeId) pairs from the current definition list.
|
||||||
|
/// TypeId 0 is reserved; valid entries start at index 1. Used by the HUD command grid
|
||||||
|
/// to populate tower buttons. Only meaningful on the instance — check Instance != null
|
||||||
|
/// before calling.
|
||||||
|
/// </summary>
|
||||||
|
public System.Collections.Generic.IEnumerable<(TowerDefinition def, int typeId)>
|
||||||
|
GetAvailableDefinitions()
|
||||||
|
{
|
||||||
|
for (int i = 1; i < towerDefinitions.Length; i++)
|
||||||
|
{
|
||||||
|
if (towerDefinitions[i] != null)
|
||||||
|
yield return (towerDefinitions[i], i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Maps a client ID to the PlayerSlot assigned to that client.
|
/// Maps a client ID to the PlayerSlot assigned to that client.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
321
Assets/_Project/Scripts/UI/HUDController.cs
Normal file
321
Assets/_Project/Scripts/UI/HUDController.cs
Normal file
|
|
@ -0,0 +1,321 @@
|
||||||
|
// Assets/_Project/Scripts/UI/HUDController.cs
|
||||||
|
using System.Collections;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.UIElements;
|
||||||
|
using TD.Gameplay;
|
||||||
|
using TD.Towers;
|
||||||
|
|
||||||
|
namespace TD.UI
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Drives the in-match HUD. Requires a UIDocument on the same GameObject.
|
||||||
|
/// Wires gold display, tower command grid, tooltip, rejection messages,
|
||||||
|
/// and minimap RenderTexture to their UI Toolkit counterparts.
|
||||||
|
/// </summary>
|
||||||
|
[RequireComponent(typeof(UIDocument))]
|
||||||
|
public class HUDController : MonoBehaviour
|
||||||
|
{
|
||||||
|
// ----- Inspector --------------------------------------------------
|
||||||
|
|
||||||
|
[Header("Scene References")]
|
||||||
|
[Tooltip("The local client's TowerPlacementController.")]
|
||||||
|
[SerializeField] private TowerPlacementController placementController;
|
||||||
|
|
||||||
|
[Tooltip("The TowerPlacementManager NetworkObject in the scene.")]
|
||||||
|
[SerializeField] private TowerPlacementManager placementManager;
|
||||||
|
|
||||||
|
[Header("Minimap")]
|
||||||
|
[Tooltip("RenderTexture that the minimap camera renders into.")]
|
||||||
|
[SerializeField] private RenderTexture minimapRenderTexture;
|
||||||
|
|
||||||
|
[Header("Settings")]
|
||||||
|
[SerializeField] private float rejectionMessageDuration = 2.5f;
|
||||||
|
|
||||||
|
// ----- Cached UI element references -------------------------------
|
||||||
|
|
||||||
|
private Label goldLabel;
|
||||||
|
private Label waveLabel;
|
||||||
|
private Label portraitName;
|
||||||
|
private VisualElement commandGrid;
|
||||||
|
private Label ttTitle;
|
||||||
|
private Label ttDesc;
|
||||||
|
private Label ttStats;
|
||||||
|
private Label ttCost;
|
||||||
|
private Label rejectionLabel;
|
||||||
|
|
||||||
|
// ----- State ------------------------------------------------------
|
||||||
|
|
||||||
|
private Coroutine rejectionFadeCoroutine;
|
||||||
|
private bool gridPopulated;
|
||||||
|
private bool uiInitialized;
|
||||||
|
|
||||||
|
// ----- Lifecycle --------------------------------------------------
|
||||||
|
|
||||||
|
private void Start()
|
||||||
|
{
|
||||||
|
// UIDocument creates its panel in OnEnable, which runs after all
|
||||||
|
// Awake() calls. Accessing rootVisualElement in Awake() is too early.
|
||||||
|
// Start() is safe because all OnEnable() calls have completed by then.
|
||||||
|
InitializeUI();
|
||||||
|
TryPopulateCommandGrid();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void InitializeUI()
|
||||||
|
{
|
||||||
|
var doc = GetComponent<UIDocument>();
|
||||||
|
if (doc == null)
|
||||||
|
{
|
||||||
|
Debug.LogError("[HUDController] No UIDocument component found.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var root = doc.rootVisualElement;
|
||||||
|
if (root == null)
|
||||||
|
{
|
||||||
|
Debug.LogError("[HUDController] rootVisualElement is null. " +
|
||||||
|
"Check that Panel Settings and Source Asset are assigned.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Cache element references — log a warning for any that are missing
|
||||||
|
// so UXML/USS mismatches surface immediately.
|
||||||
|
goldLabel = Require<Label>(root, "gold-label");
|
||||||
|
waveLabel = Require<Label>(root, "wave-label");
|
||||||
|
portraitName = Require<Label>(root, "portrait-name");
|
||||||
|
commandGrid = Require<VisualElement>(root, "command-grid");
|
||||||
|
ttTitle = Require<Label>(root, "tt-title");
|
||||||
|
ttDesc = Require<Label>(root, "tt-desc");
|
||||||
|
ttStats = Require<Label>(root, "tt-stats");
|
||||||
|
ttCost = Require<Label>(root, "tt-cost");
|
||||||
|
rejectionLabel = Require<Label>(root, "rejection-label");
|
||||||
|
|
||||||
|
// Map area and its transparent ancestors must not consume pointer
|
||||||
|
// events so clicks reach the 3D scene underneath.
|
||||||
|
SetPickIgnore(root, "hud-root");
|
||||||
|
SetPickIgnore(root, "main-area");
|
||||||
|
SetPickIgnore(root, "map-area");
|
||||||
|
if (rejectionLabel != null)
|
||||||
|
rejectionLabel.pickingMode = PickingMode.Ignore;
|
||||||
|
|
||||||
|
// Upgrade/sell have no backing system yet.
|
||||||
|
SetEnabled(root, "upgrade-btn", false);
|
||||||
|
SetEnabled(root, "sell-btn", false);
|
||||||
|
|
||||||
|
// Minimap RenderTexture.
|
||||||
|
if (minimapRenderTexture != null)
|
||||||
|
{
|
||||||
|
var minimap = root.Q<VisualElement>("minimap");
|
||||||
|
if (minimap != null)
|
||||||
|
minimap.style.backgroundImage =
|
||||||
|
Background.FromRenderTexture(minimapRenderTexture);
|
||||||
|
}
|
||||||
|
|
||||||
|
uiInitialized = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnEnable()
|
||||||
|
{
|
||||||
|
TowerPlacementController.OnRejectionMessageReady += ShowRejectionMessage;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnDisable()
|
||||||
|
{
|
||||||
|
TowerPlacementController.OnRejectionMessageReady -= ShowRejectionMessage;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Update()
|
||||||
|
{
|
||||||
|
if (!uiInitialized) return;
|
||||||
|
|
||||||
|
if (!gridPopulated)
|
||||||
|
TryPopulateCommandGrid();
|
||||||
|
|
||||||
|
RefreshGoldDisplay();
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----- Gold display -----------------------------------------------
|
||||||
|
|
||||||
|
private void RefreshGoldDisplay()
|
||||||
|
{
|
||||||
|
if (goldLabel == null) return;
|
||||||
|
var gm = PlayerGoldManager.Local;
|
||||||
|
goldLabel.text = gm != null ? $"{gm.CurrentGold:N0} g" : "-- g";
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----- Command grid -----------------------------------------------
|
||||||
|
|
||||||
|
private void TryPopulateCommandGrid()
|
||||||
|
{
|
||||||
|
if (commandGrid == null) return;
|
||||||
|
|
||||||
|
if (placementManager == null)
|
||||||
|
placementManager = TowerPlacementManager.Instance;
|
||||||
|
|
||||||
|
if (placementManager == null) return; // not spawned yet — retry next frame
|
||||||
|
|
||||||
|
commandGrid.Clear();
|
||||||
|
|
||||||
|
const int COLS = 4;
|
||||||
|
const int ROWS = 3;
|
||||||
|
const int MAX = COLS * ROWS;
|
||||||
|
|
||||||
|
var defs = new System.Collections.Generic.List<(TowerDefinition def, int typeId)>();
|
||||||
|
foreach (var entry in placementManager.GetAvailableDefinitions())
|
||||||
|
{
|
||||||
|
defs.Add(entry);
|
||||||
|
if (defs.Count >= MAX) break;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int row = 0; row < ROWS; row++)
|
||||||
|
{
|
||||||
|
var rowEl = new VisualElement();
|
||||||
|
rowEl.AddToClassList("cmd-row");
|
||||||
|
|
||||||
|
for (int col = 0; col < COLS; col++)
|
||||||
|
{
|
||||||
|
int index = row * COLS + col;
|
||||||
|
VisualElement btn = index < defs.Count
|
||||||
|
? CreateTowerButton(defs[index].def, defs[index].typeId)
|
||||||
|
: CreateEmptySlot();
|
||||||
|
rowEl.Add(btn);
|
||||||
|
}
|
||||||
|
|
||||||
|
commandGrid.Add(rowEl);
|
||||||
|
}
|
||||||
|
|
||||||
|
gridPopulated = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private VisualElement CreateTowerButton(TowerDefinition def, int typeId)
|
||||||
|
{
|
||||||
|
var btn = new Button(() =>
|
||||||
|
{
|
||||||
|
if (placementController != null)
|
||||||
|
placementController.BeginPlacement(def, typeId);
|
||||||
|
else
|
||||||
|
Debug.LogWarning("[HUDController] No TowerPlacementController assigned.");
|
||||||
|
});
|
||||||
|
|
||||||
|
btn.AddToClassList("cmd-btn");
|
||||||
|
|
||||||
|
// Icon placeholder — swap for background-image on btn when art exists.
|
||||||
|
var iconPlaceholder = new VisualElement();
|
||||||
|
iconPlaceholder.AddToClassList("cmd-icon-placeholder");
|
||||||
|
iconPlaceholder.pickingMode = PickingMode.Ignore;
|
||||||
|
|
||||||
|
var costLabel = new Label($"{def.GoldCost}g");
|
||||||
|
costLabel.AddToClassList("cmd-cost");
|
||||||
|
costLabel.pickingMode = PickingMode.Ignore;
|
||||||
|
|
||||||
|
btn.Add(iconPlaceholder);
|
||||||
|
btn.Add(costLabel);
|
||||||
|
|
||||||
|
btn.RegisterCallback<MouseEnterEvent>(_ => ShowTooltip(def));
|
||||||
|
btn.RegisterCallback<MouseLeaveEvent>(_ => ClearTooltip());
|
||||||
|
|
||||||
|
return btn;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static VisualElement CreateEmptySlot()
|
||||||
|
{
|
||||||
|
var slot = new VisualElement();
|
||||||
|
slot.AddToClassList("cmd-btn");
|
||||||
|
slot.AddToClassList("empty-slot");
|
||||||
|
slot.pickingMode = PickingMode.Ignore;
|
||||||
|
return slot;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----- Portrait / selection context ----------------------------------
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Called by the selection system when a unit is selected or deselected.
|
||||||
|
/// Pass null or empty to clear (nothing selected).
|
||||||
|
/// </summary>
|
||||||
|
public void SetSelectedUnitName(string unitName)
|
||||||
|
{
|
||||||
|
if (portraitName == null) return;
|
||||||
|
portraitName.text = string.IsNullOrEmpty(unitName) ? "" : unitName;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----- Tooltip ----------------------------------------------------
|
||||||
|
|
||||||
|
private void ShowTooltip(TowerDefinition def)
|
||||||
|
{
|
||||||
|
if (ttTitle == null) return;
|
||||||
|
|
||||||
|
ttTitle.text = def.DisplayName;
|
||||||
|
ttDesc.text = def.Description ?? "";
|
||||||
|
|
||||||
|
if (def.Damage > 0 || def.Range > 0)
|
||||||
|
{
|
||||||
|
ttStats.text = $"DMG: {def.Damage} · Range: {def.Range:0}";
|
||||||
|
if (def.FireRate > 0)
|
||||||
|
ttStats.text += $"\nFire rate: {def.FireRate:0.0}/s";
|
||||||
|
if (def.SlowFactor < 1f)
|
||||||
|
ttStats.text += $"\nSlow: {(1f - def.SlowFactor) * 100f:0}%";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ttStats.text = "(stats pending)";
|
||||||
|
}
|
||||||
|
|
||||||
|
int sellValue = Mathf.RoundToInt(def.GoldCost * 0.7f);
|
||||||
|
ttCost.text = $"Cost: {def.GoldCost}g · Sell: {sellValue}g";
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ClearTooltip()
|
||||||
|
{
|
||||||
|
if (ttTitle == null) return;
|
||||||
|
ttTitle.text = "";
|
||||||
|
ttDesc.text = "";
|
||||||
|
ttStats.text = "";
|
||||||
|
ttCost.text = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----- Rejection messages -----------------------------------------
|
||||||
|
|
||||||
|
private void ShowRejectionMessage(string message)
|
||||||
|
{
|
||||||
|
if (rejectionLabel == null) return;
|
||||||
|
|
||||||
|
rejectionLabel.text = message;
|
||||||
|
rejectionLabel.style.display = DisplayStyle.Flex;
|
||||||
|
|
||||||
|
if (rejectionFadeCoroutine != null)
|
||||||
|
StopCoroutine(rejectionFadeCoroutine);
|
||||||
|
|
||||||
|
rejectionFadeCoroutine = StartCoroutine(HideRejectionAfterDelay());
|
||||||
|
}
|
||||||
|
|
||||||
|
private IEnumerator HideRejectionAfterDelay()
|
||||||
|
{
|
||||||
|
yield return new WaitForSeconds(rejectionMessageDuration);
|
||||||
|
if (rejectionLabel != null)
|
||||||
|
rejectionLabel.style.display = DisplayStyle.None;
|
||||||
|
rejectionFadeCoroutine = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----- Helpers ----------------------------------------------------
|
||||||
|
|
||||||
|
private static T Require<T>(VisualElement root, string name) where T : VisualElement
|
||||||
|
{
|
||||||
|
var el = root.Q<T>(name);
|
||||||
|
if (el == null)
|
||||||
|
Debug.LogWarning($"[HUDController] Element not found: '{name}' ({typeof(T).Name}). " +
|
||||||
|
$"Check that the name matches the UXML.");
|
||||||
|
return el;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void SetPickIgnore(VisualElement root, string name)
|
||||||
|
{
|
||||||
|
var el = root.Q<VisualElement>(name);
|
||||||
|
if (el != null) el.pickingMode = PickingMode.Ignore;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void SetEnabled(VisualElement root, string name, bool enabled)
|
||||||
|
{
|
||||||
|
var el = root.Q<Button>(name);
|
||||||
|
if (el != null) el.SetEnabled(enabled);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
2
Assets/_Project/Scripts/UI/HUDController.cs.meta
Normal file
2
Assets/_Project/Scripts/UI/HUDController.cs.meta
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 1c69cd177f09f0c419288f73b49df886
|
||||||
8
Assets/_Project/UI.meta
Normal file
8
Assets/_Project/UI.meta
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 5078b752e8a1ca9489492e325efebaa4
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
342
Assets/_Project/UI/HUD.uss
Normal file
342
Assets/_Project/UI/HUD.uss
Normal file
|
|
@ -0,0 +1,342 @@
|
||||||
|
/* ============================================================
|
||||||
|
HUD.uss — Match HUD stylesheet
|
||||||
|
Layout mirrors wintermaul_ui_v4.html; visual style is
|
||||||
|
placeholder and will be replaced in Phase 2.
|
||||||
|
============================================================ */
|
||||||
|
|
||||||
|
/* Root: covers full screen, transparent so the 3D scene shows through.
|
||||||
|
PickingMode.Ignore is set in C# so clicks in the map area reach the scene. */
|
||||||
|
.hud-root {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
flex-direction: column;
|
||||||
|
background-color: rgba(0, 0, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ---- TOP BAR ------------------------------------------------ */
|
||||||
|
|
||||||
|
.top-bar {
|
||||||
|
height: 28px;
|
||||||
|
flex-shrink: 0;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
padding: 0 10px;
|
||||||
|
background-color: rgba(22, 20, 10, 0.92);
|
||||||
|
border-bottom-width: 1px;
|
||||||
|
border-bottom-color: rgba(90, 80, 32, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.res-group {
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gold-label,
|
||||||
|
.income-label,
|
||||||
|
.wave-label,
|
||||||
|
.dimmed-label {
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.top-spacer {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gold-label {
|
||||||
|
color: rgb(255, 224, 102);
|
||||||
|
font-size: 12px;
|
||||||
|
-unity-font-style: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.income-label {
|
||||||
|
color: rgb(136, 204, 255);
|
||||||
|
font-size: 11px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wave-label {
|
||||||
|
color: rgb(255, 170, 170);
|
||||||
|
font-size: 11px;
|
||||||
|
-unity-font-style: bold;
|
||||||
|
background-color: rgba(58, 26, 26, 0.85);
|
||||||
|
border-width: 1px;
|
||||||
|
border-color: rgba(138, 58, 58, 1);
|
||||||
|
border-radius: 3px;
|
||||||
|
padding: 1px 7px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dimmed-label {
|
||||||
|
color: rgb(136, 136, 136);
|
||||||
|
font-size: 11px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ---- MAIN AREA ---------------------------------------------- */
|
||||||
|
|
||||||
|
.main-area {
|
||||||
|
flex: 1;
|
||||||
|
flex-direction: row;
|
||||||
|
min-height: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Transparent viewport area. PickingMode set to Ignore in C#. */
|
||||||
|
.map-area {
|
||||||
|
flex: 1;
|
||||||
|
background-color: rgba(0,0,0,0);
|
||||||
|
}
|
||||||
|
|
||||||
|
.rejection-label {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 60px;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
-unity-text-align: upper-center;
|
||||||
|
color: rgb(255, 90, 90);
|
||||||
|
font-size: 14px;
|
||||||
|
-unity-font-style: bold;
|
||||||
|
background-color: rgba(0, 0, 0, 0.65);
|
||||||
|
padding: 4px 14px;
|
||||||
|
border-radius: 4px;
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ---- RIGHT SCOREBOARD PANEL --------------------------------- */
|
||||||
|
|
||||||
|
.right-panel {
|
||||||
|
width: 130px;
|
||||||
|
flex-shrink: 0;
|
||||||
|
align-self: flex-start;
|
||||||
|
flex-direction: column;
|
||||||
|
background-color: rgb(22, 22, 16);
|
||||||
|
border-left-width: 1px;
|
||||||
|
border-left-color: rgba(58, 58, 32, 1);
|
||||||
|
border-bottom-width: 1px;
|
||||||
|
border-bottom-color: rgba(58, 58, 32, 1);
|
||||||
|
border-radius: 0 0 0 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.panel-header {
|
||||||
|
padding: 4px 6px;
|
||||||
|
font-size: 10px;
|
||||||
|
color: rgb(255, 224, 102);
|
||||||
|
-unity-font-style: bold;
|
||||||
|
-unity-text-align: upper-center;
|
||||||
|
background-color: rgb(42, 36, 16);
|
||||||
|
border-bottom-width: 1px;
|
||||||
|
border-bottom-color: rgba(58, 58, 32, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.section-label {
|
||||||
|
padding: 4px 6px 2px;
|
||||||
|
font-size: 9px;
|
||||||
|
color: rgb(102, 102, 80);
|
||||||
|
}
|
||||||
|
|
||||||
|
.player-list {
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.income-row {
|
||||||
|
flex-direction: row;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 2px 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.income-key {
|
||||||
|
font-size: 10px;
|
||||||
|
color: rgb(136, 136, 112);
|
||||||
|
}
|
||||||
|
|
||||||
|
.income-val {
|
||||||
|
font-size: 10px;
|
||||||
|
color: rgb(255, 224, 102);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ---- BOTTOM UI STRIP ---------------------------------------- */
|
||||||
|
|
||||||
|
.bottom-ui {
|
||||||
|
height: 110px;
|
||||||
|
flex-shrink: 0;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: stretch;
|
||||||
|
background-color: rgb(19, 15, 4);
|
||||||
|
border-top-width: 2px;
|
||||||
|
border-top-color: rgba(90, 74, 16, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Minimap — RenderTexture applied as background-image at runtime */
|
||||||
|
.minimap {
|
||||||
|
width: 110px;
|
||||||
|
flex-shrink: 0;
|
||||||
|
background-color: rgb(10, 26, 10);
|
||||||
|
border-right-width: 1px;
|
||||||
|
border-right-color: rgba(42, 58, 26, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Portrait */
|
||||||
|
.portrait-box {
|
||||||
|
width: 84px;
|
||||||
|
flex-shrink: 0;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 4px;
|
||||||
|
border-right-width: 1px;
|
||||||
|
border-right-color: rgba(58, 48, 16, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.portrait-image {
|
||||||
|
width: 58px;
|
||||||
|
height: 72px;
|
||||||
|
margin-bottom: 3px;
|
||||||
|
background-color: rgb(13, 26, 13);
|
||||||
|
border-width: 1px;
|
||||||
|
border-color: rgba(58, 90, 58, 1);
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.portrait-name {
|
||||||
|
font-size: 9px;
|
||||||
|
color: rgb(255, 224, 102);
|
||||||
|
-unity-text-align: upper-center;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Command grid: 3 row-containers injected at runtime, each holding 4 buttons */
|
||||||
|
.command-grid {
|
||||||
|
flex: 1;
|
||||||
|
flex-direction: column;
|
||||||
|
padding: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cmd-row {
|
||||||
|
flex: 1;
|
||||||
|
flex-direction: row;
|
||||||
|
margin-bottom: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Individual command buttons */
|
||||||
|
.cmd-btn {
|
||||||
|
flex: 1;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 2px;
|
||||||
|
background-color: rgb(26, 26, 10);
|
||||||
|
border-width: 1px;
|
||||||
|
border-color: rgba(58, 58, 26, 1);
|
||||||
|
border-radius: 3px;
|
||||||
|
margin-right: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Icon area placeholder — replaced by background-image when art exists */
|
||||||
|
.cmd-icon-placeholder {
|
||||||
|
flex: 1;
|
||||||
|
width: 100%;
|
||||||
|
background-color: rgba(255, 255, 255, 0.06);
|
||||||
|
border-radius: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.cmd-btn:hover {
|
||||||
|
background-color: rgb(42, 42, 21);
|
||||||
|
border-color: rgba(106, 106, 48, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.cmd-btn.active {
|
||||||
|
background-color: rgb(42, 38, 16);
|
||||||
|
border-color: rgb(255, 224, 102);
|
||||||
|
}
|
||||||
|
|
||||||
|
.cmd-btn.unaffordable {
|
||||||
|
opacity: 0.4;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cmd-btn.empty-slot {
|
||||||
|
opacity: 0.12;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cmd-icon {
|
||||||
|
font-size: 14px;
|
||||||
|
-unity-text-align: upper-center;
|
||||||
|
color: rgb(255, 255, 255);
|
||||||
|
/* Icon is set as text on a Label; swap for background-image when art exists */
|
||||||
|
}
|
||||||
|
|
||||||
|
.cmd-name {
|
||||||
|
font-size: 7px;
|
||||||
|
color: rgb(170, 170, 170);
|
||||||
|
-unity-text-align: upper-center;
|
||||||
|
white-space: normal;
|
||||||
|
overflow: hidden;
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cmd-cost {
|
||||||
|
font-size: 7px;
|
||||||
|
color: rgb(255, 224, 102);
|
||||||
|
-unity-text-align: upper-center;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Side column: Upgrade / (empty) / Sell */
|
||||||
|
.side-col {
|
||||||
|
width: 66px;
|
||||||
|
flex-shrink: 0;
|
||||||
|
flex-direction: column;
|
||||||
|
padding: 4px;
|
||||||
|
border-left-width: 2px;
|
||||||
|
border-left-color: rgba(58, 48, 16, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.side-col > * {
|
||||||
|
margin-bottom: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.side-btn {
|
||||||
|
flex: 1;
|
||||||
|
/* inherits .cmd-btn styles */
|
||||||
|
}
|
||||||
|
|
||||||
|
.side-empty {
|
||||||
|
flex: 1;
|
||||||
|
opacity: 0.12;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Tooltip panel */
|
||||||
|
.tooltip-box {
|
||||||
|
width: 164px;
|
||||||
|
flex-shrink: 0;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 8px;
|
||||||
|
border-left-width: 1px;
|
||||||
|
border-left-color: rgba(58, 48, 16, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.tt-title {
|
||||||
|
font-size: 11px;
|
||||||
|
color: rgb(255, 224, 102);
|
||||||
|
-unity-font-style: bold;
|
||||||
|
margin-bottom: 4px;
|
||||||
|
white-space: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tt-desc {
|
||||||
|
font-size: 9px;
|
||||||
|
color: rgb(170, 168, 144);
|
||||||
|
white-space: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tt-stats {
|
||||||
|
font-size: 9px;
|
||||||
|
color: rgb(136, 170, 136);
|
||||||
|
margin-top: 3px;
|
||||||
|
white-space: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tt-cost {
|
||||||
|
font-size: 9px;
|
||||||
|
color: rgb(255, 224, 102);
|
||||||
|
margin-top: 4px;
|
||||||
|
}
|
||||||
12
Assets/_Project/UI/HUD.uss.meta
Normal file
12
Assets/_Project/UI/HUD.uss.meta
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 7997d647c4888b94c870943338c17d41
|
||||||
|
ScriptedImporter:
|
||||||
|
internalIDToNameTable: []
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
script: {fileID: 12385, guid: 0000000000000000e000000000000000, type: 0}
|
||||||
|
disableValidation: 0
|
||||||
|
unsupportedSelectorAction: 0
|
||||||
71
Assets/_Project/UI/HUD.uxml
Normal file
71
Assets/_Project/UI/HUD.uxml
Normal file
|
|
@ -0,0 +1,71 @@
|
||||||
|
<ui:UXML xmlns:ui="UnityEngine.UIElements" editor-extension-mode="False">
|
||||||
|
<Style src="project://database/Assets/_Project/UI/HUD.uss?fileID=7433441132597879392&guid=7997d647c4888b94c870943338c17d41&type=3#HUD"/>
|
||||||
|
<ui:VisualElement name="hud-root" class="hud-root">
|
||||||
|
<ui:VisualElement name="top-bar" class="top-bar">
|
||||||
|
<ui:VisualElement class="res-group">
|
||||||
|
<ui:Label name="gold-label" text="0 g" class="gold-label"/>
|
||||||
|
<ui:Label name="income-label" text="+? g/wave" class="income-label"/>
|
||||||
|
</ui:VisualElement>
|
||||||
|
<ui:VisualElement class="top-spacer"/>
|
||||||
|
<ui:VisualElement class="res-group">
|
||||||
|
<ui:Label name="wave-label" text="Wave ? / ?" class="wave-label"/>
|
||||||
|
<ui:Label name="next-wave-label" text="next: --:--" class="dimmed-label"/>
|
||||||
|
<ui:Label name="leaked-label" text="leaked: ?" class="dimmed-label"/>
|
||||||
|
<ui:Label name="lives-label" text="lives: ?" class="dimmed-label"/>
|
||||||
|
</ui:VisualElement>
|
||||||
|
</ui:VisualElement>
|
||||||
|
<ui:VisualElement name="main-area" class="main-area">
|
||||||
|
<ui:VisualElement name="map-area" class="map-area">
|
||||||
|
<ui:Label name="rejection-label" text="" class="rejection-label"/>
|
||||||
|
</ui:VisualElement>
|
||||||
|
<ui:VisualElement name="right-panel" class="right-panel">
|
||||||
|
<ui:Label text="scoreboard" class="panel-header"/>
|
||||||
|
<ui:Label text="name · lives · leaked" class="section-label"/>
|
||||||
|
<ui:VisualElement name="player-list" class="player-list"/>
|
||||||
|
<ui:Label text="income / wave" class="section-label" style="margin-top: 6px;"/>
|
||||||
|
<ui:VisualElement class="income-row">
|
||||||
|
<ui:Label text="base" class="income-key"/>
|
||||||
|
<ui:Label name="income-base-label" text="+? g" class="income-val"/>
|
||||||
|
</ui:VisualElement>
|
||||||
|
<ui:VisualElement class="income-row">
|
||||||
|
<ui:Label text="bonus" class="income-key"/>
|
||||||
|
<ui:Label name="income-bonus-label" text="+? g" class="income-val"/>
|
||||||
|
</ui:VisualElement>
|
||||||
|
<ui:VisualElement class="income-row">
|
||||||
|
<ui:Label text="total" class="income-key"/>
|
||||||
|
<ui:Label name="income-total-label" text="+? g" class="income-val"/>
|
||||||
|
</ui:VisualElement>
|
||||||
|
<ui:Label text="race" class="section-label" style="margin-top: 4px;"/>
|
||||||
|
<ui:VisualElement class="income-row">
|
||||||
|
<ui:Label text="builder" class="income-key"/>
|
||||||
|
<ui:Label name="race-label" text="?" class="income-val"/>
|
||||||
|
</ui:VisualElement>
|
||||||
|
</ui:VisualElement>
|
||||||
|
</ui:VisualElement>
|
||||||
|
<ui:VisualElement name="bottom-ui" class="bottom-ui">
|
||||||
|
<ui:VisualElement name="minimap" class="minimap"/>
|
||||||
|
<ui:VisualElement name="portrait-box" class="portrait-box">
|
||||||
|
<ui:VisualElement name="portrait-image" class="portrait-image"/>
|
||||||
|
<ui:Label name="portrait-name" text="" class="portrait-name"/>
|
||||||
|
</ui:VisualElement>
|
||||||
|
<ui:VisualElement name="command-grid" class="command-grid"/>
|
||||||
|
<ui:VisualElement name="side-col" class="side-col">
|
||||||
|
<ui:Button name="upgrade-btn" class="cmd-btn side-btn">
|
||||||
|
<ui:Label text="↑" class="cmd-icon"/>
|
||||||
|
<ui:Label text="Upgrade" class="cmd-name"/>
|
||||||
|
</ui:Button>
|
||||||
|
<ui:VisualElement class="side-empty"/>
|
||||||
|
<ui:Button name="sell-btn" class="cmd-btn side-btn">
|
||||||
|
<ui:Label text="✕" class="cmd-icon"/>
|
||||||
|
<ui:Label text="Sell" class="cmd-name"/>
|
||||||
|
</ui:Button>
|
||||||
|
</ui:VisualElement>
|
||||||
|
<ui:VisualElement name="tooltip-box" class="tooltip-box">
|
||||||
|
<ui:Label name="tt-title" text="" class="tt-title"/>
|
||||||
|
<ui:Label name="tt-desc" text="" class="tt-desc"/>
|
||||||
|
<ui:Label name="tt-stats" text="" class="tt-stats"/>
|
||||||
|
<ui:Label name="tt-cost" text="" class="tt-cost"/>
|
||||||
|
</ui:VisualElement>
|
||||||
|
</ui:VisualElement>
|
||||||
|
</ui:VisualElement>
|
||||||
|
</ui:UXML>
|
||||||
10
Assets/_Project/UI/HUD.uxml.meta
Normal file
10
Assets/_Project/UI/HUD.uxml.meta
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: eba711c1def2b194584102ceb5517c48
|
||||||
|
ScriptedImporter:
|
||||||
|
internalIDToNameTable: []
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0}
|
||||||
52
Assets/_Project/UI/HUDPanelSettings.asset
Normal file
52
Assets/_Project/UI/HUDPanelSettings.asset
Normal file
|
|
@ -0,0 +1,52 @@
|
||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!114 &11400000
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 0}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 19101, guid: 0000000000000000e000000000000000, type: 0}
|
||||||
|
m_Name: HUDPanelSettings
|
||||||
|
m_EditorClassIdentifier: UnityEngine.dll::UnityEngine.UIElements.PanelSettings
|
||||||
|
themeUss: {fileID: -4733365628477956816, guid: b37fce804ca93da429eeb014b35d9cc2, type: 3}
|
||||||
|
m_DisableNoThemeWarning: 0
|
||||||
|
m_TargetTexture: {fileID: 0}
|
||||||
|
m_RenderMode: 0
|
||||||
|
m_ColliderUpdateMode: 0
|
||||||
|
m_ColliderIsTrigger: 1
|
||||||
|
m_ScaleMode: 1
|
||||||
|
m_ReferenceSpritePixelsPerUnit: 100
|
||||||
|
m_PixelsPerUnit: 100
|
||||||
|
m_Scale: 1
|
||||||
|
m_ReferenceDpi: 96
|
||||||
|
m_FallbackDpi: 96
|
||||||
|
m_ReferenceResolution: {x: 1200, y: 800}
|
||||||
|
m_ScreenMatchMode: 0
|
||||||
|
m_Match: 0
|
||||||
|
m_SortingOrder: 0
|
||||||
|
m_TargetDisplay: 0
|
||||||
|
m_BindingLogLevel: 0
|
||||||
|
m_ClearDepthStencil: 1
|
||||||
|
m_ClearColor: 0
|
||||||
|
m_ColorClearValue: {r: 0, g: 0, b: 0, a: 0}
|
||||||
|
m_VertexBudget: 0
|
||||||
|
m_TextureSlotCount: 8
|
||||||
|
m_DynamicAtlasSettings:
|
||||||
|
m_MinAtlasSize: 64
|
||||||
|
m_MaxAtlasSize: 4096
|
||||||
|
m_MaxSubTextureSize: 64
|
||||||
|
m_ActiveFilters: -1
|
||||||
|
m_AtlasBlitShader: {fileID: 9101, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
m_DefaultShader: {fileID: 9100, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
m_RuntimeGaussianBlurShader: {fileID: 20300, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
m_RuntimeColorEffectShader: {fileID: 20301, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
m_SDFShader: {fileID: 19011, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
m_BitmapShader: {fileID: 9001, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
m_SpriteShader: {fileID: 19012, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
m_ICUDataAsset: {fileID: 0}
|
||||||
|
forceGammaRendering: 0
|
||||||
|
textSettings: {fileID: 0}
|
||||||
8
Assets/_Project/UI/HUDPanelSettings.asset.meta
Normal file
8
Assets/_Project/UI/HUDPanelSettings.asset.meta
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 6aa0af71585acea4db4995c3931dc946
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 11400000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Loading…
Add table
Add a link
Reference in a new issue