TO SQUASH: Show scores at level end.

This commit is contained in:
2026-08-27 14:41:40 -04:00
parent 683cfdcc9f
commit af58cd1cb0
9 changed files with 1577 additions and 58 deletions
+207
View File
@@ -0,0 +1,207 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!128 &12800000
Font:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: 1503
serializedVersion: 5
m_LineSpacing: 15
m_DefaultMaterial: {fileID: 2100000, guid: 969da1d8257c71cfdaac4837a5bbf753, type: 2}
m_FontSize: 15
m_Texture: {fileID: 0}
m_AsciiStartOffset: 0
m_Tracking: 1
m_CharacterSpacing: 0
m_CharacterPadding: 1
m_ConvertCase: 0
m_CharacterRects:
- serializedVersion: 2
index: 48
uv:
serializedVersion: 2
x: 0.010989011
y: 0.05882353
width: 0.08901099
height: 0.88235295
vert:
serializedVersion: 2
x: 0
y: 16
width: 8
height: -15
advance: 8
flipped: 0
- serializedVersion: 2
index: 49
uv:
serializedVersion: 2
x: 0.11098901
y: 0.05882353
width: 0.08901099
height: 0.88235295
vert:
serializedVersion: 2
x: 0
y: 16
width: 8
height: -15
advance: 8
flipped: 0
- serializedVersion: 2
index: 50
uv:
serializedVersion: 2
x: 0.21098901
y: 0.05882353
width: 0.089011
height: 0.88235295
vert:
serializedVersion: 2
x: 0
y: 16
width: 8
height: -15
advance: 8
flipped: 0
- serializedVersion: 2
index: 51
uv:
serializedVersion: 2
x: 0.31098902
y: 0.05882353
width: 0.08901098
height: 0.88235295
vert:
serializedVersion: 2
x: 0
y: 16
width: 8
height: -15
advance: 8
flipped: 0
- serializedVersion: 2
index: 52
uv:
serializedVersion: 2
x: 0.41098902
y: 0.05882353
width: 0.08901098
height: 0.88235295
vert:
serializedVersion: 2
x: 0
y: 16
width: 8
height: -15
advance: 8
flipped: 0
- serializedVersion: 2
index: 53
uv:
serializedVersion: 2
x: 0.510989
y: 0.05882353
width: 0.08901101
height: 0.88235295
vert:
serializedVersion: 2
x: 0
y: 16
width: 8
height: -15
advance: 8
flipped: 0
- serializedVersion: 2
index: 54
uv:
serializedVersion: 2
x: 0.61098903
y: 0.05882353
width: 0.089010954
height: 0.88235295
vert:
serializedVersion: 2
x: 0
y: 16
width: 8
height: -15
advance: 8
flipped: 0
- serializedVersion: 2
index: 55
uv:
serializedVersion: 2
x: 0.710989
y: 0.05882353
width: 0.08901101
height: 0.88235295
vert:
serializedVersion: 2
x: 0
y: 16
width: 8
height: -15
advance: 8
flipped: 0
- serializedVersion: 2
index: 56
uv:
serializedVersion: 2
x: 0.810989
y: 0.05882353
width: 0.08901101
height: 0.88235295
vert:
serializedVersion: 2
x: 0
y: 16
width: 8
height: -15
advance: 8
flipped: 0
- serializedVersion: 2
index: 57
uv:
serializedVersion: 2
x: 0.91098905
y: 0.05882353
width: 0.089010954
height: 0.88235295
vert:
serializedVersion: 2
x: 0
y: 16
width: 8
height: -15
advance: 8
flipped: 0
- serializedVersion: 2
index: 32
uv:
serializedVersion: 2
x: 0
y: 0
width: 0
height: 0
vert:
serializedVersion: 2
x: 0
y: 0
width: 0
height: 0
advance: 8
flipped: 0
m_KerningValues: []
m_PixelScale: 0.1
m_FontData:
m_Ascent: 0
m_Descent: 0
m_DefaultStyle: 0
m_FontNames: []
m_FallbackFonts: []
m_FontRenderingMode: 0
m_UseLegacyBoundsCalculation: 0
m_ShouldRoundAdvanceValue: 1
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 60829745587fffdc6a45c81d74d333ba
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 12800000
userData:
assetBundleName:
assetBundleVariant:
+34
View File
@@ -0,0 +1,34 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: 1503
m_Shader: {fileID: 10750, guid: 0000000000000000f000000000000000, type: 0}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _MainTex:
m_Texture: {fileID: 2800000, guid: c08da50d597caf410a09f7c316bf0dc4, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats: []
m_Colors: []
m_BuildTextureStacks: []
m_AllowLocking: 1
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 969da1d8257c71cfdaac4837a5bbf753
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:
+1005 -3
View File
File diff suppressed because it is too large Load Diff
+103 -1
View File
@@ -1,6 +1,7 @@
using UnityEngine;
using System.Collections;
using UnityEngine.InputSystem;
using UnityEngine.UI;
using System.Collections;
public class LevelEnder : MonoBehaviour
{
@@ -26,6 +27,34 @@ public class LevelEnder : MonoBehaviour
public AudioClip victory;
public AudioClip showBonus;
public AudioClip countBonus;
public AudioClip multiplierBonusSound;
public AudioClip multiplierPenaltySound;
public Text timeBonus;
public Text overachieverBonus;
public Text overachieverPercent;
public Text isolationBonus;
public Text isolationCount;
public Text multiplierBonus;
public Text totalBonus;
public SpriteRenderer overarchieverPercentLabel;
public SpriteRenderer isolationCountSingleLabel;
public SpriteRenderer isolationCountPluralLabel;
private AudioSource audioSource;
private bool levelEnded = false;
@@ -110,9 +139,82 @@ public class LevelEnder : MonoBehaviour
worldFiller.ClearSpawnedWalls();
}
private void ShowBonus(Text bonusText, int bonusValue, int? bonusCount, Text countLabel, SpriteRenderer bonusLabel, AudioClip bonusSound)
{
bonusText.text = $"{bonusValue}";
if (bonusCount.HasValue)
{
countLabel.text = $"{bonusCount.Value}";
}
if (bonusLabel)
{
bonusLabel.enabled = true;
}
audioSource.PlayOneShot(bonusSound);
}
private IEnumerator EndLevelAfterDelay()
{
yield return new WaitForSeconds(victory.length);
EndLevel();
// Wait a moment before showing the bonus tally.
yield return new WaitForSeconds(1.5f);
int total = player.bonus;
ShowBonus(timeBonus, player.bonus, null, null, null, showBonus);
ShowBonus(totalBonus, total, null, null, null, showBonus);
// Calculate and show the overachiever bonus.
yield return new WaitForSeconds(0.75f);
int overachieverBonusCount = 20 - (100 - player.percentCovered);
int overachieverBonusValue = 100 * overachieverBonusCount;
total += overachieverBonusValue;
ShowBonus(
overachieverBonus,
overachieverBonusValue,
overachieverBonusCount,
overachieverPercent,
overarchieverPercentLabel,
showBonus
);
ShowBonus(totalBonus, total, null, null, null, showBonus);
// Calculate and show the isolation bonus.
yield return new WaitForSeconds(0.75f);
int isolationBonusCount = 0;
int isolationBonusValue = 100 * isolationBonusCount;
total += isolationBonusValue;
ShowBonus(
isolationBonus,
isolationBonusValue,
isolationBonusCount,
isolationCount,
isolationBonusCount == 1 ? isolationCountSingleLabel : isolationCountPluralLabel,
showBonus
);
ShowBonus(totalBonus, total, null, null, null, showBonus);
// Calculate and show the multiplier bonus if applicable.
if (player.multiplier != 1.0f)
{
yield return new WaitForSeconds(0.75f);
int multiplierValue = player.multiplier == 0.5f ? 1 : (int)(player.multiplier);
total = (int)(total * player.multiplier);
ShowBonus(
multiplierBonus,
multiplierValue,
null,
null,
null,
multiplierValue == 1 ? multiplierPenaltySound : multiplierBonusSound
);
ShowBonus(totalBonus, total, null, null, null, showBonus);
}
}
}
+56 -54
View File
@@ -51,7 +51,7 @@ TextureImporter:
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
isReadable: 1
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
@@ -64,7 +64,7 @@ TextureImporter:
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
filterMode: 0
aniso: 1
mipBias: 0
wrapU: 1
@@ -143,12 +143,12 @@ TextureImporter:
name: 1503_0
rect:
serializedVersion: 2
x: 0
y: 0
width: 10
height: 17
x: 1
y: 1
width: 8
height: 15
alignment: 0
pivot: {x: 0, y: 0}
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
customData:
outline: []
@@ -165,12 +165,12 @@ TextureImporter:
name: 1503_1
rect:
serializedVersion: 2
x: 9
y: 0
width: 10
height: 17
x: 10
y: 1
width: 8
height: 15
alignment: 0
pivot: {x: 0, y: 0}
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
customData:
outline: []
@@ -187,12 +187,12 @@ TextureImporter:
name: 1503_2
rect:
serializedVersion: 2
x: 18
y: 0
width: 10
height: 17
x: 19
y: 1
width: 8
height: 15
alignment: 0
pivot: {x: 0, y: 0}
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
customData:
outline: []
@@ -209,12 +209,12 @@ TextureImporter:
name: 1503_3
rect:
serializedVersion: 2
x: 27
y: 0
width: 10
height: 17
x: 28
y: 1
width: 8
height: 15
alignment: 0
pivot: {x: 0, y: 0}
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
customData:
outline: []
@@ -231,12 +231,12 @@ TextureImporter:
name: 1503_4
rect:
serializedVersion: 2
x: 36
y: 0
width: 10
height: 17
x: 37
y: 1
width: 8
height: 15
alignment: 0
pivot: {x: 0, y: 0}
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
customData:
outline: []
@@ -253,12 +253,12 @@ TextureImporter:
name: 1503_5
rect:
serializedVersion: 2
x: 45
y: 0
width: 10
height: 17
x: 46
y: 1
width: 8
height: 15
alignment: 0
pivot: {x: 0, y: 0}
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
customData:
outline: []
@@ -275,12 +275,12 @@ TextureImporter:
name: 1503_6
rect:
serializedVersion: 2
x: 54
y: 0
width: 10
height: 17
x: 55
y: 1
width: 8
height: 15
alignment: 0
pivot: {x: 0, y: 0}
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
customData:
outline: []
@@ -297,12 +297,12 @@ TextureImporter:
name: 1503_7
rect:
serializedVersion: 2
x: 63
y: 0
width: 10
height: 17
x: 64
y: 1
width: 8
height: 15
alignment: 0
pivot: {x: 0, y: 0}
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
customData:
outline: []
@@ -319,12 +319,12 @@ TextureImporter:
name: 1503_8
rect:
serializedVersion: 2
x: 72
y: 0
width: 10
height: 17
x: 73
y: 1
width: 8
height: 15
alignment: 0
pivot: {x: 0, y: 0}
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
customData:
outline: []
@@ -341,12 +341,12 @@ TextureImporter:
name: 1503_9
rect:
serializedVersion: 2
x: 81
y: 0
width: 10
height: 17
x: 82
y: 1
width: 8
height: 15
alignment: 0
pivot: {x: 0, y: 0}
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
customData:
outline: []
@@ -363,7 +363,7 @@ TextureImporter:
customData:
physicsShape: []
bones: []
spriteID:
spriteID: 0c296ecb0dcc71f5496e9dd5bb4ff1d6
internalID: 0
vertices: []
indices:
@@ -371,7 +371,9 @@ TextureImporter:
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
entries:
- key: SpriteEditor.SliceSettings
value: '{"sliceOnImport":false,"gridCellCount":{"x":1.0,"y":1.0},"gridSpriteSize":{"x":64.0,"y":64.0},"gridSpriteOffset":{"x":0.0,"y":0.0},"gridSpritePadding":{"x":0.0,"y":0.0},"pivot":{"x":0.5,"y":0.5},"pivotPixels":{"x":0.0,"y":0.0},"autoSlicingMethod":0,"spriteAlignment":0,"pivotUnitMode":0,"slicingType":0,"keepEmptyRects":false,"isAlternate":false}'
nameFileIdTable:
1503_0: -83575772905081990
1503_1: 8532075444134047153
Binary file not shown.

After

Width:  |  Height:  |  Size: 505 B

+156
View File
@@ -0,0 +1,156 @@
fileFormatVersion: 2
guid: c152ced96eddb7f00983a72e21ce138b
TextureImporter:
internalIDToNameTable:
- first:
213: -8884437357601248537
second: 508_2_0
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 2
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites:
- serializedVersion: 2
name: 508_2_0
rect:
serializedVersion: 2
x: 0
y: 0
width: 27
height: 13
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
customData:
outline: []
physicsShape: []
tessellationDetail: -1
bones: []
spriteID: 7eaa7f68b4324b480800000000000000
internalID: -8884437357601248537
vertices: []
indices:
edges: []
weights: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable:
508_2_0: -8884437357601248537
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant: