Debug.Log Extensions
Documentation (1.1.9)
|
|
static |
Starts a new sub-stopwatch running under a parent stopwatch. If main stopwatch by provided name does not exist yet one will be created.
void Start() { // Prints: // LoadLevel : Test . . . 14.672 s // Environment . . . 9.671 s // Terrain . . . 0.669 s // Trees . . . 1.999 s // Vegetation . . . 3 s // Actors . . . 5 s LoadLevel("Test"); }
void LoadLevel(string sceneName) { Debug.StartStopwatch($"{nameof(LoadLevel)} : {sceneName}");
SceneManager.LoadScene(sceneName); Load(LoadEnvironment); Load(LoadActors);
void LoadEnvironment() { Load(LoadTerrain);
Load(LoadTrees); Load(LoadVegetation); }
void Load(Action operation) { Debug.StartSubStopwatch(operation.Method.Name);
operation();
parentName | Name of parent stopwatch under which the sub-stopwatch will be nested. |
name | Name of new sub-stopwatch to start. |