From a2d10f9dd71cd6700ee6480aa16e42aafb677d4b Mon Sep 17 00:00:00 2001 From: Yogi <1273750265@qq.com> Date: Sun, 1 Dec 2024 16:22:17 +0800 Subject: [PATCH] added record func and key --- Assets/Scripts/GameManager.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Assets/Scripts/GameManager.cs b/Assets/Scripts/GameManager.cs index d5cf6d6..8088fea 100644 --- a/Assets/Scripts/GameManager.cs +++ b/Assets/Scripts/GameManager.cs @@ -1,3 +1,4 @@ +using System.Text; using UnityEngine; public class GameManager : MonoBehaviour @@ -40,6 +41,7 @@ public class GameManager : MonoBehaviour } else { + sb?.AppendLine(msgStr); var arr = msgStr.Split(','); //加速度 var ax = float.Parse(arr[0]); @@ -91,6 +93,8 @@ public class GameManager : MonoBehaviour brainTrans.rotation = Quaternion.Euler(angleModify); } + + private StringBuilder sb; private void Update() { if (isTestInput) @@ -113,6 +117,17 @@ public class GameManager : MonoBehaviour videoControl.StopPlay(); JustGamePlayNoAnim(); } + + if (Input.GetKeyDown(KeyCode.Z)) + { + Debug.LogWarning("开始录制"); + sb = new StringBuilder(); + } + if (Input.GetKeyDown(KeyCode.X)) + { + Debug.LogWarning($"录制结束! 参数:\n{sb}"); + sb = null; + } } } }