From 784c3fc3386e15c547fc37f073ab4556c0cfb162 Mon Sep 17 00:00:00 2001 From: PopSlime Date: Mon, 21 Nov 2022 14:06:57 +0800 Subject: [PATCH] Disable GUI layout on Unity key receiver to avoid GC. --- Assets/Cryville/Common/Unity/Input/UnityKeyHandler.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Assets/Cryville/Common/Unity/Input/UnityKeyHandler.cs b/Assets/Cryville/Common/Unity/Input/UnityKeyHandler.cs index 43f1e12..a25d0eb 100644 --- a/Assets/Cryville/Common/Unity/Input/UnityKeyHandler.cs +++ b/Assets/Cryville/Common/Unity/Input/UnityKeyHandler.cs @@ -49,6 +49,9 @@ namespace Cryville.Common.Unity.Input { Callback = h; } public abstract string GetKeyName(int type); + void Awake() { + useGUILayout = false; + } void Update() { double time = Time.realtimeSinceStartupAsDouble; foreach (var k in Keys) {