private void LateUpdate()
 {
     frameCount = Time.frameCount;
     count++;
     deltaTime += Time.unscaledDeltaTime;
     if (deltaTime >= showTime)
     {
         fps       = count / deltaTime;
         count     = 0;
         deltaTime = 0f;
     }
     if (Time.unscaledTime - currentTime > DELTA_TIME)
     {
         pss         = NativeHelper.GetPass();
         power       = NativeHelper.GetBatteryLevel();
         currentTime = Time.unscaledTime;
     }
     if ((Input.touchCount == 4 && Input.touches[0].phase == TouchPhase.Began) || Input.GetKeyDown(KeyCode.Escape))
     {
         needShowMenu = !needShowMenu;
         if (needShowMenu)
         {
             Menu.EnableMenu(gameObject);
         }
         else
         {
             Menu.DisableMenu();
         }
     }
 }
Esempio n. 2
0
 private void LateUpdate()
 {
     if (actionQueue.Count > 0)
     {
         lock (actionQueue)
         {
             while (actionQueue.Count > 0)
             {
                 actionQueue.Dequeue()();
             }
         }
     }
     SampleData.frameCount = Time.frameCount;
     count++;
     deltaTime += Time.unscaledDeltaTime;
     if (deltaTime >= showTime)
     {
         SampleData.fps = count / deltaTime;
         count          = 0;
         deltaTime      = 0f;
     }
     if (Time.unscaledTime - currentTime > DELTA_TIME)
     {
         SampleData.pss   = NativeHelper.GetPass();
         SampleData.power = NativeHelper.GetBatteryLevel();
         currentTime      = Time.unscaledTime;
     }
     LuaProfiler.SendFrameSample();
     if (Input.touchCount == 4 || Input.GetKeyDown(KeyCode.Delete))
     {
         needShowMenu = !needShowMenu;
         if (needShowMenu)
         {
             Menu.EnableMenu(gameObject);
         }
         else
         {
             Menu.DisableMenu();
         }
     }
 }