Мои Уведомления
Привет, !
Мой Аккаунт Мои Финансы Мои Подписки Мои Настройки Выход
Руководство API скрипты

ProfilerRecorderOptions.SumAllSamplesInFrame

Описание

Используйте, чтобы суммировать все выборки в кадре и собирать их как одну выборку на кадр.

using System; using Unity.Profiling; using UnityEngine; public class CollectGCAllocCountExample2 { static void PrintGCAllocCount(Action a) { using (var gcAllocRecorder = ProfilerRecorder.StartNew(ProfilerCategory.Internal, "GC.Alloc", 1, ProfilerRecorderOptions.SumAllSamplesInFrame | ProfilerRecorderOptions.CollectOnlyOnCurrentThread)) { a.Invoke(); gcAllocRecorder.Stop(); var count = gcAllocRecorder.Count == 0 ? 0 : gcAllocRecorder.GetSample(0).Count; Debug.Log("GC allocs count: " + count); } } }
Вы можете отблагодарить автора, за перевод документации на русский язык. ₽ Спасибо
API скрипты 2021.3