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

zen mode : using deltaTime to make timer

parent df5cc9ac
Branches
2 merge requests!12zen mode : using deltaTime to make timer,!11zen mode : using deltaTime to make timer
......@@ -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);
......
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