Created
November 4, 2017 14:12
-
-
Save tsubaki/51f401df459ca268c9c247dc08de1fe7 to your computer and use it in GitHub Desktop.
0.5ms以上の負荷を計上したら止める
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEngine.Profiling; | |
public class ProfileTest : MonoBehaviour { | |
Recorder recorder, hit; | |
void Awake() | |
{ | |
recorder = Recorder.Get("FixedUpdate.PhysicsFixedUpdate"); | |
recorder.enabled = true; | |
} | |
void Update() | |
{ | |
if (recorder.elapsedNanoseconds > 5000000f) { | |
UnityEditor.EditorApplication.isPaused = true; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment