VirtualFramework/Assets/Scripts/TimeScaleController.cs

35 lines
634 B
C#
Raw Normal View History

2024-12-27 17:25:30 +08:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class TimeScaleController : MonoBehaviour
{
[Range(0, 10)]
public float animSpeed = 1.0f;
#if UNITY_EDITOR
private void Update()
{
Time.timeScale = animSpeed;
2024-12-30 11:42:27 +08:00
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;
}
2024-12-27 17:25:30 +08:00
}
#endif
}