Skip to content

Instantly share code, notes, and snippets.

@baobao
Last active Dec 16, 2018
Embed
What would you like to do?
Required : Unity2018.3.0 Higher
using UnityEngine;
using UnityEngine.Scripting;
public class GCTest : MonoBehaviour
{
void Start()
{
// GCModeの変更イベントの登録
GarbageCollector.GCModeChanged += OnChangeGCMode;
// GCを無効にする
GarbageCollector.GCMode = GarbageCollector.Mode.Disabled;
// GCを有効にする
GarbageCollector.GCMode = GarbageCollector.Mode.Enabled;
}
private void OnChangeGCMode(GarbageCollector.Mode mode)
{
// GarbageCollector.Modeが切り替わったら呼ばれる
Debug.Log(mode);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment