game: timer text
This commit is contained in:
parent
d1ff77f57c
commit
403195fdc8
3 changed files with 38 additions and 67 deletions
|
@ -469,67 +469,6 @@ Transform:
|
||||||
m_CorrespondingSourceObject: {fileID: 4704910962696626565, guid: 00134d40eee1ff84eb904a98548ec295, type: 3}
|
m_CorrespondingSourceObject: {fileID: 4704910962696626565, guid: 00134d40eee1ff84eb904a98548ec295, type: 3}
|
||||||
m_PrefabInstance: {fileID: 448564655}
|
m_PrefabInstance: {fileID: 448564655}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
--- !u!1001 &19932811
|
|
||||||
PrefabInstance:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
serializedVersion: 2
|
|
||||||
m_Modification:
|
|
||||||
serializedVersion: 3
|
|
||||||
m_TransformParent: {fileID: 0}
|
|
||||||
m_Modifications:
|
|
||||||
- target: {fileID: 987810662684709338, guid: e82a63e1655bf9645aba4697304f862d, type: 3}
|
|
||||||
propertyPath: m_LocalPosition.x
|
|
||||||
value: 732.117
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 987810662684709338, guid: e82a63e1655bf9645aba4697304f862d, type: 3}
|
|
||||||
propertyPath: m_LocalPosition.y
|
|
||||||
value: 11.630854
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 987810662684709338, guid: e82a63e1655bf9645aba4697304f862d, type: 3}
|
|
||||||
propertyPath: m_LocalPosition.z
|
|
||||||
value: 457.699
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 987810662684709338, guid: e82a63e1655bf9645aba4697304f862d, type: 3}
|
|
||||||
propertyPath: m_LocalRotation.w
|
|
||||||
value: -0.00000016391273
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 987810662684709338, guid: e82a63e1655bf9645aba4697304f862d, type: 3}
|
|
||||||
propertyPath: m_LocalRotation.x
|
|
||||||
value: 2.3092636e-14
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 987810662684709338, guid: e82a63e1655bf9645aba4697304f862d, type: 3}
|
|
||||||
propertyPath: m_LocalRotation.y
|
|
||||||
value: 1
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 987810662684709338, guid: e82a63e1655bf9645aba4697304f862d, type: 3}
|
|
||||||
propertyPath: m_LocalRotation.z
|
|
||||||
value: 0.000000014901159
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 987810662684709338, guid: e82a63e1655bf9645aba4697304f862d, type: 3}
|
|
||||||
propertyPath: m_LocalEulerAnglesHint.x
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 987810662684709338, guid: e82a63e1655bf9645aba4697304f862d, type: 3}
|
|
||||||
propertyPath: m_LocalEulerAnglesHint.y
|
|
||||||
value: -180
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 987810662684709338, guid: e82a63e1655bf9645aba4697304f862d, type: 3}
|
|
||||||
propertyPath: m_LocalEulerAnglesHint.z
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 7198325426086921740, guid: e82a63e1655bf9645aba4697304f862d, type: 3}
|
|
||||||
propertyPath: m_Name
|
|
||||||
value: Spawnable_Doc
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 7198325426086921740, guid: e82a63e1655bf9645aba4697304f862d, type: 3}
|
|
||||||
propertyPath: m_IsActive
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
m_RemovedComponents: []
|
|
||||||
m_RemovedGameObjects: []
|
|
||||||
m_AddedGameObjects: []
|
|
||||||
m_AddedComponents: []
|
|
||||||
m_SourcePrefab: {fileID: 100100000, guid: e82a63e1655bf9645aba4697304f862d, type: 3}
|
|
||||||
--- !u!1001 &20416343
|
--- !u!1001 &20416343
|
||||||
PrefabInstance:
|
PrefabInstance:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
@ -37474,6 +37413,17 @@ Transform:
|
||||||
m_CorrespondingSourceObject: {fileID: 8950253087972865307, guid: 300994ef4bdec2a42b6dd3eabe7270e2, type: 3}
|
m_CorrespondingSourceObject: {fileID: 8950253087972865307, guid: 300994ef4bdec2a42b6dd3eabe7270e2, type: 3}
|
||||||
m_PrefabInstance: {fileID: 1123801392}
|
m_PrefabInstance: {fileID: 1123801392}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
--- !u!114 &1124183581 stripped
|
||||||
|
MonoBehaviour:
|
||||||
|
m_CorrespondingSourceObject: {fileID: 4562939406878164559, guid: 298bd5f29cfba0b409e325602c23f9a6, type: 3}
|
||||||
|
m_PrefabInstance: {fileID: 3957114709122374967}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 0}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
--- !u!1001 &1125101797
|
--- !u!1001 &1125101797
|
||||||
PrefabInstance:
|
PrefabInstance:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
@ -55165,7 +55115,8 @@ MonoBehaviour:
|
||||||
m_Script: {fileID: 11500000, guid: 0bab791ccf13189449b82b8f0b70b269, type: 3}
|
m_Script: {fileID: 11500000, guid: 0bab791ccf13189449b82b8f0b70b269, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
shiftDuration: 120
|
shiftDuration: 180
|
||||||
|
timerText: {fileID: 1124183581}
|
||||||
--- !u!65 &1779211428
|
--- !u!65 &1779211428
|
||||||
BoxCollider:
|
BoxCollider:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
@ -64885,6 +64836,10 @@ PrefabInstance:
|
||||||
propertyPath: m_Name
|
propertyPath: m_Name
|
||||||
value: digitalClock
|
value: digitalClock
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 4562939406878164559, guid: 298bd5f29cfba0b409e325602c23f9a6, type: 3}
|
||||||
|
propertyPath: m_text
|
||||||
|
value: 3:00
|
||||||
|
objectReference: {fileID: 0}
|
||||||
m_RemovedComponents: []
|
m_RemovedComponents: []
|
||||||
m_RemovedGameObjects: []
|
m_RemovedGameObjects: []
|
||||||
m_AddedGameObjects: []
|
m_AddedGameObjects: []
|
||||||
|
@ -67154,7 +67109,6 @@ SceneRoots:
|
||||||
- {fileID: 9021714893489400252}
|
- {fileID: 9021714893489400252}
|
||||||
- {fileID: 3957114709122374967}
|
- {fileID: 3957114709122374967}
|
||||||
- {fileID: 1195857307}
|
- {fileID: 1195857307}
|
||||||
- {fileID: 19932811}
|
|
||||||
- {fileID: 1626285534}
|
- {fileID: 1626285534}
|
||||||
- {fileID: 181151630}
|
- {fileID: 181151630}
|
||||||
- {fileID: 990127396}
|
- {fileID: 990127396}
|
||||||
|
|
|
@ -70,7 +70,7 @@ public class DayManager : MonoBehaviour
|
||||||
Debug.Log("Day completed!");
|
Debug.Log("Day completed!");
|
||||||
/*Backend.instance.User.daysPlayed += 1;
|
/*Backend.instance.User.daysPlayed += 1;
|
||||||
Debug.Log(Backend.instance.User.daysPlayed);*/
|
Debug.Log(Backend.instance.User.daysPlayed);*/
|
||||||
shiftManagerScript.AllowShiftStart();
|
/*shiftManagerScript.AllowShiftStart();*/
|
||||||
Debug.Log("You can start another shift!");
|
Debug.Log("You can start another shift!");
|
||||||
|
|
||||||
doneAShift = false;
|
doneAShift = false;
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
|
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using TMPro;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
public class ShiftManager : MonoBehaviour
|
public class ShiftManager : MonoBehaviour
|
||||||
|
@ -32,6 +33,11 @@ public class ShiftManager : MonoBehaviour
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private DayManager dayManager;
|
private DayManager dayManager;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Displaying the timer
|
||||||
|
/// </summary>
|
||||||
|
public TextMeshProUGUI timerText;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Assigning variables and references
|
/// Assigning variables and references
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -72,6 +78,7 @@ public class ShiftManager : MonoBehaviour
|
||||||
while (remainingTime > 0)
|
while (remainingTime > 0)
|
||||||
{
|
{
|
||||||
remainingTime -= Time.deltaTime;
|
remainingTime -= Time.deltaTime;
|
||||||
|
UpdateTimerText();
|
||||||
|
|
||||||
if (Player.score < 0)
|
if (Player.score < 0)
|
||||||
{
|
{
|
||||||
|
@ -92,8 +99,8 @@ public class ShiftManager : MonoBehaviour
|
||||||
{
|
{
|
||||||
Debug.Log("Shift ended!");
|
Debug.Log("Shift ended!");
|
||||||
|
|
||||||
/*npcSpawnArea.SetActive(false);*/
|
|
||||||
remainingTime = shiftDuration;
|
remainingTime = shiftDuration;
|
||||||
|
timerText.text = "3:00";
|
||||||
gm.shiftStarted = false;
|
gm.shiftStarted = false;
|
||||||
dayManager.doneAShift = true;
|
dayManager.doneAShift = true;
|
||||||
NpcManager.instance.EndDay();
|
NpcManager.instance.EndDay();
|
||||||
|
@ -102,8 +109,18 @@ public class ShiftManager : MonoBehaviour
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Start next day shift
|
/// Start next day shift
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void AllowShiftStart()
|
/*public void AllowShiftStart()
|
||||||
{
|
{
|
||||||
shiftTrigger.enabled = true;
|
shiftTrigger.enabled = true;
|
||||||
|
}*/
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Formatting timer text
|
||||||
|
/// </summary>
|
||||||
|
void UpdateTimerText()
|
||||||
|
{
|
||||||
|
int minutes = Mathf.FloorToInt(remainingTime / 60);
|
||||||
|
int seconds = Mathf.FloorToInt(remainingTime % 60);
|
||||||
|
timerText.text = string.Format("{0}:{1:00}", minutes, seconds);
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue