Skip to content
Snippets Groups Projects

zen mode : using deltaTime to make timer

Merged Arjuna Marcelino requested to merge local-juna into develop
Compare and
1 file
+ 3
3
Preferences
Compare changes
@@ -4,7 +4,7 @@ using System.Collections;
public class TimeSurvival : MonoBehaviour
{
public static int time;
float time;
int survive;
int j;
int m;
@@ -25,8 +25,8 @@ public class TimeSurvival : MonoBehaviour
void Update ()
{
time += 1;
survive = (int)(time*0.01);
time += Time.deltaTime;
survive = (int)(time);
j = survive/3600;
m = (survive-(j*3600))/60;
d = survive-(j*3600)-(m*60);