using UnityEngine; using System; using System.Collections; namespace MacGruber { public class GarbageCollector : MVRScript { private void OnEnable() { StartCoroutine(Collect()); } private void OnDisable() { StopAllCoroutines(); } IEnumerator Collect() { while (true) { yield return new WaitForSeconds(1.0f); GC.Collect(); } } } }