From 6271171ab4cb5e3e293844abe073c4943207a5d5 Mon Sep 17 00:00:00 2001
From: ninemine <1371605831@qq.com>
Date: Fri, 10 Oct 2025 01:00:53 +0800
Subject: [PATCH] Save
---
Convention/[Runtime]/Config.cs | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
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
+ }
+ }
+}