Skip to content

Commit

Permalink
Fix score grabbing objects (also ui)
Browse files Browse the repository at this point in the history
Also change deathscreen ui main color to grey
  • Loading branch information
matiaspierpaoli committed Mar 6, 2024
1 parent 4ea1c01 commit 7ea25ce
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
26 changes: 13 additions & 13 deletions Assets/Scenes/Game.unity
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
12 changes: 4 additions & 8 deletions Assets/Scripts/UI/ScoreSpritesManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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()
Expand Down

0 comments on commit 7ea25ce

Please sign in to comment.