Josh
2 years ago
14 changed files with 5559 additions and 43 deletions
@ -0,0 +1,28 @@ |
|||||
|
using System.Collections; |
||||
|
using System.Collections.Generic; |
||||
|
using UnityEngine; |
||||
|
|
||||
|
public class Gummy : MonoBehaviour |
||||
|
{ |
||||
|
float _timeToFlip = 0f; |
||||
|
|
||||
|
// Start is called before the first frame update
|
||||
|
void Start() |
||||
|
{ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
// Update is called once per frame
|
||||
|
void Update() |
||||
|
{ |
||||
|
_timeToFlip -= Time.deltaTime; |
||||
|
|
||||
|
|
||||
|
if (_timeToFlip < 0f) |
||||
|
{ |
||||
|
transform.localScale = new Vector3(transform.localScale.x * -1f, transform.localScale.y, transform.localScale.z); |
||||
|
_timeToFlip = .1f; |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,11 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: dd19b62300c7bfa4896ed0b8fd20c288 |
||||
|
MonoImporter: |
||||
|
externalObjects: {} |
||||
|
serializedVersion: 2 |
||||
|
defaultReferences: [] |
||||
|
executionOrder: 0 |
||||
|
icon: {instanceID: 0} |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
@ -0,0 +1,141 @@ |
|||||
|
%YAML 1.1 |
||||
|
%TAG !u! tag:unity3d.com,2011: |
||||
|
--- !u!1 &2355887706657292512 |
||||
|
GameObject: |
||||
|
m_ObjectHideFlags: 0 |
||||
|
m_CorrespondingSourceObject: {fileID: 0} |
||||
|
m_PrefabInstance: {fileID: 0} |
||||
|
m_PrefabAsset: {fileID: 0} |
||||
|
serializedVersion: 6 |
||||
|
m_Component: |
||||
|
- component: {fileID: 2355887706657292524} |
||||
|
- component: {fileID: 2355887706657292515} |
||||
|
- component: {fileID: 2355887706657292514} |
||||
|
- component: {fileID: 2355887706657292513} |
||||
|
- component: {fileID: 2355887706657292525} |
||||
|
- component: {fileID: 180079069927992777} |
||||
|
m_Layer: 0 |
||||
|
m_Name: Gummy Prefab |
||||
|
m_TagString: Untagged |
||||
|
m_Icon: {fileID: 0} |
||||
|
m_NavMeshLayer: 0 |
||||
|
m_StaticEditorFlags: 0 |
||||
|
m_IsActive: 1 |
||||
|
--- !u!4 &2355887706657292524 |
||||
|
Transform: |
||||
|
m_ObjectHideFlags: 0 |
||||
|
m_CorrespondingSourceObject: {fileID: 0} |
||||
|
m_PrefabInstance: {fileID: 0} |
||||
|
m_PrefabAsset: {fileID: 0} |
||||
|
m_GameObject: {fileID: 2355887706657292512} |
||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} |
||||
|
m_LocalPosition: {x: 833.31, y: 809.7, z: -9.3} |
||||
|
m_LocalScale: {x: 0.38822, y: 0.38822, z: 0.38822} |
||||
|
m_Children: [] |
||||
|
m_Father: {fileID: 0} |
||||
|
m_RootOrder: 0 |
||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} |
||||
|
--- !u!212 &2355887706657292515 |
||||
|
SpriteRenderer: |
||||
|
m_ObjectHideFlags: 0 |
||||
|
m_CorrespondingSourceObject: {fileID: 0} |
||||
|
m_PrefabInstance: {fileID: 0} |
||||
|
m_PrefabAsset: {fileID: 0} |
||||
|
m_GameObject: {fileID: 2355887706657292512} |
||||
|
m_Enabled: 1 |
||||
|
m_CastShadows: 0 |
||||
|
m_ReceiveShadows: 0 |
||||
|
m_DynamicOccludee: 1 |
||||
|
m_MotionVectors: 1 |
||||
|
m_LightProbeUsage: 1 |
||||
|
m_ReflectionProbeUsage: 1 |
||||
|
m_RayTracingMode: 0 |
||||
|
m_RayTraceProcedural: 0 |
||||
|
m_RenderingLayerMask: 1 |
||||
|
m_RendererPriority: 0 |
||||
|
m_Materials: |
||||
|
- {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} |
||||
|
m_StaticBatchInfo: |
||||
|
firstSubMesh: 0 |
||||
|
subMeshCount: 0 |
||||
|
m_StaticBatchRoot: {fileID: 0} |
||||
|
m_ProbeAnchor: {fileID: 0} |
||||
|
m_LightProbeVolumeOverride: {fileID: 0} |
||||
|
m_ScaleInLightmap: 1 |
||||
|
m_ReceiveGI: 1 |
||||
|
m_PreserveUVs: 0 |
||||
|
m_IgnoreNormalsForChartDetection: 0 |
||||
|
m_ImportantGI: 0 |
||||
|
m_StitchLightmapSeams: 1 |
||||
|
m_SelectedEditorRenderState: 0 |
||||
|
m_MinimumChartSize: 4 |
||||
|
m_AutoUVMaxDistance: 0.5 |
||||
|
m_AutoUVMaxAngle: 89 |
||||
|
m_LightmapParameters: {fileID: 0} |
||||
|
m_SortingLayerID: 0 |
||||
|
m_SortingLayer: 0 |
||||
|
m_SortingOrder: 0 |
||||
|
m_Sprite: {fileID: 21300000, guid: d6c3531494da6b64fba26dea94bc6098, type: 3} |
||||
|
m_Color: {r: 1, g: 1, b: 1, a: 1} |
||||
|
m_FlipX: 0 |
||||
|
m_FlipY: 0 |
||||
|
m_DrawMode: 0 |
||||
|
m_Size: {x: 160, y: 218} |
||||
|
m_AdaptiveModeThreshold: 0.5 |
||||
|
m_SpriteTileMode: 0 |
||||
|
m_WasSpriteAssigned: 1 |
||||
|
m_MaskInteraction: 0 |
||||
|
m_SpriteSortPoint: 0 |
||||
|
--- !u!58 &2355887706657292514 |
||||
|
CircleCollider2D: |
||||
|
m_ObjectHideFlags: 0 |
||||
|
m_CorrespondingSourceObject: {fileID: 0} |
||||
|
m_PrefabInstance: {fileID: 0} |
||||
|
m_PrefabAsset: {fileID: 0} |
||||
|
m_GameObject: {fileID: 2355887706657292512} |
||||
|
m_Enabled: 1 |
||||
|
m_Density: 1 |
||||
|
m_Material: {fileID: 0} |
||||
|
m_IsTrigger: 1 |
||||
|
m_UsedByEffector: 0 |
||||
|
m_UsedByComposite: 0 |
||||
|
m_Offset: {x: 0, y: 0} |
||||
|
serializedVersion: 2 |
||||
|
m_Radius: 109 |
||||
|
--- !u!114 &2355887706657292513 |
||||
|
MonoBehaviour: |
||||
|
m_ObjectHideFlags: 0 |
||||
|
m_CorrespondingSourceObject: {fileID: 0} |
||||
|
m_PrefabInstance: {fileID: 0} |
||||
|
m_PrefabAsset: {fileID: 0} |
||||
|
m_GameObject: {fileID: 2355887706657292512} |
||||
|
m_Enabled: 1 |
||||
|
m_EditorHideFlags: 0 |
||||
|
m_Script: {fileID: 11500000, guid: 02d335f1af9cc3e47837750dc736c2ba, type: 3} |
||||
|
m_Name: |
||||
|
m_EditorClassIdentifier: |
||||
|
--- !u!114 &2355887706657292525 |
||||
|
MonoBehaviour: |
||||
|
m_ObjectHideFlags: 0 |
||||
|
m_CorrespondingSourceObject: {fileID: 0} |
||||
|
m_PrefabInstance: {fileID: 0} |
||||
|
m_PrefabAsset: {fileID: 0} |
||||
|
m_GameObject: {fileID: 2355887706657292512} |
||||
|
m_Enabled: 1 |
||||
|
m_EditorHideFlags: 0 |
||||
|
m_Script: {fileID: 11500000, guid: 37dfc580ad57d894caaababe502afb5b, type: 3} |
||||
|
m_Name: |
||||
|
m_EditorClassIdentifier: |
||||
|
_useWorldSpace: 0 |
||||
|
--- !u!114 &180079069927992777 |
||||
|
MonoBehaviour: |
||||
|
m_ObjectHideFlags: 0 |
||||
|
m_CorrespondingSourceObject: {fileID: 0} |
||||
|
m_PrefabInstance: {fileID: 0} |
||||
|
m_PrefabAsset: {fileID: 0} |
||||
|
m_GameObject: {fileID: 2355887706657292512} |
||||
|
m_Enabled: 1 |
||||
|
m_EditorHideFlags: 0 |
||||
|
m_Script: {fileID: 11500000, guid: dd19b62300c7bfa4896ed0b8fd20c288, type: 3} |
||||
|
m_Name: |
||||
|
m_EditorClassIdentifier: |
@ -0,0 +1,7 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: 2d5ddcf9e0fe6dc4c9d3a05fc8c6b30b |
||||
|
PrefabImporter: |
||||
|
externalObjects: {} |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
File diff suppressed because it is too large
@ -0,0 +1,7 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: 874d922a3df5d554382cd48cecf69a47 |
||||
|
DefaultImporter: |
||||
|
externalObjects: {} |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
@ -0,0 +1,87 @@ |
|||||
|
using System.Collections; |
||||
|
using System.Collections.Generic; |
||||
|
using UnityEngine; |
||||
|
using UnityEngine.SceneManagement; |
||||
|
using UnityEngine.UI; |
||||
|
|
||||
|
public class ChallengingStage : Level |
||||
|
{ |
||||
|
[SerializeField] Text Timer; |
||||
|
[SerializeField] Text Title; |
||||
|
[SerializeField] Text Subtitle; |
||||
|
[SerializeField] Canvas _canvas; |
||||
|
[SerializeField] GameObject _gummyPrefab; |
||||
|
|
||||
|
int _seconds = 10; |
||||
|
int _originalFontSize; |
||||
|
// Start is called before the first frame update
|
||||
|
void Start() |
||||
|
{ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
private void Awake() |
||||
|
{ |
||||
|
base.Awake(); |
||||
|
_originalFontSize = Timer.fontSize; |
||||
|
|
||||
|
SpawnGummy(); |
||||
|
StartCoroutine("StartupProcess"); |
||||
|
} |
||||
|
|
||||
|
IEnumerator StartupProcess() |
||||
|
{ |
||||
|
ActivatePlayers(false); |
||||
|
Title.gameObject.SetActive(true); |
||||
|
Subtitle.gameObject.SetActive(false); |
||||
|
yield return new WaitForSeconds(1f); |
||||
|
Subtitle.gameObject.SetActive(true); |
||||
|
yield return new WaitForSeconds(2f); |
||||
|
Subtitle.gameObject.SetActive(false); |
||||
|
Title.gameObject.SetActive(true); |
||||
|
Title.text = "GO!"; |
||||
|
ActivatePlayers(true); |
||||
|
yield return new WaitForSeconds(1f); |
||||
|
Title.gameObject.SetActive(false); |
||||
|
Subtitle.gameObject.SetActive(false); |
||||
|
StartCoroutine(Countdown()); |
||||
|
} |
||||
|
|
||||
|
// Update is called once per frame
|
||||
|
void Update() |
||||
|
{ |
||||
|
|
||||
|
} |
||||
|
IEnumerator Countdown() |
||||
|
{ |
||||
|
while (_seconds > 0) |
||||
|
{ |
||||
|
_seconds--; |
||||
|
Timer.text = _seconds.ToString(); |
||||
|
if (_seconds < 10) |
||||
|
{ |
||||
|
Timer.color = Color.red; |
||||
|
Timer.fontSize = _originalFontSize + 50; |
||||
|
} |
||||
|
yield return new WaitForSeconds(1f); |
||||
|
} |
||||
|
|
||||
|
Timer.text = "TIME'S UP!"; |
||||
|
Timer.fontSize = _originalFontSize + 70; |
||||
|
Game.Paused = true; |
||||
|
yield return new WaitForSeconds(2.5f); |
||||
|
Game.Paused = false; |
||||
|
SceneManager.LoadScene("TopicSelect"); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
void SpawnGummy() |
||||
|
{ |
||||
|
GameObject powerup = Instantiate(_gummyPrefab); |
||||
|
powerup.transform.parent = _canvas.gameObject.transform; |
||||
|
powerup.transform.position = new Vector3(Random.Range(100f, 1920f-100f), Random.Range(100f, 1080f - 100f), powerup.transform.position.z); |
||||
|
|
||||
|
Invoke("SpawnGummy", Random.Range(0, 2f - (_seconds * .1f))); |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,11 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: 41ab2f3d89b1fa74d93e3d740bcb781b |
||||
|
MonoImporter: |
||||
|
externalObjects: {} |
||||
|
serializedVersion: 2 |
||||
|
defaultReferences: [] |
||||
|
executionOrder: 0 |
||||
|
icon: {instanceID: 0} |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
Loading…
Reference in new issue