loudixvmuniu/Assets/_Scripts/TimeScaleController.cs

39 lines
922 B
C#
Raw Normal View History

2025-04-01 16:16:45 +08:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class TimeScaleController : MonoBehaviour
{
[Range(0, 10)]
public float animSpeed = 1.0f;
private void Update()
{
Time.timeScale = animSpeed;
if (Input.GetKeyUp(KeyCode.F8))
{
animSpeed++;
}
if (Input.GetKeyUp(KeyCode.F7))
{
animSpeed--;
}
if (Input.GetKeyUp(KeyCode.F12))
{
animSpeed = 1;
}
if (Input.GetKeyUp(KeyCode.F11))
{
animSpeed = 0;
}
if (Input.GetKey(KeyCode.LeftControl) || Input.GetKey(KeyCode.RightControl))
{
if (Input.GetKeyDown(KeyCode.C))
{
string str = string.Empty;
str = $"{gameObject.transform.position}|{gameObject.transform.eulerAngles}";
}
}
}
}