private void OnHandleRecord(Record record) { foreach (var kvp in m_RecorderDic) { IRecorder recorder = kvp.Value; if (typeof(IHandleRecorder).IsAssignableFrom(recorder.GetType())) { if (Debug.isDebugBuild) { Profiler.BeginSample($"GPerfSampler-HandleRecord:{recorder.Type}"); ((IHandleRecorder)recorder).HandleRecord(record); Profiler.EndSample(); } else { ((IHandleRecorder)recorder).HandleRecord(record); } } } }