When I use Profiler.BeginSample("Update Example") and Profiler.EndSample() in Update(), I can see "Update Example" in Update.ScriptRunBehaviorUpdate in the profiler window.
But when I use Profiler..."Start Example"... in Start(), I cannot see or find any mention in the profiler. Is there any way to track code in Start()?
using UnityEngine; using UnityEngine.Profiling; public class Example : MonoBehaviour { BoxParameter bParameter; // Start is called before the first frame update void Start() { Profiler.BeginSample("Start Example"); bParameter = GameObject.Find("Main Camera").GetComponent<ZombieInventory>().box; Debug.Log(bParameter.width); Profiler.EndSample(); } // Update is called once per frame void Update() { Profiler.BeginSample("Update Example"); bParameter = GameObject.Find("Main Camera").GetComponent<ZombieInventory>().box; Debug.Log(bParameter.width); Profiler.EndSample(); }