Browse Source

Win Lose canvas and sound

master
NickFowler 4 years ago
parent
commit
5d30b14826
13 changed files with 763 additions and 1074 deletions
  1. +3
    -0
      Assets/Audio/SledgeHammerRFirst.wav
  2. +22
    -0
      Assets/Audio/SledgeHammerRFirst.wav.meta
  3. +3
    -0
      Assets/Audio/successtrumpets.wav
  4. +22
    -0
      Assets/Audio/successtrumpets.wav.meta
  5. +3
    -0
      Assets/Audio/wagna__failfare.wav
  6. +22
    -0
      Assets/Audio/wagna__failfare.wav.meta
  7. +8
    -0
      Assets/Images.meta
  8. +3
    -0
      Assets/Images/Congrats.png
  9. +91
    -0
      Assets/Images/Congrats.png.meta
  10. +3
    -0
      Assets/Images/fail.png
  11. +91
    -0
      Assets/Images/fail.png.meta
  12. +454
    -1072
      Assets/Scenes/CaseyTest.unity
  13. +38
    -2
      Assets/Scripts/Gameplay/GameStateController.cs

+ 3
- 0
Assets/Audio/SledgeHammerRFirst.wav View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1bb42acdfd4f4210e4fb5c7cc592bed83cd163d3f4ae5053bda81a2f7eebe448
size 713138

+ 22
- 0
Assets/Audio/SledgeHammerRFirst.wav.meta View File

@ -0,0 +1,22 @@
fileFormatVersion: 2
guid: e6b9eeb9ed862bd4084ef9c8a782efff
AudioImporter:
externalObjects: {}
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:

+ 3
- 0
Assets/Audio/successtrumpets.wav View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7c5b1ba6b03679a18a32a6b0db40b0dad5eca633aeb43c11e50abc845c423647
size 792620

+ 22
- 0
Assets/Audio/successtrumpets.wav.meta View File

@ -0,0 +1,22 @@
fileFormatVersion: 2
guid: 145fa61d50199b747bc82979d8e95381
AudioImporter:
externalObjects: {}
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:

+ 3
- 0
Assets/Audio/wagna__failfare.wav View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:60339a05db179a5c39b55dfc1b735c8ec27df6ab87b6cfe31fe5c2030075cc57
size 553004

+ 22
- 0
Assets/Audio/wagna__failfare.wav.meta View File

@ -0,0 +1,22 @@
fileFormatVersion: 2
guid: c9d999063b1e92b4494d31998bc7b051
AudioImporter:
externalObjects: {}
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:

+ 8
- 0
Assets/Images.meta View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 418242d5edde6b64ca4a0a7522c4bd2b
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

+ 3
- 0
Assets/Images/Congrats.png View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7eeb55306e6af4d7af48f7a550632618eff4495e2f7ae6377225ef2942772f57
size 84713

+ 91
- 0
Assets/Images/Congrats.png.meta View File

@ -0,0 +1,91 @@
fileFormatVersion: 2
guid: 10dbd8a0a51a50e498bd056ec0e1ded6
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 10
mipmaps:
mipMapMode: 0
enableMipMap: 1
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: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
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: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 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:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

+ 3
- 0
Assets/Images/fail.png View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:bdd53766a89e76d7103d92fae0d790991c52f40bb8b162eb882818e8083a9dfe
size 78263

+ 91
- 0
Assets/Images/fail.png.meta View File

@ -0,0 +1,91 @@
fileFormatVersion: 2
guid: f8a18ae9f3d216e41b6dcdffc38ddf41
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 10
mipmaps:
mipMapMode: 0
enableMipMap: 1
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: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
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: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 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:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

+ 454
- 1072
Assets/Scenes/CaseyTest.unity
File diff suppressed because it is too large
View File


+ 38
- 2
Assets/Scripts/Gameplay/GameStateController.cs View File

@ -1,23 +1,59 @@
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using JetBrains.Annotations;
using UnityEngine; using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
public class GameStateController : MonoBehaviour public class GameStateController : MonoBehaviour
{ {
public Canvas WinLose;
public GameObject WinText;
public GameObject LoseText;
public AudioClip WinClip;
public AudioClip LoseClip;
public AudioSource source;
// Start is called before the first frame update // Start is called before the first frame update
void Start() void Start()
{ {
source = GetComponent<AudioSource>();
} }
public void WinState() public void WinState()
{ {
Debug.Log("You win!");
source.clip = WinClip;
source.Play();
StartCoroutine(FadeImage(WinLose.GetComponentInChildren<Image>()));
WinText.SetActive(true);
StartCoroutine(WaitForLoadOut());
SceneManager.LoadScene(0);
} }
public void LoseState() public void LoseState()
{ {
Debug.Log("You lose!");
source.clip = LoseClip;
source.Play();
StartCoroutine(FadeImage(WinLose.GetComponentInChildren<Image>()));
LoseText.SetActive(true);
StartCoroutine(WaitForLoadOut());
SceneManager.LoadScene(0);
}
public IEnumerator FadeImage(Image img)
{
for (float i = 0; i <= 1; i += Time.deltaTime)
{
img.color = new Color(0, 0, 0, i);
yield return null;
}
}
public IEnumerator WaitForLoadOut()
{
yield return new WaitForSeconds(5.0f);
} }
// Update is called once per frame // Update is called once per frame

Loading…
Cancel
Save