Created
November 14, 2014 22:00
-
-
Save DevEarley/79ae3c98431ea5670042 to your computer and use it in GitHub Desktop.
SlowTimeOnClick
This file contains hidden or 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 UnityEngine; | |
using System.Collections; | |
public class SlowTimeOnClick : MonoBehaviour { | |
void Update() { | |
if (Input.GetButtonDown("Fire1")) { | |
if (Time.timeScale == 1.0F) | |
Time.timeScale = 0.7F; | |
else | |
Time.timeScale = 1.0F; | |
Time.fixedDeltaTime = 0.02F * Time.timeScale; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment