diff --git a/Assets/Scenes/Level_01.unity b/Assets/Scenes/Level_01.unity index c476fc130df7b62f14f93f321f0c46da9cfbc4c8..9777a30b387860ca26214699926fceb0f79fb327 100644 --- a/Assets/Scenes/Level_01.unity +++ b/Assets/Scenes/Level_01.unity @@ -38,7 +38,7 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0.45061463, g: 0.4986083, b: 0.5643749, a: 1} + m_IndirectSpecularColor: {r: 0.45061505, g: 0.498609, b: 0.56437516, a: 1} m_UseRadianceAmbientProbe: 0 --- !u!157 &3 LightmapSettings: @@ -7213,7 +7213,7 @@ GameObject: - component: {fileID: 1733453810} - component: {fileID: 1733453809} m_Layer: 5 - m_Name: Score + m_Name: TimeSurvival m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -7247,7 +7247,7 @@ MonoBehaviour: m_GameObject: {fileID: 1733453807} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 86e378bc199fbd343bceabbd3a16d73e, type: 3} + m_Script: {fileID: 11500000, guid: 7bccca8b40843e648b4854db6e9b97f7, type: 3} m_Name: m_EditorClassIdentifier: --- !u!114 &1733453810 @@ -7283,7 +7283,7 @@ MonoBehaviour: m_HorizontalOverflow: 0 m_VerticalOverflow: 0 m_LineSpacing: 1 - m_Text: SCore + m_Text: time --- !u!222 &1733453811 CanvasRenderer: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/Managers/TimeSurvival.cs b/Assets/Scripts/Managers/TimeSurvival.cs new file mode 100644 index 0000000000000000000000000000000000000000..1ddd83e9f2b7fe32429535d978a6688cf0caa46f --- /dev/null +++ b/Assets/Scripts/Managers/TimeSurvival.cs @@ -0,0 +1,53 @@ +using UnityEngine; +using UnityEngine.UI; +using System.Collections; + +public class TimeSurvival : MonoBehaviour +{ + public static int time; + int survive; + int j; + int m; + int d; + string str_j; + string str_m; + string str_d; + + Text text; + + + void Awake () + { + text = GetComponent<Text>(); + time = 0; + } + + + void Update () + { + time += 1; + survive = (int)(time*0.01); + j = survive/3600; + m = (survive-(j*3600))/60; + d = survive-(j*3600)-(m*60); + if (j<10){ + str_j = "0"+j; + } + else{ + str_j = j.ToString(); + } + if (m<10){ + str_m = "0"+m; + } + else{ + str_m = m.ToString(); + } + if (d<10){ + str_d = "0"+d; + } + else{ + str_d = d.ToString(); + } + text.text = str_j+":" +str_m+":"+str_d ; + } +} diff --git a/Assets/Scripts/Managers/TimeSurvival.cs.meta b/Assets/Scripts/Managers/TimeSurvival.cs.meta new file mode 100644 index 0000000000000000000000000000000000000000..11252f504adaf7d21c131f13b20965882cf3edc2 --- /dev/null +++ b/Assets/Scripts/Managers/TimeSurvival.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7bccca8b40843e648b4854db6e9b97f7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: