Skip to content

Instantly share code, notes, and snippets.

@jadepark-dev
Created July 24, 2019 01:36
Show Gist options
  • Save jadepark-dev/78177aa5d34c4b2efb5420137207a55f to your computer and use it in GitHub Desktop.
Save jadepark-dev/78177aa5d34c4b2efb5420137207a55f to your computer and use it in GitHub Desktop.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[RequireComponent(typeof(AppManager))]
public class UserTimer : MonoBehaviour
{
#region Timer Coroutines
public IEnumerator _NoshowTimer(int timeLimit)
{
for (int i = 0; i < timeLimit; i++)
{
Debug.Log("Noshow Timer : " + (timeLimit - i));
yield return new WaitForSeconds(timeLimit / timeLimit);
}
this.gameObject.GetComponent<AppManager>().ToIdleScene();
this.gameObject.GetComponent<AppManager>().noshowTimerStarted = false;
}
public IEnumerator _InteractionTimer(int timeLimit)
{
for (int i = 0; i < timeLimit; i++)
{
Debug.Log("Interaction Timer : " + (timeLimit - i));
yield return new WaitForSeconds(timeLimit / timeLimit);
}
this.gameObject.GetComponent<AppManager>().ToIdleScene();
}
public IEnumerator _LostTrackingTimer(int timeLimit)
{
for (int i = 0; i < timeLimit; i++)
{
Debug.Log("Lost Tracking : " + (timeLimit - i));
yield return new WaitForSeconds(timeLimit / timeLimit);
}
this.gameObject.GetComponent<AppManager>().ToIdleScene();
}
#endregion
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment