diff --git a/Convention/[Runtime]/Config.cs b/Convention/[Runtime]/Config.cs index 90643e7..71a7544 100644 --- a/Convention/[Runtime]/Config.cs +++ b/Convention/[Runtime]/Config.cs @@ -13,6 +13,7 @@ using UnityEditor; using UnityEngine; using UnityEngine.Events; using UnityEngine.SceneManagement; +using UnityEngine.Scripting; using UnityEngine.UI; namespace UnityEditor @@ -2205,3 +2206,29 @@ namespace Convention } } +namespace Convention +{ + public static partial class ConventionUtility + { + + /// + /// Unity engine function to disable the GC + /// + public static void GC_disable() + { +#if !UNITY_EDITOR + GarbageCollector.GCMode = GarbageCollector.Mode.Disabled; +#endif + } + + /// + /// Unity engine function to enable the GC + /// + public static void GC_enable() + { +#if !UNITY_EDITOR + GarbageCollector.GCMode = GarbageCollector.Mode.Enabled; +#endif + } + } +}