Last active
October 3, 2017 06:20
-
-
Save kunofellasleep/8541808faccd5eecf0d266124713f7b7 to your computer and use it in GitHub Desktop.
Unity
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class TimeScaleController : MonoBehaviour { | |
[SerializeField] private float speedupScale = 100.0f; | |
[SerializeField] private float scale = 1.0f; | |
void Update () { | |
//キー押されてる時だけ Timescale加速 | |
if (Input.GetKeyDown (KeyCode.LeftControl)) { | |
Time.timeScale = speedupScale; | |
} | |
//キー離したら 元に戻す | |
if (Input.GetKeyUp (KeyCode.LeftControl)) { | |
Time.timeScale = 1.0f; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment