概要 using UnityEngine; using UnityEngine.Profiling; public class Example : MonoBehaviour { public class Hoge { } public struct Fuga { } private void Start() { var count = 1000000; var samplerA = CustomSampler.Create( "AAAAAAAAAAAAAAAAAAAA" ); samplerA.Begin(); for ( int i = 0; i < count; i++ ) { new Hoge(); } samplerA.End(); var samplerB = CustomSampler.Create( "BBBBBBBBBBBBBBBBBBBB" ); samplerB.Be
![【Unity】クラスと構造体それぞれのインスタンスを生成した時の GC Alloc の違い - コガネブログ](https://cdn-ak-scissors.b.st-hatena.com/image/square/517f60f3780c365ac30cedd08cdf014a210903b5/height=288;version=1;width=512/https%3A%2F%2Fcdn-ak.f.st-hatena.com%2Fimages%2Ffotolife%2Fb%2Fbaba_s%2F20190401%2F20190401101012.png)