init
This commit is contained in:
commit
9afd57306d
323 changed files with 204673 additions and 0 deletions
129
Assets/Scripts/Enemy.prefab
Normal file
129
Assets/Scripts/Enemy.prefab
Normal file
|
@ -0,0 +1,129 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &7457347100279815265
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 7457347100279815276}
|
||||
- component: {fileID: 7457347100279815279}
|
||||
- component: {fileID: 7457347100279815278}
|
||||
- component: {fileID: 2133386424829156613}
|
||||
m_Layer: 0
|
||||
m_Name: Enemy
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &7457347100279815276
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7457347100279815265}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: -1, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1.3, y: 1.3, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!212 &7457347100279815279
|
||||
SpriteRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7457347100279815265}
|
||||
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_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: 4ea1119fa485f29458c6e3bb4488a4eb, type: 3}
|
||||
m_Color: {r: 1, g: 0.04705883, b: 0, a: 1}
|
||||
m_FlipX: 0
|
||||
m_FlipY: 0
|
||||
m_DrawMode: 0
|
||||
m_Size: {x: 1, y: 1}
|
||||
m_AdaptiveModeThreshold: 0.5
|
||||
m_SpriteTileMode: 0
|
||||
m_WasSpriteAssigned: 1
|
||||
m_MaskInteraction: 0
|
||||
m_SpriteSortPoint: 0
|
||||
--- !u!60 &7457347100279815278
|
||||
PolygonCollider2D:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7457347100279815265}
|
||||
m_Enabled: 1
|
||||
m_Density: 1
|
||||
m_Material: {fileID: 0}
|
||||
m_IsTrigger: 0
|
||||
m_UsedByEffector: 0
|
||||
m_UsedByComposite: 0
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_SpriteTilingProperty:
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
oldSize: {x: 1, y: 1}
|
||||
newSize: {x: 1, y: 1}
|
||||
adaptiveTilingThreshold: 0.5
|
||||
drawMode: 0
|
||||
adaptiveTiling: 0
|
||||
m_AutoTiling: 0
|
||||
m_Points:
|
||||
m_Paths:
|
||||
- - {x: 0, y: 0.5}
|
||||
- {x: -0.43301272, y: 0.24999999}
|
||||
- {x: -0.4330127, y: -0.25000003}
|
||||
- {x: 0.00000004371139, y: -0.5}
|
||||
- {x: 0.43301272, y: -0.24999996}
|
||||
- {x: 0.43301272, y: 0.24999996}
|
||||
--- !u!114 &2133386424829156613
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7457347100279815265}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 8bae8006d48aa3247b3fe819ed1c230b, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
speed: 7
|
7
Assets/Scripts/Enemy.prefab.meta
Normal file
7
Assets/Scripts/Enemy.prefab.meta
Normal file
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: a335508f81678e14cb5e9ca3723a0999
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
32
Assets/Scripts/Game01.cs
Normal file
32
Assets/Scripts/Game01.cs
Normal file
|
@ -0,0 +1,32 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Game01 : MonoBehaviour{
|
||||
|
||||
public GameObject unpressed;
|
||||
public GameObject pressed;
|
||||
public GameObject particles;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start(){
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update(){
|
||||
if (Input.GetKeyDown(KeyCode.Space)){
|
||||
AudioManager.instance.Play("Explosion");
|
||||
unpressed.SetActive(false);
|
||||
pressed.SetActive(true);
|
||||
particles.SetActive(true);
|
||||
StartCoroutine(ChangeScene());
|
||||
Time.timeScale = 0;
|
||||
}
|
||||
}
|
||||
|
||||
IEnumerator ChangeScene(){
|
||||
yield return new WaitForSecondsRealtime(1.5f);
|
||||
FindObjectOfType<GameController>().CompleteLevel();
|
||||
}
|
||||
}
|
11
Assets/Scripts/Game01.cs.meta
Normal file
11
Assets/Scripts/Game01.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: b760318270e3ccf42884e3e42cdc23db
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
34
Assets/Scripts/Game02.cs
Normal file
34
Assets/Scripts/Game02.cs
Normal file
|
@ -0,0 +1,34 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Game02 : MonoBehaviour{
|
||||
|
||||
public GameObject death;
|
||||
public GameObject unpressed;
|
||||
public GameObject pressed;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start(){
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update(){
|
||||
if (Input.GetKeyDown(KeyCode.Space)){
|
||||
Time.timeScale = 0;
|
||||
StartCoroutine(Death());
|
||||
unpressed.SetActive(false);
|
||||
pressed.SetActive(true);
|
||||
}
|
||||
}
|
||||
|
||||
IEnumerator Death(){
|
||||
yield return new WaitForSecondsRealtime(1);
|
||||
death.SetActive(true);
|
||||
yield return new WaitForSecondsRealtime(3.12f);
|
||||
AudioManager.instance.Play("Explosion");
|
||||
yield return new WaitForSecondsRealtime(0.86f);
|
||||
FindObjectOfType<GameController>().LoseGame();
|
||||
}
|
||||
}
|
11
Assets/Scripts/Game02.cs.meta
Normal file
11
Assets/Scripts/Game02.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 5eafc1035d339584b9dcf923c42730f0
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
Assets/Scripts/Game03.meta
Normal file
8
Assets/Scripts/Game03.meta
Normal file
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 1d50777f8e5d3644b8949e698f2e33d0
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
13
Assets/Scripts/Game03/Column.cs
Normal file
13
Assets/Scripts/Game03/Column.cs
Normal file
|
@ -0,0 +1,13 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Column : MonoBehaviour{
|
||||
|
||||
public float speed;
|
||||
|
||||
// Update is called once per frame
|
||||
void Update(){
|
||||
transform.Translate(Vector3.left * speed * Time.deltaTime);
|
||||
}
|
||||
}
|
11
Assets/Scripts/Game03/Column.cs.meta
Normal file
11
Assets/Scripts/Game03/Column.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 33f799ff1e7857e469686e2c37688fee
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
20
Assets/Scripts/Game03/FlappyLevelGenerator.cs
Normal file
20
Assets/Scripts/Game03/FlappyLevelGenerator.cs
Normal file
|
@ -0,0 +1,20 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class FlappyLevelGenerator : MonoBehaviour{
|
||||
|
||||
public GameObject levelTube;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start(){
|
||||
for (int i = 0; i < 10; i++){
|
||||
Instantiate(levelTube, new Vector2(4 + 5 * i, Random.Range(-3, 3)), Quaternion.identity);
|
||||
}
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update(){
|
||||
|
||||
}
|
||||
}
|
11
Assets/Scripts/Game03/FlappyLevelGenerator.cs.meta
Normal file
11
Assets/Scripts/Game03/FlappyLevelGenerator.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 368c6892b00e8c14c930c0ce9bbcf0a2
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
48
Assets/Scripts/Game03/PlayerController03.cs
Normal file
48
Assets/Scripts/Game03/PlayerController03.cs
Normal file
|
@ -0,0 +1,48 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class PlayerController03 : MonoBehaviour{
|
||||
|
||||
Rigidbody2D rb2d;
|
||||
public float flapForce;
|
||||
public GameObject explosion;
|
||||
public GameObject death;
|
||||
|
||||
bool jump;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start(){
|
||||
rb2d = GetComponent<Rigidbody2D>();
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update(){
|
||||
if (Input.GetKeyDown(KeyCode.Space)){
|
||||
jump = true;
|
||||
}
|
||||
}
|
||||
|
||||
void FixedUpdate(){
|
||||
if (jump){
|
||||
rb2d.velocity = Vector2.zero;
|
||||
rb2d.AddForce(Vector2.up * flapForce, ForceMode2D.Impulse);
|
||||
jump = false;
|
||||
}
|
||||
}
|
||||
|
||||
void OnCollisionEnter2D(Collision2D col){
|
||||
AudioManager.instance.Play("Hit");
|
||||
Time.timeScale = 0f;
|
||||
GetComponent<SpriteRenderer>().enabled = false;
|
||||
explosion.SetActive(true);
|
||||
StartCoroutine(Death());
|
||||
}
|
||||
|
||||
IEnumerator Death(){
|
||||
yield return new WaitForSecondsRealtime(1f);
|
||||
death.SetActive(true);
|
||||
yield return new WaitForSecondsRealtime(4.5f);
|
||||
FindObjectOfType<GameController>().LoseGame();
|
||||
}
|
||||
}
|
11
Assets/Scripts/Game03/PlayerController03.cs.meta
Normal file
11
Assets/Scripts/Game03/PlayerController03.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 87a1dcdd8034ad44fb80b0377c0fb69f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
428
Assets/Scripts/Game03/Tubes.prefab
Normal file
428
Assets/Scripts/Game03/Tubes.prefab
Normal file
|
@ -0,0 +1,428 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &4399682967295597847
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 4399682967295597846}
|
||||
- component: {fileID: -878348750023516520}
|
||||
m_Layer: 0
|
||||
m_Name: Tubes
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &4399682967295597846
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4399682967295597847}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children:
|
||||
- {fileID: 6299071708667454004}
|
||||
- {fileID: 4399682968409056958}
|
||||
- {fileID: 4594401432184290733}
|
||||
- {fileID: 4399682968304864841}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &-878348750023516520
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4399682967295597847}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 33f799ff1e7857e469686e2c37688fee, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
speed: 3
|
||||
--- !u!1 &4399682968304864846
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 4399682968304864841}
|
||||
- component: {fileID: 4399682968304864843}
|
||||
m_Layer: 0
|
||||
m_Name: Square (1)
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &4399682968304864841
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4399682968304864846}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 6.93, z: 0}
|
||||
m_LocalScale: {x: 0.8, y: 9.3, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 4399682967295597846}
|
||||
m_RootOrder: 3
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!212 &4399682968304864843
|
||||
SpriteRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4399682968304864846}
|
||||
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_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: 2da096eed7b00f945aa7903f5cd57033, type: 3}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_FlipX: 0
|
||||
m_FlipY: 0
|
||||
m_DrawMode: 0
|
||||
m_Size: {x: 1, y: 1}
|
||||
m_AdaptiveModeThreshold: 0.5
|
||||
m_SpriteTileMode: 0
|
||||
m_WasSpriteAssigned: 1
|
||||
m_MaskInteraction: 0
|
||||
m_SpriteSortPoint: 0
|
||||
--- !u!1 &4399682968409056959
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 4399682968409056958}
|
||||
- component: {fileID: 4399682968409056952}
|
||||
m_Layer: 0
|
||||
m_Name: Square
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &4399682968409056958
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4399682968409056959}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: -6.93, z: 0}
|
||||
m_LocalScale: {x: 0.8, y: 9.3, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 4399682967295597846}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!212 &4399682968409056952
|
||||
SpriteRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4399682968409056959}
|
||||
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_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: 2da096eed7b00f945aa7903f5cd57033, type: 3}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_FlipX: 0
|
||||
m_FlipY: 0
|
||||
m_DrawMode: 0
|
||||
m_Size: {x: 1, y: 1}
|
||||
m_AdaptiveModeThreshold: 0.5
|
||||
m_SpriteTileMode: 0
|
||||
m_WasSpriteAssigned: 1
|
||||
m_MaskInteraction: 0
|
||||
m_SpriteSortPoint: 0
|
||||
--- !u!1 &5719701070971068221
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 4594401432184290733}
|
||||
- component: {fileID: 7269332743296958219}
|
||||
- component: {fileID: 2703098229229799948}
|
||||
m_Layer: 0
|
||||
m_Name: Square (3)
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &4594401432184290733
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5719701070971068221}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 6.93, z: 0}
|
||||
m_LocalScale: {x: 1, y: 9.507807, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 4399682967295597846}
|
||||
m_RootOrder: 2
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!212 &7269332743296958219
|
||||
SpriteRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5719701070971068221}
|
||||
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_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: -1
|
||||
m_Sprite: {fileID: 21300000, guid: 2da096eed7b00f945aa7903f5cd57033, type: 3}
|
||||
m_Color: {r: 1, g: 0.047058824, b: 0, a: 1}
|
||||
m_FlipX: 0
|
||||
m_FlipY: 0
|
||||
m_DrawMode: 0
|
||||
m_Size: {x: 1, y: 1}
|
||||
m_AdaptiveModeThreshold: 0.5
|
||||
m_SpriteTileMode: 0
|
||||
m_WasSpriteAssigned: 1
|
||||
m_MaskInteraction: 0
|
||||
m_SpriteSortPoint: 0
|
||||
--- !u!61 &2703098229229799948
|
||||
BoxCollider2D:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5719701070971068221}
|
||||
m_Enabled: 1
|
||||
m_Density: 1
|
||||
m_Material: {fileID: 0}
|
||||
m_IsTrigger: 0
|
||||
m_UsedByEffector: 0
|
||||
m_UsedByComposite: 0
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_SpriteTilingProperty:
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
oldSize: {x: 1, y: 1}
|
||||
newSize: {x: 1, y: 1}
|
||||
adaptiveTilingThreshold: 0.5
|
||||
drawMode: 0
|
||||
adaptiveTiling: 0
|
||||
m_AutoTiling: 0
|
||||
serializedVersion: 2
|
||||
m_Size: {x: 1, y: 1}
|
||||
m_EdgeRadius: 0
|
||||
--- !u!1 &8801372933175907121
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 6299071708667454004}
|
||||
- component: {fileID: 413970154725442996}
|
||||
- component: {fileID: 1517452904584201335}
|
||||
m_Layer: 0
|
||||
m_Name: Square (2)
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &6299071708667454004
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8801372933175907121}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: -6.93, z: 0}
|
||||
m_LocalScale: {x: 1, y: 9.507807, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 4399682967295597846}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!212 &413970154725442996
|
||||
SpriteRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8801372933175907121}
|
||||
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_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: -1
|
||||
m_Sprite: {fileID: 21300000, guid: 2da096eed7b00f945aa7903f5cd57033, type: 3}
|
||||
m_Color: {r: 1, g: 0.047058824, b: 0, a: 1}
|
||||
m_FlipX: 0
|
||||
m_FlipY: 0
|
||||
m_DrawMode: 0
|
||||
m_Size: {x: 1, y: 1}
|
||||
m_AdaptiveModeThreshold: 0.5
|
||||
m_SpriteTileMode: 0
|
||||
m_WasSpriteAssigned: 1
|
||||
m_MaskInteraction: 0
|
||||
m_SpriteSortPoint: 0
|
||||
--- !u!61 &1517452904584201335
|
||||
BoxCollider2D:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8801372933175907121}
|
||||
m_Enabled: 1
|
||||
m_Density: 1
|
||||
m_Material: {fileID: 0}
|
||||
m_IsTrigger: 0
|
||||
m_UsedByEffector: 0
|
||||
m_UsedByComposite: 0
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_SpriteTilingProperty:
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
oldSize: {x: 1, y: 1}
|
||||
newSize: {x: 1, y: 1}
|
||||
adaptiveTilingThreshold: 0.5
|
||||
drawMode: 0
|
||||
adaptiveTiling: 0
|
||||
m_AutoTiling: 0
|
||||
serializedVersion: 2
|
||||
m_Size: {x: 1, y: 1}
|
||||
m_EdgeRadius: 0
|
7
Assets/Scripts/Game03/Tubes.prefab.meta
Normal file
7
Assets/Scripts/Game03/Tubes.prefab.meta
Normal file
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 2b9429db4f3cefd4d8f7030badcd9043
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
Assets/Scripts/Game04.meta
Normal file
8
Assets/Scripts/Game04.meta
Normal file
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 2eb338261d6d82449850561d4641281b
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
68
Assets/Scripts/Game04/PlayerController04.cs
Normal file
68
Assets/Scripts/Game04/PlayerController04.cs
Normal file
|
@ -0,0 +1,68 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class PlayerController04 : MonoBehaviour{
|
||||
|
||||
public float speed;
|
||||
public float maxSpeed;
|
||||
public float jumpForce;
|
||||
public GameObject death;
|
||||
public GameObject particles;
|
||||
bool jump;
|
||||
bool grounded;
|
||||
|
||||
Camera mainCamera;
|
||||
Rigidbody2D rb2d;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start(){
|
||||
rb2d = GetComponent<Rigidbody2D>();
|
||||
mainCamera = Camera.main;
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update(){
|
||||
if (Input.GetKeyDown(KeyCode.Space) && grounded){
|
||||
jump = true;
|
||||
}
|
||||
}
|
||||
|
||||
void FixedUpdate(){
|
||||
if (jump){
|
||||
rb2d.velocity = new Vector2(rb2d.velocity.x, 0);
|
||||
rb2d.AddForce(Vector2.up * jumpForce, ForceMode2D.Impulse);
|
||||
jump = false;
|
||||
}
|
||||
rb2d.AddForce(Vector2.right * speed);
|
||||
rb2d.velocity = new Vector2(Mathf.Clamp(rb2d.velocity.x, -maxSpeed, maxSpeed), rb2d.velocity.y);
|
||||
}
|
||||
|
||||
void LateUpdate(){
|
||||
mainCamera.transform.position = new Vector3(transform.position.x + 1.5f, mainCamera.transform.position.y, mainCamera.transform.position.z);
|
||||
}
|
||||
|
||||
void OnCollisionStay2D(Collision2D col){
|
||||
grounded = true;
|
||||
}
|
||||
void OnCollisionEnter2D(Collision2D col){
|
||||
if (col.gameObject.tag == "Damage"){
|
||||
AudioManager.instance.Play("Hit");
|
||||
Time.timeScale = 0f;
|
||||
GetComponent<SpriteRenderer>().enabled = false;
|
||||
particles.SetActive(true);
|
||||
StartCoroutine(Death());
|
||||
}
|
||||
}
|
||||
|
||||
IEnumerator Death(){
|
||||
yield return new WaitForSecondsRealtime(1f);
|
||||
death.SetActive(true);
|
||||
yield return new WaitForSecondsRealtime(4f);
|
||||
FindObjectOfType<GameController>().LoseGame();
|
||||
}
|
||||
|
||||
void OnCollisionExit2D(Collision2D col){
|
||||
grounded = false;
|
||||
}
|
||||
}
|
11
Assets/Scripts/Game04/PlayerController04.cs.meta
Normal file
11
Assets/Scripts/Game04/PlayerController04.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 2e50b9b0075a79b4f97d6486a3f25c42
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
81
Assets/Scripts/Game05.cs
Normal file
81
Assets/Scripts/Game05.cs
Normal file
|
@ -0,0 +1,81 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
public class Game05 : MonoBehaviour{
|
||||
|
||||
public string menuScene;
|
||||
public string[] scenes;
|
||||
public Image timeBar;
|
||||
public float maxTime;
|
||||
float currentTime;
|
||||
[Space(10)]
|
||||
public GameObject death1;
|
||||
public GameObject death2;
|
||||
public GameObject particles;
|
||||
public RawImage water;
|
||||
bool finish;
|
||||
bool lost;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start(){
|
||||
currentTime = maxTime;
|
||||
water.transform.localScale = new Vector2(water.transform.localScale.x, 0);
|
||||
particles.SetActive(false);
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update(){
|
||||
if (Input.GetKey(KeyCode.Space)){
|
||||
water.transform.localScale = new Vector2(water.transform.localScale.x, water.transform.localScale.y + (.5f * Time.deltaTime));
|
||||
particles.SetActive(true);
|
||||
}
|
||||
if (Input.GetKeyUp(KeyCode.Space)){
|
||||
particles.SetActive(false);
|
||||
}
|
||||
if (finish){
|
||||
if(water.transform.localScale.y < .77f){
|
||||
StartCoroutine(Death2());
|
||||
death2.SetActive(true);
|
||||
}else if(water.transform.localScale.y >= .77f && water.transform.localScale.y < .95f){
|
||||
CompleteLevel();
|
||||
}
|
||||
}else if(water.transform.localScale.y >= .95f && !lost){
|
||||
StartCoroutine(Death1());
|
||||
death1.SetActive(true);
|
||||
lost = true;
|
||||
}
|
||||
currentTime -= 1 * Time.deltaTime;
|
||||
timeBar.transform.localScale = new Vector2(currentTime / maxTime, timeBar.transform.localScale.y);
|
||||
if (currentTime <= 0){
|
||||
finish = true;
|
||||
}
|
||||
}
|
||||
|
||||
IEnumerator Death1(){
|
||||
yield return new WaitForSecondsRealtime(1f);
|
||||
AudioManager.instance.Play("Water");
|
||||
Time.timeScale = 0;
|
||||
yield return new WaitForSecondsRealtime(3f);
|
||||
LoseGame();
|
||||
}
|
||||
|
||||
IEnumerator Death2(){
|
||||
yield return new WaitForSecondsRealtime(1f);
|
||||
Time.timeScale = 0;
|
||||
yield return new WaitForSecondsRealtime(3f);
|
||||
LoseGame();
|
||||
}
|
||||
|
||||
public void CompleteLevel(){
|
||||
string scene = scenes[Random.Range(0, scenes.Length - 1)];
|
||||
LevelLoader.Instance.LoadLevel(scene);
|
||||
}
|
||||
|
||||
public void LoseGame(){
|
||||
Debug.LogError(SceneManager.GetActiveScene().name);
|
||||
LevelLoader.Instance.LoadLevel(menuScene);
|
||||
}
|
||||
}
|
11
Assets/Scripts/Game05.cs.meta
Normal file
11
Assets/Scripts/Game05.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 33f6a50c13a0ab843b0f26984d52478a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
68
Assets/Scripts/Game06.cs
Normal file
68
Assets/Scripts/Game06.cs
Normal file
|
@ -0,0 +1,68 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Game06 : MonoBehaviour{
|
||||
|
||||
public Transform target;
|
||||
public float speed;
|
||||
public GameObject death;
|
||||
|
||||
bool canMove = true;
|
||||
Vector3 start, end;
|
||||
Rigidbody2D rb2d;
|
||||
bool thrown;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start(){
|
||||
rb2d = GetComponent<Rigidbody2D>();
|
||||
rb2d.gravityScale = 0;
|
||||
if(target != null){
|
||||
target.parent = null;
|
||||
start = transform.position;
|
||||
end = target.position;
|
||||
}
|
||||
}
|
||||
|
||||
void Update(){
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void FixedUpdate(){
|
||||
if(target != null){
|
||||
if (canMove){
|
||||
float fixedSpeed = speed * Time.fixedDeltaTime;
|
||||
transform.position = Vector3.MoveTowards(transform.position, target.position, fixedSpeed);
|
||||
}
|
||||
}
|
||||
|
||||
if(transform.position == target.position){
|
||||
target.position = (target.position == start) ? end : start;
|
||||
}
|
||||
if (Input.GetKeyDown(KeyCode.Space)){
|
||||
rb2d.gravityScale = 2;
|
||||
Invoke("AbleToWin", .5f);
|
||||
canMove = false;
|
||||
}
|
||||
if(rb2d.velocity.y >= -0.1f && thrown && rb2d.velocity.x <= 0.01f){
|
||||
FindObjectOfType<GameController>().CompleteLevel();
|
||||
}
|
||||
}
|
||||
|
||||
void OnTriggerEnter2D(Collider2D col){
|
||||
StartCoroutine(Death());
|
||||
death.SetActive(true);
|
||||
}
|
||||
|
||||
IEnumerator Death(){
|
||||
yield return new WaitForSecondsRealtime(1f);
|
||||
Time.timeScale = 0;
|
||||
yield return new WaitForSecondsRealtime(4.5f);
|
||||
FindObjectOfType<GameController>().LoseGame();
|
||||
}
|
||||
|
||||
void AbleToWin(){
|
||||
thrown = true;
|
||||
}
|
||||
}
|
11
Assets/Scripts/Game06.cs.meta
Normal file
11
Assets/Scripts/Game06.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 4b072c2f520c0b2468671ea189f7c8b4
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
Assets/Scripts/Game07.meta
Normal file
8
Assets/Scripts/Game07.meta
Normal file
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: f9bb0164b51310c48852b873350bc405
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
34
Assets/Scripts/Game07/Game07.cs
Normal file
34
Assets/Scripts/Game07/Game07.cs
Normal file
|
@ -0,0 +1,34 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Game07 : MonoBehaviour{
|
||||
|
||||
public float rotationForce;
|
||||
float rotZ;
|
||||
bool shoot;
|
||||
public Rigidbody2D rb2d;
|
||||
public float throwForce;
|
||||
public Transform target;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start(){
|
||||
rb2d.gravityScale = 0;
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update(){
|
||||
if (!shoot){
|
||||
rotZ = Mathf.Sin(Time.time * 3) * rotationForce; //tweak this to change frequency
|
||||
transform.rotation = Quaternion.AngleAxis(rotZ, Vector3.forward);
|
||||
}
|
||||
if (Input.GetKeyDown(KeyCode.Space) && !shoot){
|
||||
shoot = true;
|
||||
Vector2 difference = target.position - transform.position;
|
||||
difference.Normalize();
|
||||
|
||||
rb2d.gravityScale = 2;
|
||||
rb2d.AddForce(difference * throwForce, ForceMode2D.Impulse);
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/Scripts/Game07/Game07.cs.meta
Normal file
11
Assets/Scripts/Game07/Game07.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 0f83d9d6aa83ab9469300b45a3c4b843
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
54
Assets/Scripts/Game07/PlayerController07.cs
Normal file
54
Assets/Scripts/Game07/PlayerController07.cs
Normal file
|
@ -0,0 +1,54 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
public class PlayerController07 : MonoBehaviour{
|
||||
|
||||
public GameObject death;
|
||||
public string menuScene;
|
||||
public string[] scenes;
|
||||
public Image timeBar;
|
||||
public float maxTime = 5;
|
||||
float currentTime;
|
||||
Rigidbody2D rb2d;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start(){
|
||||
currentTime = maxTime;
|
||||
rb2d = GetComponent<Rigidbody2D>();
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update(){
|
||||
currentTime -= 1 * Time.deltaTime;
|
||||
timeBar.transform.localScale = new Vector2(currentTime / maxTime, timeBar.transform.localScale.y);
|
||||
if (currentTime <= 0){
|
||||
StartCoroutine(Death());
|
||||
}
|
||||
}
|
||||
|
||||
void OnTriggerStay2D(Collider2D col){
|
||||
if (rb2d.velocity.y < 0){
|
||||
CompleteLevel();
|
||||
}
|
||||
}
|
||||
|
||||
IEnumerator Death(){
|
||||
Time.timeScale = 0;
|
||||
death.SetActive(true);
|
||||
yield return new WaitForSecondsRealtime(4f);
|
||||
LoseGame();
|
||||
}
|
||||
|
||||
public void CompleteLevel(){
|
||||
string scene = scenes[Random.Range(0, scenes.Length - 1)];
|
||||
LevelLoader.Instance.LoadLevel(scene);
|
||||
}
|
||||
|
||||
public void LoseGame(){
|
||||
Debug.LogError(SceneManager.GetActiveScene().name);
|
||||
LevelLoader.Instance.LoadLevel(menuScene);
|
||||
}
|
||||
}
|
11
Assets/Scripts/Game07/PlayerController07.cs.meta
Normal file
11
Assets/Scripts/Game07/PlayerController07.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 3373a59045d675146b4aa634b9335f5e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
Assets/Scripts/Game08.meta
Normal file
8
Assets/Scripts/Game08.meta
Normal file
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: f562386a8b1af9846b1e5b40105beb5f
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
50
Assets/Scripts/Game08/Game08.cs
Normal file
50
Assets/Scripts/Game08/Game08.cs
Normal file
|
@ -0,0 +1,50 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Game08 : MonoBehaviour{
|
||||
|
||||
public Transform target;
|
||||
public float speed;
|
||||
bool canMove = true;
|
||||
Vector3 start, end;
|
||||
int buttonsPressed;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start(){
|
||||
if (target != null){
|
||||
target.parent = null;
|
||||
start = transform.position;
|
||||
end = target.position;
|
||||
}
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void FixedUpdate(){
|
||||
if (target != null){
|
||||
if (canMove){
|
||||
float fixedSpeed = speed * Time.fixedDeltaTime;
|
||||
transform.position = Vector3.MoveTowards(transform.position, target.position, fixedSpeed);
|
||||
}
|
||||
}
|
||||
|
||||
if (transform.position == target.position){
|
||||
target.position = (target.position == start) ? end : start;
|
||||
}
|
||||
}
|
||||
|
||||
void OnTriggerStay2D(Collider2D col){
|
||||
if (Input.GetKeyDown(KeyCode.Space)){
|
||||
if(buttonsPressed < 3){
|
||||
if(buttonsPressed == 2){
|
||||
FindObjectOfType<GameController>().CompleteLevel();
|
||||
buttonsPressed += 1;
|
||||
col.enabled = false;
|
||||
}else{
|
||||
buttonsPressed += 1;
|
||||
col.enabled = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/Scripts/Game08/Game08.cs.meta
Normal file
11
Assets/Scripts/Game08/Game08.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 49d2bab563b331e49a0b136019ae0f99
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
26
Assets/Scripts/Game08/Game08Button.cs
Normal file
26
Assets/Scripts/Game08/Game08Button.cs
Normal file
|
@ -0,0 +1,26 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Game08Button : MonoBehaviour{
|
||||
|
||||
public GameObject unpressed;
|
||||
public GameObject pressed;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start(){
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update(){
|
||||
|
||||
}
|
||||
|
||||
void OnTriggerStay2D(Collider2D col){
|
||||
if (Input.GetKeyDown(KeyCode.Space)){
|
||||
pressed.SetActive(true);
|
||||
unpressed.SetActive(false);
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/Scripts/Game08/Game08Button.cs.meta
Normal file
11
Assets/Scripts/Game08/Game08Button.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 8ca23f0c8b2ebc34da31e82d68b90df8
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
Assets/Scripts/Game09.meta
Normal file
8
Assets/Scripts/Game09.meta
Normal file
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 5b49a8745f7780a44ab815f720d8c77b
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
18
Assets/Scripts/Game09/Enemy09.cs
Normal file
18
Assets/Scripts/Game09/Enemy09.cs
Normal file
|
@ -0,0 +1,18 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Enemy09 : MonoBehaviour{
|
||||
|
||||
public float speed;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start(){
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update(){
|
||||
transform.Translate(Vector2.down * speed * Time.deltaTime);
|
||||
}
|
||||
}
|
11
Assets/Scripts/Game09/Enemy09.cs.meta
Normal file
11
Assets/Scripts/Game09/Enemy09.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 8bae8006d48aa3247b3fe819ed1c230b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
53
Assets/Scripts/Game09/Game09.cs
Normal file
53
Assets/Scripts/Game09/Game09.cs
Normal file
|
@ -0,0 +1,53 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Game09 : MonoBehaviour{
|
||||
|
||||
public GameObject particles;
|
||||
public GameObject death;
|
||||
public float turnSpeed;
|
||||
int currentRail = -1;
|
||||
public GameObject enemy;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start(){
|
||||
for (int i = 0; i < 10; i++){
|
||||
int position = Random.Range(-1, 1);
|
||||
if(position == 0){
|
||||
position = 1;
|
||||
}
|
||||
Instantiate(enemy, new Vector2(position, 6 + 5 * i), Quaternion.identity);
|
||||
}
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update(){
|
||||
if (Input.GetKeyDown(KeyCode.Space)){
|
||||
if(currentRail == -1){
|
||||
currentRail = 1;
|
||||
}else if(currentRail == 1){
|
||||
currentRail = -1;
|
||||
}
|
||||
}
|
||||
float fixedSpeed = turnSpeed * Time.deltaTime;
|
||||
transform.position = Vector3.MoveTowards(transform.position, new Vector2(currentRail, transform.position.y), fixedSpeed);
|
||||
}
|
||||
|
||||
void OnCollisionEnter2D(Collision2D col){
|
||||
particles.SetActive(true);
|
||||
StartCoroutine(Death());
|
||||
GetComponent<SpriteRenderer>().enabled = false;
|
||||
GetComponent<CircleCollider2D>().enabled = false;
|
||||
AudioManager.instance.Play("Hit");
|
||||
}
|
||||
|
||||
IEnumerator Death(){
|
||||
yield return new WaitForSecondsRealtime(1f);
|
||||
Time.timeScale = 0f;
|
||||
death.SetActive(true);
|
||||
death.SetActive(true);
|
||||
yield return new WaitForSecondsRealtime(4f);
|
||||
FindObjectOfType<GameController>().LoseGame();
|
||||
}
|
||||
}
|
11
Assets/Scripts/Game09/Game09.cs.meta
Normal file
11
Assets/Scripts/Game09/Game09.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: a7cf72d771f42724fad2fb4d4e6144b2
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
61
Assets/Scripts/Game10.cs
Normal file
61
Assets/Scripts/Game10.cs
Normal file
|
@ -0,0 +1,61 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
public class Game10 : MonoBehaviour{
|
||||
public string menuScene;
|
||||
public string[] scenes;
|
||||
public Image timeBar;
|
||||
public float maxTime = 5f;
|
||||
float currentTime;
|
||||
[Space(10)]
|
||||
public GameObject death;
|
||||
public float rotationSpeed;
|
||||
public Transform player;
|
||||
float rotZ;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start(){
|
||||
currentTime = maxTime;
|
||||
transform.localRotation = Quaternion.Euler(0, 0, Random.Range(30f, 330f));
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update(){
|
||||
currentTime -= 1 * Time.deltaTime;
|
||||
timeBar.transform.localScale = new Vector2(currentTime / maxTime, timeBar.transform.localScale.y);
|
||||
if(currentTime <= 0){
|
||||
StartCoroutine(Death());
|
||||
death.SetActive(true);
|
||||
}
|
||||
if (Input.GetKey(KeyCode.Space)){
|
||||
rotZ -= rotationSpeed * 10 * Time.deltaTime;
|
||||
}
|
||||
player.localRotation = Quaternion.Euler(0, 0, rotZ);
|
||||
}
|
||||
|
||||
void OnTriggerStay2D(Collider2D col){
|
||||
if (Input.GetKeyUp(KeyCode.Space)){
|
||||
player.localRotation = transform.localRotation;
|
||||
CompleteLevel();
|
||||
}
|
||||
}
|
||||
|
||||
public void CompleteLevel(){
|
||||
string scene = scenes[Random.Range(0, scenes.Length - 1)];
|
||||
LevelLoader.Instance.LoadLevel(scene);
|
||||
}
|
||||
|
||||
public void LoseGame(){
|
||||
Debug.LogError(SceneManager.GetActiveScene().name);
|
||||
LevelLoader.Instance.LoadLevel(menuScene);
|
||||
}
|
||||
|
||||
IEnumerator Death(){
|
||||
Time.timeScale = 0;
|
||||
yield return new WaitForSecondsRealtime(4f);
|
||||
LoseGame();
|
||||
}
|
||||
}
|
11
Assets/Scripts/Game10.cs.meta
Normal file
11
Assets/Scripts/Game10.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: bbca21255d2a44948b2480844a1a1f74
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
71
Assets/Scripts/Game11.cs
Normal file
71
Assets/Scripts/Game11.cs
Normal file
|
@ -0,0 +1,71 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Game11 : MonoBehaviour{
|
||||
|
||||
public GameObject death1;
|
||||
public GameObject death2;
|
||||
public Transform target;
|
||||
public float speed;
|
||||
bool canMove = true;
|
||||
Vector3 start, end;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start(){
|
||||
if (target != null){
|
||||
target.parent = null;
|
||||
start = transform.position;
|
||||
end = target.position;
|
||||
}
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void FixedUpdate(){
|
||||
if (target != null){
|
||||
if (canMove){
|
||||
float fixedSpeed = speed * Time.fixedDeltaTime;
|
||||
transform.position = Vector3.MoveTowards(transform.position, target.position, fixedSpeed);
|
||||
}
|
||||
}
|
||||
|
||||
if (transform.position == target.position){
|
||||
target.position = (target.position == start) ? end : start;
|
||||
}
|
||||
}
|
||||
|
||||
void OnTriggerStay2D(Collider2D col){
|
||||
if (Input.GetKeyDown(KeyCode.Space)){
|
||||
if(col.gameObject.tag == "Finish"){
|
||||
if(transform.position.y > 0){
|
||||
StartCoroutine(Death1());
|
||||
Time.timeScale = 0f;
|
||||
}else{
|
||||
StartCoroutine(Death2());
|
||||
Time.timeScale = 0f;
|
||||
}
|
||||
}else{
|
||||
FindObjectOfType<GameController>().CompleteLevel();
|
||||
col.enabled = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
IEnumerator Death1(){
|
||||
yield return new WaitForSecondsRealtime(.5f);
|
||||
death1.SetActive(true);
|
||||
yield return new WaitForSecondsRealtime(3f);
|
||||
AudioManager.instance.Play("Explosion");
|
||||
yield return new WaitForSecondsRealtime(1f);
|
||||
FindObjectOfType<GameController>().LoseGame();
|
||||
}
|
||||
|
||||
IEnumerator Death2(){
|
||||
yield return new WaitForSecondsRealtime(.5f);
|
||||
death2.SetActive(true);
|
||||
yield return new WaitForSecondsRealtime(3f);
|
||||
AudioManager.instance.Play("Explosion");
|
||||
yield return new WaitForSecondsRealtime(1f);
|
||||
FindObjectOfType<GameController>().LoseGame();
|
||||
}
|
||||
}
|
11
Assets/Scripts/Game11.cs.meta
Normal file
11
Assets/Scripts/Game11.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: b6e56058adf5c40459b8d6e02e2e8fe6
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
Assets/Scripts/Game12.meta
Normal file
8
Assets/Scripts/Game12.meta
Normal file
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: d24cd5c09dd726544a683e1c620b6076
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
11
Assets/Scripts/Game12/Bounce.physicsMaterial2D
Normal file
11
Assets/Scripts/Game12/Bounce.physicsMaterial2D
Normal file
|
@ -0,0 +1,11 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!62 &6200000
|
||||
PhysicsMaterial2D:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: Bounce
|
||||
friction: 0
|
||||
bounciness: 1
|
8
Assets/Scripts/Game12/Bounce.physicsMaterial2D.meta
Normal file
8
Assets/Scripts/Game12/Bounce.physicsMaterial2D.meta
Normal file
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 9555af9c9889a0f4ca4fe9fd1d1edef4
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
49
Assets/Scripts/Game12/Game12Ball.cs
Normal file
49
Assets/Scripts/Game12/Game12Ball.cs
Normal file
|
@ -0,0 +1,49 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Game12Ball : MonoBehaviour{
|
||||
|
||||
public GameObject particles;
|
||||
public GameObject death;
|
||||
public float speed;
|
||||
public Rigidbody2D rb2d;
|
||||
bool launched;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start(){
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update(){
|
||||
if(Time.timeScale > 0 && !launched){
|
||||
Launch();
|
||||
launched = true;
|
||||
}
|
||||
}
|
||||
|
||||
void Launch(){
|
||||
float x = Random.Range(0, 2) == 0 ? -1 : 1;
|
||||
float y = Random.Range(0, 2) == 0 ? -1 : 1;
|
||||
rb2d.velocity = new Vector2(speed * x, speed * y);
|
||||
}
|
||||
|
||||
void OnCollisionEnter2D(Collision2D col){
|
||||
if(col.gameObject.tag == "Finish"){
|
||||
StartCoroutine(Death());
|
||||
}else{
|
||||
AudioManager.instance.Play("Paddle");
|
||||
}
|
||||
}
|
||||
|
||||
IEnumerator Death(){
|
||||
Time.timeScale = 0;
|
||||
particles.SetActive(true);
|
||||
GetComponent<SpriteRenderer>().enabled = false;
|
||||
yield return new WaitForSecondsRealtime(1f);
|
||||
death.SetActive(true);
|
||||
yield return new WaitForSecondsRealtime(5f);
|
||||
FindObjectOfType<GameController>().LoseGame();
|
||||
}
|
||||
}
|
11
Assets/Scripts/Game12/Game12Ball.cs.meta
Normal file
11
Assets/Scripts/Game12/Game12Ball.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 1039ac346c5a1a34b8cb4d02e5455a58
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
35
Assets/Scripts/Game12/Game12Paddle.cs
Normal file
35
Assets/Scripts/Game12/Game12Paddle.cs
Normal file
|
@ -0,0 +1,35 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Game12Paddle : MonoBehaviour{
|
||||
|
||||
public float speed;
|
||||
public Rigidbody2D rb1;
|
||||
public Rigidbody2D rb2;
|
||||
|
||||
float movement = 0;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start(){
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update(){
|
||||
if (Input.GetKeyDown(KeyCode.Space)){
|
||||
if(movement == 1){
|
||||
movement = -1;
|
||||
}else if(movement == -1){
|
||||
movement = 1;
|
||||
}else if(movement == 0){
|
||||
movement = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void FixedUpdate(){
|
||||
rb1.velocity = new Vector2(movement * speed, rb1.velocity.y);
|
||||
rb2.velocity = new Vector2(movement * speed, rb2.velocity.y);
|
||||
}
|
||||
}
|
11
Assets/Scripts/Game12/Game12Paddle.cs.meta
Normal file
11
Assets/Scripts/Game12/Game12Paddle.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 0dd60d398f3f994459516a9fa2f44aa0
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
Assets/Scripts/Game13.meta
Normal file
8
Assets/Scripts/Game13.meta
Normal file
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: ce1281715f76c8e42ad02833fb5cc017
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
42
Assets/Scripts/Game13/Game13.cs
Normal file
42
Assets/Scripts/Game13/Game13.cs
Normal file
|
@ -0,0 +1,42 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Game13 : MonoBehaviour{
|
||||
|
||||
public GameObject enemy;
|
||||
public Transform target;
|
||||
public float speed;
|
||||
bool canMove = true;
|
||||
Vector3 start, end;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start(){
|
||||
enemy.transform.position = new Vector2(-2, Random.Range(3.5f, -3.5f));
|
||||
if (target != null){
|
||||
target.parent = null;
|
||||
start = transform.position;
|
||||
end = target.position;
|
||||
}
|
||||
}
|
||||
|
||||
void Update(){
|
||||
if (Input.GetKeyDown(KeyCode.Space)){
|
||||
canMove = false;
|
||||
}
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void FixedUpdate(){
|
||||
if (target != null){
|
||||
if (canMove){
|
||||
float fixedSpeed = speed * Time.fixedDeltaTime;
|
||||
transform.position = Vector3.MoveTowards(transform.position, target.position, fixedSpeed);
|
||||
}
|
||||
}
|
||||
|
||||
if (transform.position == target.position){
|
||||
target.position = (target.position == start) ? end : start;
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/Scripts/Game13/Game13.cs.meta
Normal file
11
Assets/Scripts/Game13/Game13.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 8a8ef7a45d4062c48a8bbe19bf41128f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
58
Assets/Scripts/Game13/Game13Bullet.cs
Normal file
58
Assets/Scripts/Game13/Game13Bullet.cs
Normal file
|
@ -0,0 +1,58 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Game13Bullet : MonoBehaviour{
|
||||
|
||||
public GameObject death;
|
||||
public GameObject deathParticles;
|
||||
public GameObject killParticles;
|
||||
public float speed;
|
||||
bool canMove;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start(){
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update(){
|
||||
if (canMove){
|
||||
transform.Translate(Vector2.left * speed * Time.deltaTime);
|
||||
}
|
||||
|
||||
if (Input.GetKeyDown(KeyCode.Space) && !canMove){
|
||||
AudioManager.instance.Play("Shoot");
|
||||
canMove = true;
|
||||
}
|
||||
}
|
||||
|
||||
void OnCollisionEnter2D(Collision2D col){
|
||||
if(col.gameObject.tag == "Finish"){
|
||||
GetComponent<SpriteRenderer>().enabled = false;
|
||||
deathParticles.SetActive(true);
|
||||
Time.timeScale = 0;
|
||||
StartCoroutine(Death());
|
||||
AudioManager.instance.Play("Explosion");
|
||||
}else{
|
||||
col.gameObject.SetActive(false);
|
||||
killParticles.transform.position = col.transform.position;
|
||||
killParticles.SetActive(true);
|
||||
StartCoroutine(Win());
|
||||
Time.timeScale = 0;
|
||||
AudioManager.instance.Play("Explosion");
|
||||
}
|
||||
}
|
||||
|
||||
IEnumerator Win(){
|
||||
yield return new WaitForSecondsRealtime(1f);
|
||||
FindObjectOfType<GameController>().CompleteLevel();
|
||||
}
|
||||
|
||||
IEnumerator Death(){
|
||||
yield return new WaitForSecondsRealtime(1f);
|
||||
death.SetActive(true);
|
||||
yield return new WaitForSecondsRealtime(4f);
|
||||
FindObjectOfType<GameController>().LoseGame();
|
||||
}
|
||||
}
|
11
Assets/Scripts/Game13/Game13Bullet.cs.meta
Normal file
11
Assets/Scripts/Game13/Game13Bullet.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: a13ca91452192ea47bee3e351bfe0928
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
Assets/Scripts/Game14.meta
Normal file
8
Assets/Scripts/Game14.meta
Normal file
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 97c94d649f73b334ba1beac5e55f602d
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
18
Assets/Scripts/Game14/Game14Camera.cs
Normal file
18
Assets/Scripts/Game14/Game14Camera.cs
Normal file
|
@ -0,0 +1,18 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Game14Camera : MonoBehaviour{
|
||||
|
||||
public float rotationSpeed = 30f;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start(){
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update(){
|
||||
transform.Rotate(Vector3.forward, Time.deltaTime * rotationSpeed);
|
||||
}
|
||||
}
|
11
Assets/Scripts/Game14/Game14Camera.cs.meta
Normal file
11
Assets/Scripts/Game14/Game14Camera.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 7e8a5eab838d73d43ab2357a8df5fbee
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
25
Assets/Scripts/Game14/Game14Hexagon.cs
Normal file
25
Assets/Scripts/Game14/Game14Hexagon.cs
Normal file
|
@ -0,0 +1,25 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Game14Hexagon : MonoBehaviour{
|
||||
|
||||
public Rigidbody2D rb2d;
|
||||
|
||||
public float shrinkSpeed = 3f;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start(){
|
||||
rb2d.rotation = Random.Range(0f, 360f);
|
||||
transform.localScale = Vector3.one * 10f;
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update(){
|
||||
transform.localScale -= Vector3.one * shrinkSpeed * Time.deltaTime;
|
||||
|
||||
if(transform.localScale.x <= .05f){
|
||||
Destroy(gameObject);
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/Scripts/Game14/Game14Hexagon.cs.meta
Normal file
11
Assets/Scripts/Game14/Game14Hexagon.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 59d291ec6f533ad48aff5b4e42e5b1c6
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
39
Assets/Scripts/Game14/Game14Player.cs
Normal file
39
Assets/Scripts/Game14/Game14Player.cs
Normal file
|
@ -0,0 +1,39 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Game14Player : MonoBehaviour{
|
||||
|
||||
public GameObject death;
|
||||
public float moveSpeed = 600f;
|
||||
|
||||
float movement;
|
||||
|
||||
// Update is called once per frame
|
||||
void Update(){
|
||||
if (Input.GetKeyDown(KeyCode.Space)){
|
||||
movement = 1;
|
||||
}
|
||||
|
||||
if (Input.GetKeyUp(KeyCode.Space)){
|
||||
movement = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void FixedUpdate(){
|
||||
transform.RotateAround(Vector3.zero, Vector3.forward, movement * Time.fixedDeltaTime * -moveSpeed);
|
||||
}
|
||||
|
||||
void OnTriggerEnter2D(Collider2D col){
|
||||
AudioManager.instance.Play("Hit");
|
||||
StartCoroutine(Death());
|
||||
Time.timeScale = 0;
|
||||
death.transform.rotation = Camera.main.transform.rotation;
|
||||
death.SetActive(true);
|
||||
}
|
||||
|
||||
IEnumerator Death(){
|
||||
yield return new WaitForSecondsRealtime(5f);
|
||||
FindObjectOfType<GameController>().LoseGame();
|
||||
}
|
||||
}
|
11
Assets/Scripts/Game14/Game14Player.cs.meta
Normal file
11
Assets/Scripts/Game14/Game14Player.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: ad4aeaa2f3b7a114ebe440d7e10916d2
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
25
Assets/Scripts/Game14/Game14Spawner.cs
Normal file
25
Assets/Scripts/Game14/Game14Spawner.cs
Normal file
|
@ -0,0 +1,25 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Game14Spawner : MonoBehaviour{
|
||||
|
||||
public float spawnRate = 1f;
|
||||
|
||||
public GameObject hexagon;
|
||||
|
||||
float nextTimeToSpawn = 0f;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start(){
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update(){
|
||||
if(Time.time >= nextTimeToSpawn){
|
||||
Instantiate(hexagon, Vector3.zero, Quaternion.identity);
|
||||
nextTimeToSpawn = Time.time + 1f / spawnRate;
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/Scripts/Game14/Game14Spawner.cs.meta
Normal file
11
Assets/Scripts/Game14/Game14Spawner.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: e7f6aed27b056ec4bb1a61553b2fee64
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
225
Assets/Scripts/Game14/Hexagon.prefab
Normal file
225
Assets/Scripts/Game14/Hexagon.prefab
Normal file
|
@ -0,0 +1,225 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &864575671400655609
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 864575671400655607}
|
||||
- component: {fileID: 864575671400655608}
|
||||
- component: {fileID: 864575671400655605}
|
||||
- component: {fileID: 864575671400655606}
|
||||
m_Layer: 0
|
||||
m_Name: Hexagon
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &864575671400655607
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 864575671400655609}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children:
|
||||
- {fileID: 864575672589497938}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!120 &864575671400655608
|
||||
LineRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 864575671400655609}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 1
|
||||
m_ReceiveShadows: 1
|
||||
m_DynamicOccludee: 1
|
||||
m_MotionVectors: 0
|
||||
m_LightProbeUsage: 0
|
||||
m_ReflectionProbeUsage: 0
|
||||
m_RayTracingMode: 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: 3
|
||||
m_MinimumChartSize: 4
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
m_Positions:
|
||||
- {x: -0.5, y: 0.8, z: 0}
|
||||
- {x: -0.95, y: 0, z: 0}
|
||||
- {x: -0.5, y: -0.8, z: 0}
|
||||
- {x: 0.5, y: -0.8, z: 0}
|
||||
- {x: 0.95, y: 0, z: 0}
|
||||
- {x: 0.5, y: 0.8, z: 1}
|
||||
m_Parameters:
|
||||
serializedVersion: 3
|
||||
widthMultiplier: 0.1
|
||||
widthCurve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 1
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
colorGradient:
|
||||
serializedVersion: 2
|
||||
key0: {r: 1, g: 0.04705883, b: 0, a: 1}
|
||||
key1: {r: 1, g: 0.04705883, b: 0, a: 1}
|
||||
key2: {r: 0, g: 0, b: 0, a: 0}
|
||||
key3: {r: 0, g: 0, b: 0, a: 0}
|
||||
key4: {r: 0, g: 0, b: 0, a: 0}
|
||||
key5: {r: 0, g: 0, b: 0, a: 0}
|
||||
key6: {r: 0, g: 0, b: 0, a: 0}
|
||||
key7: {r: 0, g: 0, b: 0, a: 0}
|
||||
ctime0: 0
|
||||
ctime1: 65535
|
||||
ctime2: 0
|
||||
ctime3: 0
|
||||
ctime4: 0
|
||||
ctime5: 0
|
||||
ctime6: 0
|
||||
ctime7: 0
|
||||
atime0: 0
|
||||
atime1: 65535
|
||||
atime2: 0
|
||||
atime3: 0
|
||||
atime4: 0
|
||||
atime5: 0
|
||||
atime6: 0
|
||||
atime7: 0
|
||||
m_Mode: 0
|
||||
m_NumColorKeys: 2
|
||||
m_NumAlphaKeys: 2
|
||||
numCornerVertices: 0
|
||||
numCapVertices: 0
|
||||
alignment: 0
|
||||
textureMode: 0
|
||||
shadowBias: 0.5
|
||||
generateLightingData: 0
|
||||
m_UseWorldSpace: 0
|
||||
m_Loop: 0
|
||||
--- !u!50 &864575671400655605
|
||||
Rigidbody2D:
|
||||
serializedVersion: 4
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 864575671400655609}
|
||||
m_BodyType: 1
|
||||
m_Simulated: 1
|
||||
m_UseFullKinematicContacts: 0
|
||||
m_UseAutoMass: 0
|
||||
m_Mass: 1
|
||||
m_LinearDrag: 0
|
||||
m_AngularDrag: 0.05
|
||||
m_GravityScale: 1
|
||||
m_Material: {fileID: 0}
|
||||
m_Interpolate: 0
|
||||
m_SleepingMode: 1
|
||||
m_CollisionDetection: 0
|
||||
m_Constraints: 0
|
||||
--- !u!114 &864575671400655606
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 864575671400655609}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 59d291ec6f533ad48aff5b4e42e5b1c6, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
rb2d: {fileID: 864575671400655605}
|
||||
shrinkSpeed: 3
|
||||
--- !u!1 &864575672589497939
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 864575672589497938}
|
||||
- component: {fileID: 864575672589497937}
|
||||
m_Layer: 0
|
||||
m_Name: GameObject
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &864575672589497938
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 864575672589497939}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 0.96, y: 0.96, z: 0.96}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 864575671400655607}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!68 &864575672589497937
|
||||
EdgeCollider2D:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 864575672589497939}
|
||||
m_Enabled: 1
|
||||
m_Density: 1
|
||||
m_Material: {fileID: 0}
|
||||
m_IsTrigger: 0
|
||||
m_UsedByEffector: 0
|
||||
m_UsedByComposite: 0
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_EdgeRadius: 0
|
||||
m_Points:
|
||||
- {x: -0.565, y: 0.68}
|
||||
- {x: -0.95, y: 0}
|
||||
- {x: -0.5, y: -0.8}
|
||||
- {x: 0.5, y: -0.8}
|
||||
- {x: 0.95, y: 0}
|
||||
- {x: 0.565, y: 0.68}
|
7
Assets/Scripts/Game14/Hexagon.prefab.meta
Normal file
7
Assets/Scripts/Game14/Hexagon.prefab.meta
Normal file
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 7292b525b5d406544b5610804c458b15
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
48
Assets/Scripts/GameController.cs
Normal file
48
Assets/Scripts/GameController.cs
Normal file
|
@ -0,0 +1,48 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
public class GameController : MonoBehaviour{
|
||||
|
||||
public string menuScene;
|
||||
public string[] scenes;
|
||||
public bool reversed;
|
||||
public Image timeBar;
|
||||
public float maxTime;
|
||||
float currentTime;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start(){
|
||||
currentTime = maxTime;
|
||||
if (PlayerPrefs.HasKey("CurrentScore")){
|
||||
PlayerPrefs.SetInt("CurrentScore", PlayerPrefs.GetInt("CurrentScore") + 1);
|
||||
}else{
|
||||
PlayerPrefs.SetInt("CurrentScore", 0);
|
||||
}
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update(){
|
||||
currentTime -= 1 * Time.deltaTime;
|
||||
timeBar.transform.localScale = new Vector2(currentTime / maxTime, timeBar.transform.localScale.y);
|
||||
if(currentTime <= 0){
|
||||
if (reversed){
|
||||
CompleteLevel();
|
||||
}else{
|
||||
LoseGame();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void CompleteLevel(){
|
||||
string scene = scenes[Random.Range(0, scenes.Length - 1)];
|
||||
LevelLoader.Instance.LoadLevel(scene);
|
||||
}
|
||||
|
||||
public void LoseGame(){
|
||||
Debug.LogError(SceneManager.GetActiveScene().name);
|
||||
LevelLoader.Instance.LoadLevel(menuScene);
|
||||
}
|
||||
}
|
11
Assets/Scripts/GameController.cs.meta
Normal file
11
Assets/Scripts/GameController.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 0e16bd766ffa5df48b2adecad592f70c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Loading…
Add table
Add a link
Reference in a new issue