1
\$\begingroup\$

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(); } 
\$\endgroup\$

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.