Josh
1 year ago
15 changed files with 6188 additions and 142 deletions
File diff suppressed because it is too large
@ -0,0 +1,7 @@ |
|||
fileFormatVersion: 2 |
|||
guid: c47ffd3450f93bd488df38f9f870218d |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
@ -0,0 +1,74 @@ |
|||
using System.Collections; |
|||
using System.Collections.Generic; |
|||
using UnityEngine; |
|||
|
|||
public class RedLightGreenLight : Level |
|||
{ |
|||
[SerializeField] SpriteRenderer _background; |
|||
[SerializeField] UnityEngine.UI.Text _redLightGreenLightText; |
|||
enum StopLight |
|||
{ |
|||
GREEN, |
|||
YELLOW, |
|||
RED |
|||
} |
|||
StopLight _stopLight; |
|||
|
|||
// Start is called before the first frame update
|
|||
void Start() |
|||
{ |
|||
_stopLight = StopLight.YELLOW; |
|||
ToggleColor(); |
|||
} |
|||
|
|||
// Update is called once per frame
|
|||
void Update() |
|||
{ |
|||
foreach (GameObject player in _players) |
|||
{ |
|||
//player.GetComponent<Player>().SetName(Mathf.Round(player.GetComponent<Player>()._lastVelocityMagnitudeAdded).ToString());
|
|||
if (_stopLight == StopLight.RED) |
|||
{ |
|||
if (player.GetComponent<Player>()._lastVelocityMagnitudeAdded > 10.0f) |
|||
{ |
|||
player.GetComponent<Player>().ResetToOriginalPosition(); |
|||
_redLightGreenLightText.text = "RED LIGHT\nBUSTED!"; |
|||
//player.GetComponent<Player>().SetName(player.GetComponent<Rigidbody2D>().velocity.magnitude.ToString());
|
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
void ToggleColor() |
|||
{ |
|||
if (_stopLight == StopLight.GREEN) |
|||
_stopLight = StopLight.YELLOW; |
|||
else if (_stopLight == StopLight.YELLOW) |
|||
_stopLight = StopLight.RED; |
|||
else if (_stopLight == StopLight.RED) |
|||
_stopLight = StopLight.GREEN; |
|||
|
|||
float length; |
|||
|
|||
if (_stopLight == StopLight.RED) |
|||
{ |
|||
_redLightGreenLightText.text = "RED LIGHT"; |
|||
_background.color = Color.red; |
|||
length = Random.Range(0.5f, 5f); |
|||
} |
|||
else if (_stopLight == StopLight.GREEN) |
|||
{ |
|||
_redLightGreenLightText.text = "GREEN LIGHT"; |
|||
_background.color = Color.green; |
|||
length = Random.Range(0.5f, 3f); |
|||
} |
|||
else // (_stopLight == StopLight.YELLOW)
|
|||
{ |
|||
_redLightGreenLightText.text = ""; |
|||
_background.color = Color.yellow; |
|||
length = Random.Range(0.5f, 1f); |
|||
} |
|||
|
|||
Invoke("ToggleColor", length); |
|||
} |
|||
} |
@ -0,0 +1,11 @@ |
|||
fileFormatVersion: 2 |
|||
guid: 4385003586d735f459725f86bc206410 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
After Width: | Height: | Size: 32 KiB |
@ -0,0 +1,123 @@ |
|||
fileFormatVersion: 2 |
|||
guid: bbc37636b347510438c5d26ddd145167 |
|||
TextureImporter: |
|||
internalIDToNameTable: [] |
|||
externalObjects: {} |
|||
serializedVersion: 12 |
|||
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 |
|||
vTOnly: 0 |
|||
ignoreMasterTextureLimit: 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: 1 |
|||
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 |
|||
cookieLightType: 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 |
|||
- serializedVersion: 3 |
|||
buildTarget: Standalone |
|||
maxTextureSize: 2048 |
|||
resizeAlgorithm: 0 |
|||
textureFormat: -1 |
|||
textureCompression: 1 |
|||
compressionQuality: 50 |
|||
crunchedCompression: 0 |
|||
allowsAlphaSplitting: 0 |
|||
overridden: 0 |
|||
androidETC2FallbackOverride: 0 |
|||
forceMaximumCompressionQuality_BC6H_BC7: 0 |
|||
- serializedVersion: 3 |
|||
buildTarget: Server |
|||
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: [] |
|||
nameFileIdTable: {} |
|||
spritePackingTag: |
|||
pSDRemoveMatte: 0 |
|||
pSDShowRemoveMatteOption: 0 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
Loading…
Reference in new issue