示例#1
0
 /**
  * This overlays Debug information onto the screen if enabled in the SeebrightSDK. Also checks the remote status and shows whether it's connected or not.
  * Shows both 2D/3D cursor information, the Normalized camera rotation, and the Remote Output.
  */
 void OnGUI()
 {
     if (cursorStyle == null)
     {
         cursorStyle                  = new GUIStyle();
         cursorStyle.fontSize         = 20;
         cursorStyle.fontStyle        = FontStyle.Bold;
         cursorStyle.normal.textColor = Color.white;
     }
     if (enableDebugOutput)
     {
         if (currentCamera.enableGyroCam)
         {
             writeGUI(GUI_LABEL, 25, -200, 100, 100, "NormalizedCamera: \nx:" +
                      SBCamera.normalizedLookRotation.eulerAngles.x + "\ny:" +
                      SBCamera.normalizedLookRotation.eulerAngles.y + "\nz:" +
                      SBCamera.normalizedLookRotation.eulerAngles.z);
         }
                     #if (UNITY_IPHONE || UNITY_ANDROID) && !UNITY_EDITOR
         writeGUI(GUI_LABEL, Screen.width / 4 - 200, 160, 400, 50, "UnityEdit: " + SBRemote.printRemoteControls());
                     #endif
     }
             #if (UNITY_IPHONE || UNITY_ANDROID) && !UNITY_EDITOR
     SBRemote.updateRemoteStatus();
     if (SBRemote.remoteStatus)
     {
         if (sleepTimer <= timeTillSleep)
         {
             writeGUI(GUI_LABEL, (Screen.width / 4) - 200, 100, 400, 50, "Remote Connected");
             sleepTimer += Time.deltaTime;
         }
     }
     else
     {
         sleepTimer = 0.0f;
         writeGUI(GUI_LABEL, (Screen.width / 4) - 200, 100, 400, 50, "Remote Disconnected");
     }
             #endif
 }