コード例 #1
0
 // Update is called once per frame
 void Update()
 {
     deltaTime += (Time.unscaledDeltaTime - deltaTime) * 0.1f;
     if (!debugCanvas)
     {
         debugCanvas = FindObjectOfType <ID_DebugCanvas>();
         // if (!debugCanvasGO)
         // {
         //     debugCanvasGO = debugCanvas.gameObject;
         // }
     }
     if (bIsDebug)
     {
         if (Keyboard.current.endKey.wasPressedThisFrame)
         {
             var StatGO = Resources.Load <GameObject>("Prefabs/Debug/StatsMonitor") as GameObject;
             Instantiate(StatGO);
         }
         if (Keyboard.current.homeKey.wasPressedThisFrame)
         {
             bTestFPSLimit = !bTestFPSLimit;
             EnableFPSLimit();
         }
         if (bShowFPS)
         {
             debugCanvasGO.SetActive(true);
         }
         else
         {
             debugCanvasGO.SetActive(false);
         }
     }
 }
コード例 #2
0
 // Start is called before the first frame update
 void Start()
 {
     debugCanvas   = FindObjectOfType <ID_DebugCanvas>();
     debugCanvasGO = debugCanvas.gameObject;
     if (Debug.isDebugBuild || Application.isEditor)
     {
         bIsDebug = true;
         Application.targetFrameRate = testFrameRate;
         if (bShowFPS)
         {
             debugCanvasGO.SetActive(true);
         }
     }
     else
     {
         debugCanvasGO.SetActive(false);
     }
 }