Add achievements menu

This commit is contained in:
Norbi Peti 2020-12-07 00:13:41 +01:00
parent a26cd1266e
commit a1d9bab668
No known key found for this signature in database
GPG key ID: DBA4C4549A927E56
9 changed files with 1405 additions and 2 deletions

View file

@ -55,6 +55,7 @@
</Reference> </Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Assets\Scripts\AchievementMenuManager.cs" />
<Compile Include="Assets\Scripts\CameraController.cs" /> <Compile Include="Assets\Scripts\CameraController.cs" />
<Compile Include="Assets\Scripts\CharacterControllerBase.cs" /> <Compile Include="Assets\Scripts\CharacterControllerBase.cs" />
<Compile Include="Assets\Scripts\EnemyController.cs" /> <Compile Include="Assets\Scripts\EnemyController.cs" />

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 4bb306abbbad37820ab637b67f363aeb
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,34 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
public class AchievementMenuManager : MonoBehaviour
{
public Text[] killTexts;
public Text[] levelTexts;
// Start is called before the first frame update
void Start()
{
int kills = PlayerPrefs.GetInt("Kills");
for (int i = 0; i < killTexts.Length; i++)
{
if (kills <= i)
killTexts[i].color = new Color(0.75f, 0.75f, 0.75f);
}
int nextLevel = PlayerPrefs.GetInt("NextLevel");
for (int i = 0; i < levelTexts.Length; i++)
{
if (nextLevel <= i)
levelTexts[i].color = new Color(0.75f, 0.75f, 0.75f);
}
}
public void BackToMenu()
{
SceneManager.LoadScene("Menu");
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: cd52d43dd056296c7958ee9127edc8d7
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -12,6 +12,6 @@ public class MenuHandler : MonoBehaviour
public void Achievements() public void Achievements()
{ {
SceneManager.LoadScene("Achievements");
} }
} }

View file

@ -53,7 +53,7 @@ public class ScoreAndAchievements : MonoBehaviour
else if (_level == 8) else if (_level == 8)
CheckAndDisplayAchievement("NextLevel", 2, "Level 8 completed"); CheckAndDisplayAchievement("NextLevel", 2, "Level 8 completed");
else if (_level == 10) else if (_level == 10)
CheckAndDisplayAchievement("NextLevel", 3, "This is so next level"); CheckAndDisplayAchievement("NextLevel", 3, "10 levels completed");
} }
private void CheckAndDisplayAchievement(string key, int value, string message) private void CheckAndDisplayAchievement(string key, int value, string message)

BIN
Assets/Sprites/boxEmpty.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 755 B

View file

@ -0,0 +1,92 @@
fileFormatVersion: 2
guid: 0f6beedf6bbc01afc951afb3279502b2
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
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
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 13, y: 13, z: 14, w: 18}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant: