예제 #1
0
 // Use this for initialization
 void Awake()
 {
     paused     = false;
     cursorLock = GetComponent <CursorLock> ();
     cursorLock.Lock();
     GameControllerRunnable[] initScripts = GetComponents <GameControllerRunnable> ();
     foreach (GameControllerRunnable gcr in initScripts)
     {
         gcr.Init();
     }
 }
예제 #2
0
 void OnPause()
 {
     paused = !paused;
     if (paused)
     {
         Time.timeScale = 0f;
         cursorLock.Unlock();
     }
     else
     {
         Time.timeScale = 1f;
         cursorLock.Lock();
     }
 }