count dead time

master
Jordan Orelli 5 years ago
parent 7a7a39d500
commit cc785bd54d

@ -923,7 +923,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
--- !u!1001 &174537337
PrefabInstance:
@ -2193,7 +2193,7 @@ PrefabInstance:
- target: {fileID: 7525036764583245661, guid: f97b2236cb22fbc46a20b65f13071959,
type: 3}
propertyPath: m_RootOrder
value: 1
value: 3
objectReference: {fileID: 0}
- target: {fileID: 7525036764583245661, guid: f97b2236cb22fbc46a20b65f13071959,
type: 3}
@ -3408,7 +3408,7 @@ Transform:
m_LocalScale: {x: 10, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 7
m_RootOrder: 9
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &700183972
PrefabInstance:
@ -3580,7 +3580,7 @@ Transform:
m_LocalScale: {x: 10, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 8
m_RootOrder: 10
m_LocalEulerAnglesHint: {x: 0, y: 90, z: 0}
--- !u!4 &709395960 stripped
Transform:
@ -4721,7 +4721,7 @@ PrefabInstance:
- target: {fileID: 7525036764583245661, guid: f97b2236cb22fbc46a20b65f13071959,
type: 3}
propertyPath: m_RootOrder
value: 9
value: 11
objectReference: {fileID: 0}
- target: {fileID: 7525036764583245661, guid: f97b2236cb22fbc46a20b65f13071959,
type: 3}
@ -5647,7 +5647,7 @@ Transform:
- {fileID: 878735556}
- {fileID: 2088785584}
m_Father: {fileID: 0}
m_RootOrder: 5
m_RootOrder: 7
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &1078578485
PrefabInstance:
@ -6101,7 +6101,7 @@ Transform:
m_LocalScale: {x: 5, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 4
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &1170678456 stripped
Transform:
@ -6178,6 +6178,83 @@ PrefabInstance:
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: f97b2236cb22fbc46a20b65f13071959, type: 3}
--- !u!1 &1178488471
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1178488472}
- component: {fileID: 1178488474}
- component: {fileID: 1178488473}
m_Layer: 5
m_Name: Congratulations Text
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1178488472
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1178488471}
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: 1522652361}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 1}
m_AnchorMax: {x: 0.5, y: 1}
m_AnchoredPosition: {x: 0, y: -200}
m_SizeDelta: {x: 600, y: 400}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1178488473
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1178488471}
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: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 32
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 3
m_MaxSize: 40
m_Alignment: 4
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: Congratulations
--- !u!222 &1178488474
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1178488471}
m_CullTransparentMesh: 0
--- !u!4 &1179932971 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 7525036764583245661, guid: f97b2236cb22fbc46a20b65f13071959,
@ -6303,7 +6380,7 @@ PrefabInstance:
- target: {fileID: 7525036764583245661, guid: f97b2236cb22fbc46a20b65f13071959,
type: 3}
propertyPath: m_RootOrder
value: 10
value: 12
objectReference: {fileID: 0}
- target: {fileID: 7525036764583245661, guid: f97b2236cb22fbc46a20b65f13071959,
type: 3}
@ -7771,6 +7848,120 @@ PrefabInstance:
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: f97b2236cb22fbc46a20b65f13071959, type: 3}
--- !u!1 &1522652357
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1522652361}
- component: {fileID: 1522652360}
- component: {fileID: 1522652359}
- component: {fileID: 1522652358}
- component: {fileID: 1522652362}
m_Layer: 5
m_Name: HUD
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!114 &1522652358
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1522652357}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1301386320, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_IgnoreReversedGraphics: 1
m_BlockingObjects: 0
m_BlockingMask:
serializedVersion: 2
m_Bits: 4294967295
--- !u!114 &1522652359
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1522652357}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1980459831, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_UiScaleMode: 1
m_ReferencePixelsPerUnit: 100
m_ScaleFactor: 1
m_ReferenceResolution: {x: 1024, y: 768}
m_ScreenMatchMode: 0
m_MatchWidthOrHeight: 0
m_PhysicalUnit: 3
m_FallbackScreenDPI: 96
m_DefaultSpriteDPI: 96
m_DynamicPixelsPerUnit: 1
--- !u!223 &1522652360
Canvas:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1522652357}
m_Enabled: 1
serializedVersion: 3
m_RenderMode: 0
m_Camera: {fileID: 0}
m_PlaneDistance: 100
m_PixelPerfect: 0
m_ReceivesEvents: 1
m_OverrideSorting: 0
m_OverridePixelPerfect: 0
m_SortingBucketNormalizedSize: 0
m_AdditionalShaderChannelsFlag: 0
m_SortingLayerID: 0
m_SortingOrder: 0
m_TargetDisplay: 0
--- !u!224 &1522652361
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1522652357}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0, y: 0, z: 0}
m_Children:
- {fileID: 1178488472}
- {fileID: 1820516942}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 0}
--- !u!114 &1522652362
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1522652357}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b673f78a75063754a99748fcd3162f81, type: 3}
m_Name:
m_EditorClassIdentifier:
deadText: {fileID: 1820516943}
--- !u!1001 &1550689737
PrefabInstance:
m_ObjectHideFlags: 0
@ -8845,6 +9036,83 @@ PrefabInstance:
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: f97b2236cb22fbc46a20b65f13071959, type: 3}
--- !u!1 &1820516941
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1820516942}
- component: {fileID: 1820516944}
- component: {fileID: 1820516943}
m_Layer: 5
m_Name: Dead Time Text
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1820516942
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1820516941}
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: 1522652361}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0}
m_AnchorMax: {x: 0.5, y: 0}
m_AnchoredPosition: {x: 0, y: 150}
m_SizeDelta: {x: 400, y: 300}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1820516943
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1820516941}
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: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 44
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 10
m_MaxSize: 67
m_Alignment: 4
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: You have been dead for 30 seconds
--- !u!222 &1820516944
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1820516941}
m_CullTransparentMesh: 0
--- !u!1001 &1821570230
PrefabInstance:
m_ObjectHideFlags: 0
@ -9003,7 +9271,7 @@ Transform:
m_LocalScale: {x: 5, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 6
m_RootOrder: 8
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &1855558603
PrefabInstance:
@ -10286,6 +10554,72 @@ PrefabInstance:
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: f97b2236cb22fbc46a20b65f13071959, type: 3}
--- !u!1 &2068054005
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2068054008}
- component: {fileID: 2068054007}
- component: {fileID: 2068054006}
m_Layer: 0
m_Name: EventSystem
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &2068054006
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2068054005}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1077351063, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_HorizontalAxis: Horizontal
m_VerticalAxis: Vertical
m_SubmitButton: Submit
m_CancelButton: Cancel
m_InputActionsPerSecond: 10
m_RepeatDelay: 0.5
m_ForceModuleActive: 0
--- !u!114 &2068054007
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2068054005}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -619905303, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_FirstSelected: {fileID: 0}
m_sendNavigationEvents: 1
m_DragThreshold: 10
--- !u!4 &2068054008
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2068054005}
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: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &2088785584 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 7525036764583245661, guid: f97b2236cb22fbc46a20b65f13071959,
@ -10604,6 +10938,11 @@ PrefabInstance:
propertyPath: m_Name
value: Player
objectReference: {fileID: 0}
- target: {fileID: 6383496741192187632, guid: cd445451907d7274daea79c67e13a202,
type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6383496741192187647, guid: cd445451907d7274daea79c67e13a202,
type: 3}
propertyPath: m_LocalPosition.x
@ -10642,7 +10981,7 @@ PrefabInstance:
- target: {fileID: 6383496741192187647, guid: cd445451907d7274daea79c67e13a202,
type: 3}
propertyPath: m_RootOrder
value: 3
value: 5
objectReference: {fileID: 0}
- target: {fileID: 6383496741192187647, guid: cd445451907d7274daea79c67e13a202,
type: 3}
@ -10664,6 +11003,11 @@ PrefabInstance:
propertyPath: forwardRayCount
value: 2
objectReference: {fileID: 0}
- target: {fileID: 5588890751565926871, guid: cd445451907d7274daea79c67e13a202,
type: 3}
propertyPath: hud
value:
objectReference: {fileID: 1522652360}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: cd445451907d7274daea79c67e13a202, type: 3}
--- !u!1001 &8206000050524585146
@ -10716,7 +11060,7 @@ PrefabInstance:
- target: {fileID: 8206000050309207787, guid: 212bab9eb4dc1d14ea3e5d9be33ab6f7,
type: 3}
propertyPath: m_RootOrder
value: 2
value: 4
objectReference: {fileID: 0}
- target: {fileID: 8206000050309207787, guid: 212bab9eb4dc1d14ea3e5d9be33ab6f7,
type: 3}

@ -0,0 +1,31 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class HudController : MonoBehaviour {
public Text deadText;
private bool isDead = false;
private float deadTime = 0f;
// Start is called before the first frame update
void Start() {
}
// Update is called once per frame
void Update() {
if (isDead) {
deadTime += Time.deltaTime;
}
deadText.text = string.Format("You have been dead for {0:F1} seconds", deadTime);
}
public void SetDead(bool dead) {
isDead = dead;
if (!dead) {
deadTime = 0f;
}
}
}

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: b673f78a75063754a99748fcd3162f81
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

@ -9,6 +9,7 @@ public class PlayerController : MonoBehaviour {
public float moveSpeed = 6f;
public float accelerationTimeAirborne = 0.2f;
public float accelerationTimeGrounded = 0.05f;
public Canvas hud;
private Vector3 velocity;
private float jumpVelocity;
@ -44,4 +45,13 @@ public class PlayerController : MonoBehaviour {
void FixedUpdate() {
}
void OnDestroy() {
Debug.Log("I'm dead");
hud.gameObject.SetActive(true);
HudController c = hud.gameObject.GetComponent<HudController>();
if (c) {
c.SetDead(true);
}
}
}

Loading…
Cancel
Save