Commit c794b085 authored by Mitchie Maluschnig's avatar Mitchie Maluschnig
Browse files

trapexe has an exit box

parent eea8fa5e
......@@ -196,6 +196,81 @@ Transform:
m_Father: {fileID: 0}
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &364275912
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 364275913}
- component: {fileID: 364275915}
- component: {fileID: 364275914}
m_Layer: 5
m_Name: Text
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &364275913
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 364275912}
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: []
m_Father: {fileID: 976232472}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 22}
m_SizeDelta: {x: 280, y: 52.7}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &364275914
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 364275912}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 46
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 10
m_MaxSize: 56
m_Alignment: 4
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: Times Up!
--- !u!222 &364275915
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 364275912}
m_CullTransparentMesh: 0
--- !u!1001 &492708971
Prefab:
m_ObjectHideFlags: 0
......@@ -759,6 +834,8 @@ MonoBehaviour:
ScoreText: {fileID: 697255628}
CollectedText: {fileID: 668722156}
TimeRemainingText: {fileID: 738134078}
GameOverPanel: {fileID: 976232471}
exitText: {fileID: 2108172357}
--- !u!4 &847592695
Transform:
m_ObjectHideFlags: 0
......@@ -1158,6 +1235,77 @@ Prefab:
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: d9eae21df7f7349429f09e42b02d7a23, type: 2}
m_IsPrefabAsset: 0
--- !u!1 &976232471
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 976232472}
- component: {fileID: 976232474}
- component: {fileID: 976232473}
m_Layer: 5
m_Name: gameOverPanel
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!224 &976232472
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 976232471}
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: 364275913}
- {fileID: 2108172356}
m_Father: {fileID: 1245897939}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 300, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &976232473
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 976232471}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.3773585, g: 0, b: 0, a: 0.6784314}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
--- !u!222 &976232474
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 976232471}
m_CullTransparentMesh: 0
--- !u!1 &1055966190
GameObject:
m_ObjectHideFlags: 0
......@@ -1274,6 +1422,10 @@ Prefab:
propertyPath: m_RootOrder
value: 2
objectReference: {fileID: 0}
- target: {fileID: 1602431506710890, guid: a6dd0ddad611645efbc5ef92c67041a7, type: 2}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: a6dd0ddad611645efbc5ef92c67041a7, type: 2}
m_IsPrefabAsset: 0
......@@ -1392,6 +1544,7 @@ RectTransform:
m_LocalScale: {x: 0, y: 0, z: 0}
m_Children:
- {fileID: 1482713995}
- {fileID: 976232472}
m_Father: {fileID: 0}
m_RootOrder: 9
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
......@@ -1622,7 +1775,7 @@ GameObject:
- component: {fileID: 1482713997}
- component: {fileID: 1482713996}
m_Layer: 5
m_Name: Panel
m_Name: Score
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
......@@ -2487,3 +2640,78 @@ Animator:
m_HasTransformHierarchy: 1
m_AllowConstantClipSamplingOptimization: 1
m_KeepAnimatorControllerStateOnDisable: 0
--- !u!1 &2108172355
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2108172356}
- component: {fileID: 2108172358}
- component: {fileID: 2108172357}
m_Layer: 5
m_Name: Text (1)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &2108172356
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 2108172355}
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: []
m_Father: {fileID: 976232472}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: -22}
m_SizeDelta: {x: 280, y: 52.7}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &2108172357
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 2108172355}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 46
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 10
m_MaxSize: 56
m_Alignment: 4
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: Exit in 5
--- !u!222 &2108172358
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 2108172355}
m_CullTransparentMesh: 0
......@@ -17,8 +17,14 @@ public class TrapezeController : MonoBehaviour {
public Text CollectedText;
public Text TimeRemainingText;
// Use this for initialization
void Start () {
private bool gameOver;
private float exitTime;
public GameObject GameOverPanel;
public Text exitText;
// Use this for initialization
void Start () {
exitTime = Mathf.Infinity;
score = 0;
collected = 0;
......@@ -28,10 +34,20 @@ public class TrapezeController : MonoBehaviour {
// Update is called once per frame
void Update () {
TimeRemaining = finishTime - Time.time;
if (!gameOver) {
TimeRemaining = finishTime - Time.time;
} else {
TimeRemaining = 0;
}
//End of Game
if(TimeRemaining <= 0) {
if(TimeRemaining <= 0 && !gameOver) {
gameOver = true;
exitTime = Time.time + 5;
GameOverPanel.SetActive(true);
}
if (Time.time > exitTime) {
float levels = score / 2000;
GameManager.addToLevel("John", levels);
SceneManager.LoadScene("Daytime");
......@@ -42,6 +58,10 @@ public class TrapezeController : MonoBehaviour {
ScoreText.text = score.ToString();
CollectedText.text = collected.ToString();
TimeRemainingText.text = TimeRemaining.ToString("F1");
if (gameOver) {
exitText.text = "Exit in " + ((int)(exitTime - Time.time + 0.98f)).ToString();
}
}
public static void AddTime(float time) {
......
......@@ -46,14 +46,20 @@ public class TrapezeTutorial : MonoBehaviour {
StartCoroutine(noticePlayer());
}
private void exitTutorial() {
GameManager.JohnTutorial = false;
GameManager.FirstTimeTrapeze = false;
GameManager.TutorialState = 0;
SceneManager.LoadScene("Trapeze");
}
private void Update() {
if (Input.GetKeyDown(KeyCode.Alpha1)) {
if(state <= 3 || state >= 8) {
if (state < 9) {
progress();
} else {
GameManager.JohnTutorial = false;
SceneManager.LoadScene("Trapeze");
exitTutorial();
}
}
}
......@@ -95,8 +101,7 @@ public class TrapezeTutorial : MonoBehaviour {
if (state < 9) {
progress();
} else {
GameManager.JohnTutorial = false;
SceneManager.LoadScene("Trapeze");
exitTutorial();
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment