Skip to content
Snippets Groups Projects
Commit b713cf02 authored by Arjuna Marcelino's avatar Arjuna Marcelino
Browse files

Merge branch 'develop' into 'main'

zen mode : using deltaTime to make timer

See merge request !12
parents 1189aa94 9d512f40
Branches
1 merge request!12zen mode : using deltaTime to make timer
...@@ -4,7 +4,7 @@ using System.Collections; ...@@ -4,7 +4,7 @@ using System.Collections;
public class TimeSurvival : MonoBehaviour public class TimeSurvival : MonoBehaviour
{ {
public static int time; float time;
int survive; int survive;
int j; int j;
int m; int m;
...@@ -25,8 +25,8 @@ public class TimeSurvival : MonoBehaviour ...@@ -25,8 +25,8 @@ public class TimeSurvival : MonoBehaviour
void Update () void Update ()
{ {
time += 1; time += Time.deltaTime;
survive = (int)(time*0.01); survive = (int)(time);
j = survive/3600; j = survive/3600;
m = (survive-(j*3600))/60; m = (survive-(j*3600))/60;
d = survive-(j*3600)-(m*60); d = survive-(j*3600)-(m*60);
......
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