added record func and key

main
Yogi 2024-12-01 16:22:17 +08:00
parent ba94811f6f
commit a2d10f9dd7
1 changed files with 15 additions and 0 deletions

View File

@ -1,3 +1,4 @@
using System.Text;
using UnityEngine; using UnityEngine;
public class GameManager : MonoBehaviour public class GameManager : MonoBehaviour
@ -40,6 +41,7 @@ public class GameManager : MonoBehaviour
} }
else else
{ {
sb?.AppendLine(msgStr);
var arr = msgStr.Split(','); var arr = msgStr.Split(',');
//¼ÓËÙ¶È //¼ÓËÙ¶È
var ax = float.Parse(arr[0]); var ax = float.Parse(arr[0]);
@ -91,6 +93,8 @@ public class GameManager : MonoBehaviour
brainTrans.rotation = Quaternion.Euler(angleModify); brainTrans.rotation = Quaternion.Euler(angleModify);
} }
private StringBuilder sb;
private void Update() private void Update()
{ {
if (isTestInput) if (isTestInput)
@ -113,6 +117,17 @@ public class GameManager : MonoBehaviour
videoControl.StopPlay(); videoControl.StopPlay();
JustGamePlayNoAnim(); JustGamePlayNoAnim();
} }
if (Input.GetKeyDown(KeyCode.Z))
{
Debug.LogWarning("开始录制");
sb = new StringBuilder();
}
if (Input.GetKeyDown(KeyCode.X))
{
Debug.LogWarning($"录制结束! 参数:\n{sb}");
sb = null;
}
} }
} }
} }