我不加入Profiler.BeginSample的话,也是可以看到NewBehaviourScriptxxx的Update方法被调用的。
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Profiling;
public class NewBehaviourScriptxxx : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
Profiler.BeginSample("xxxxx");
SayHello();
Profiler.EndSample();
SayHello2();
}
void SayHello()
{
}
void SayHello2()
{
}
}
加了之后呢?