Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.52 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4.  
  5. public class Accuracy : MonoBehaviour
  6. {
  7.     float lastTime = 0f;
  8.  
  9.     void Awake()
  10.     {
  11.         StartCoroutine(MethodA());
  12.     }
  13.  
  14.     IEnumerator MethodA()
  15.     {
  16.         yield return new WaitForSeconds(3.0f);
  17.         lastTime = Time.realtimeSinceStartup;
  18.         Debug.Log(Time.realtimeSinceStartup - lastTime);
  19.         StartCoroutine(MethodA());
  20.     }
  21.  
  22.     void OnApplicationQuit()
  23.     {
  24.         StopAllCoroutines();
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement