39 lines
922 B
C#
39 lines
922 B
C#
|
|
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}";
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|