From 7ea25cec132b0fe41f7eaa806a5589a8a65038b0 Mon Sep 17 00:00:00 2001 From: matiaspierpaoli Date: Tue, 5 Mar 2024 23:33:35 -0300 Subject: [PATCH] Fix score grabbing objects (also ui) Also change deathscreen ui main color to grey --- .../Terrain/Grid_synth 2.mat | 2 +- .../Synthwave Material/Terrain/Grid_synth.mat | 2 +- Assets/Scenes/Game.unity | 26 +++++++++---------- Assets/Scripts/UI/ScoreSpritesManager.cs | 12 +++------ 4 files changed, 19 insertions(+), 23 deletions(-) diff --git a/Assets/ART/Material/Synthwave Material/Terrain/Grid_synth 2.mat b/Assets/ART/Material/Synthwave Material/Terrain/Grid_synth 2.mat index 7b7ebaf9..dea5ac5d 100644 --- a/Assets/ART/Material/Synthwave Material/Terrain/Grid_synth 2.mat +++ b/Assets/ART/Material/Synthwave Material/Terrain/Grid_synth 2.mat @@ -47,7 +47,7 @@ Material: - _MainTex: m_Texture: {fileID: 2800000, guid: 21eaf55ddaa3f874f8a025251d4443cd, type: 3} m_Scale: {x: -50, y: -50} - m_Offset: {x: -31.738422, y: 0} + m_Offset: {x: -54.365314, y: 0} - _MetallicGlossMap: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} diff --git a/Assets/ART/Material/Synthwave Material/Terrain/Grid_synth.mat b/Assets/ART/Material/Synthwave Material/Terrain/Grid_synth.mat index 8cd974ad..87747ed2 100644 --- a/Assets/ART/Material/Synthwave Material/Terrain/Grid_synth.mat +++ b/Assets/ART/Material/Synthwave Material/Terrain/Grid_synth.mat @@ -47,7 +47,7 @@ Material: - _MainTex: m_Texture: {fileID: 2800000, guid: 21eaf55ddaa3f874f8a025251d4443cd, type: 3} m_Scale: {x: -10, y: -10} - m_Offset: {x: 0, y: 63.476845} + m_Offset: {x: 0, y: 1.1350356} - _MetallicGlossMap: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} diff --git a/Assets/Scenes/Game.unity b/Assets/Scenes/Game.unity index 130e7094..a9c2d14b 100644 --- a/Assets/Scenes/Game.unity +++ b/Assets/Scenes/Game.unity @@ -724,7 +724,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} + m_Color: {r: 0.6509434, g: 0.6509434, b: 0.6509434, a: 1} m_RaycastTarget: 1 m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_Maskable: 1 @@ -2307,8 +2307,8 @@ MonoBehaviour: m_fontMaterials: [] m_fontColor32: serializedVersion: 2 - rgba: 4294967295 - m_fontColor: {r: 1, g: 1, b: 1, a: 1} + rgba: 4286874756 + m_fontColor: {r: 0.5188679, g: 0.5188679, b: 0.5188679, a: 1} m_enableVertexGradient: 0 m_colorMode: 3 m_fontColorGradient: @@ -3538,7 +3538,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} + m_Color: {r: 0.5660378, g: 0.5660378, b: 0.5660378, a: 1} m_RaycastTarget: 1 m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_Maskable: 1 @@ -3613,7 +3613,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} + m_Color: {r: 0.5660378, g: 0.5660378, b: 0.5660378, a: 1} m_RaycastTarget: 1 m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_Maskable: 1 @@ -4892,8 +4892,8 @@ MonoBehaviour: m_fontMaterials: [] m_fontColor32: serializedVersion: 2 - rgba: 4294967295 - m_fontColor: {r: 1, g: 1, b: 1, a: 1} + rgba: 4286874756 + m_fontColor: {r: 0.5188679, g: 0.5188679, b: 0.5188679, a: 1} m_enableVertexGradient: 0 m_colorMode: 3 m_fontColorGradient: @@ -6972,7 +6972,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} + m_Color: {r: 0.5660378, g: 0.5660378, b: 0.5660378, a: 1} m_RaycastTarget: 1 m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_Maskable: 1 @@ -7885,7 +7885,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} + m_Color: {r: 0.5660378, g: 0.5660378, b: 0.5660378, a: 1} m_RaycastTarget: 1 m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_Maskable: 1 @@ -13963,8 +13963,8 @@ MonoBehaviour: m_fontMaterials: [] m_fontColor32: serializedVersion: 2 - rgba: 4294967295 - m_fontColor: {r: 1, g: 1, b: 1, a: 1} + rgba: 4286874756 + m_fontColor: {r: 0.5188679, g: 0.5188679, b: 0.5188679, a: 1} m_enableVertexGradient: 0 m_colorMode: 3 m_fontColorGradient: @@ -17662,8 +17662,8 @@ MonoBehaviour: m_fontMaterials: [] m_fontColor32: serializedVersion: 2 - rgba: 4294967295 - m_fontColor: {r: 1, g: 1, b: 1, a: 1} + rgba: 4286874756 + m_fontColor: {r: 0.5188679, g: 0.5188679, b: 0.5188679, a: 1} m_enableVertexGradient: 0 m_colorMode: 3 m_fontColorGradient: diff --git a/Assets/Scripts/UI/ScoreSpritesManager.cs b/Assets/Scripts/UI/ScoreSpritesManager.cs index 03f15966..80ab9afa 100644 --- a/Assets/Scripts/UI/ScoreSpritesManager.cs +++ b/Assets/Scripts/UI/ScoreSpritesManager.cs @@ -70,8 +70,7 @@ private void ChangeScoreSprite() for (int i = 0; i < scoreObjectsParents.Length; i++) { - //if (currentObjectsCollected < maxObjects) - //{ + GameObject childObject = scoreObjectsParents[i].transform.GetChild(currentObjectsCollected).gameObject; if (childObject.activeInHierarchy) @@ -80,24 +79,21 @@ private void ChangeScoreSprite() if (scoreSprite != null) { - //lastCollectedIndex++; scoreSprite.ChangeToFilledSprite(); if (currentObjectsCollected < portalAnimatorPreviousTriggerNames.Length) { portalAnimatorPreviousTriggerSteps++; - if (portalAnimatorPreviousTriggerSteps > maxObjects) portalAnimatorPreviousTriggerSteps = currentObjectsCollected; - portalAnimator.SetTrigger(portalAnimatorPreviousTriggerNames[portalAnimatorPreviousTriggerSteps - 1]); + if (portalAnimatorPreviousTriggerSteps >= maxObjects) portalAnimatorPreviousTriggerSteps = currentObjectsCollected; + portalAnimator.SetTrigger(portalAnimatorPreviousTriggerNames[portalAnimatorPreviousTriggerSteps]); } - if (currentObjectsCollected == maxObjects) + if (currentObjectsCollected == maxObjects - 1) portalAnimator.SetBool(portalBoolPhasesFinishedName, true); } } - //} } } - } private void ChangeScoreSpriteInfected()