From f6297315395307a050f671ce5dcd82ce6f6ccdd8 Mon Sep 17 00:00:00 2001 From: MelekTaus Moribundus Date: Tue, 30 Jun 2026 21:47:23 +0200 Subject: [PATCH] Author the general and paintings panels in the paint HUD Add the General and Paintings panels to the HUD layout prefab and register their stable widget names so the binder can find and manage them. --- Assets/Prefabs/PaintHudPanel.prefab | 173 ++++++++++++++++++++++++---- Assets/Scripts/PaintHud.cs | 6 +- 2 files changed, 153 insertions(+), 26 deletions(-) diff --git a/Assets/Prefabs/PaintHudPanel.prefab b/Assets/Prefabs/PaintHudPanel.prefab index ab7a1c0..d4ed0a9 100644 --- a/Assets/Prefabs/PaintHudPanel.prefab +++ b/Assets/Prefabs/PaintHudPanel.prefab @@ -907,7 +907,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.Image m_Material: {fileID: 0} - m_Color: {r: 0.16, g: 0.16, b: 0.2, a: 1} + m_Color: {r: 0, g: 0, b: 0, a: 0} m_RaycastTarget: 1 m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_Maskable: 1 @@ -1019,8 +1019,8 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: -16, y: 0} + m_AnchoredPosition: {x: 0, y: -3} + m_SizeDelta: {x: -20, y: -6} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &2241147255700588259 CanvasRenderer: @@ -1077,14 +1077,14 @@ MonoBehaviour: m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_fontSize: 14 - m_fontSizeBase: 14 + m_fontSize: 12 + m_fontSizeBase: 12 m_fontWeight: 400 m_enableAutoSizing: 0 m_fontSizeMin: 18 m_fontSizeMax: 72 m_fontStyle: 0 - m_HorizontalAlignment: 2 + m_HorizontalAlignment: 1 m_VerticalAlignment: 8192 m_textAlignment: 65535 m_characterSpacing: 0 @@ -3578,8 +3578,8 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: 6} - m_SizeDelta: {x: -12, y: -76} + m_AnchoredPosition: {x: 0, y: 4} + m_SizeDelta: {x: -12, y: -72} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &1184998392237983325 CanvasRenderer: @@ -3602,7 +3602,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.Image m_Material: {fileID: 0} - m_Color: {r: 0, g: 0, b: 0, a: 0.25} + m_Color: {r: 0, g: 0, b: 0, a: 0} m_RaycastTarget: 1 m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_Maskable: 1 @@ -5319,7 +5319,7 @@ RectTransform: m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 0} m_AnchoredPosition: {x: 0, y: 6} - m_SizeDelta: {x: 0, y: 34} + m_SizeDelta: {x: 0, y: 28} m_Pivot: {x: 0.5, y: 0} --- !u!114 &1072219306477523136 MonoBehaviour: @@ -6833,6 +6833,143 @@ MonoBehaviour: m_hasFontAssetChanged: 0 m_baseMaterial: {fileID: 0} m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!1 &6781075134728085312 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7581185522242011757} + - component: {fileID: 5346344779127965657} + - component: {fileID: 6421562785470925488} + m_Layer: 0 + m_Name: Label + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &7581185522242011757 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6781075134728085312} + 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: 6083189955057918944} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: -750, y: -480} + m_SizeDelta: {x: -4, y: 16} + m_Pivot: {x: 0.5, y: 1} +--- !u!222 &5346344779127965657 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6781075134728085312} + m_CullTransparentMesh: 1 +--- !u!114 &6421562785470925488 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6781075134728085312} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: Unity.TextMeshPro::TMPro.TextMeshProUGUI + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: Brush + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 964ae5cd392ba08499b88de012ff8213, type: 2} + m_sharedMaterial: {fileID: 8234806113954670000, guid: 964ae5cd392ba08499b88de012ff8213, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4294967295 + m_fontColor: {r: 1, g: 1, b: 1, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 12 + m_fontSizeBase: 12 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 0 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 512 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_characterHorizontalScale: 1 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_TextWrappingMode: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 0 + m_ActiveFontFeatures: 6e72656b + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_EmojiFallbackSupport: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} --- !u!1 &6789245187076848256 GameObject: m_ObjectHideFlags: 0 @@ -8084,7 +8221,6 @@ GameObject: - component: {fileID: 6083189955057918944} - component: {fileID: 2465517298046866207} - component: {fileID: 8927062139263687560} - - component: {fileID: 5349888407603335066} m_Layer: 0 m_Name: Panel_Paintings m_TagString: Untagged @@ -8105,6 +8241,7 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: - {fileID: 5951404403138721426} + - {fileID: 7581185522242011757} - {fileID: 219926473472726364} - {fileID: 4735173332262603102} m_Father: {fileID: 7387928529902370415} @@ -8152,20 +8289,6 @@ MonoBehaviour: m_FillOrigin: 0 m_UseSpriteMesh: 0 m_PixelsPerUnitMultiplier: 1 ---- !u!114 &5349888407603335066 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 7989106071832098605} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 14b82ffde5db5c547b5f454ac2791815, type: 3} - m_Name: - m_EditorClassIdentifier: Assembly-CSharp::DraggablePanel - target: {fileID: 6083189955057918944} - keepVisible: 48 --- !u!1 &7992086713309035181 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/PaintHud.cs b/Assets/Scripts/PaintHud.cs index a52b9eb..853f398 100644 --- a/Assets/Scripts/PaintHud.cs +++ b/Assets/Scripts/PaintHud.cs @@ -37,12 +37,14 @@ public partial class PaintHud : MonoBehaviour public GameObject layoutPrefab; // Stable widget names shared by the code-gen builder, the baked prefab and the binder. + private const string PanelGeneral = "Panel_General"; private const string PanelSpray = "Panel_Spray"; private const string PanelAlbedo = "Panel_Albedo"; private const string PanelMetallicSmoothness = "Panel_MetallicSmoothness"; private const string PanelOcclusion = "Panel_Occlusion"; private const string PanelEmission = "Panel_Emission"; private const string PanelBrushSize = "Panel_BrushSize"; + private const string PanelPaintings = "Panel_Paintings"; private const string ToggleAlbedo = "Toggle_Albedo"; private const string ToggleMetallicSmoothness = "Toggle_MetallicSmoothness"; private const string ToggleOcclusion = "Toggle_Occlusion"; @@ -79,7 +81,9 @@ public partial class PaintHud : MonoBehaviour PanelOcclusion, PanelEmission, PanelBrushSize, - PanelSpray + PanelSpray, + PanelGeneral, + PanelPaintings }; private GameObject _panel;