slomotion in unity 3d
using UnityEngine;
using System.Collections;
public class SlowMotion : MonoBehaviour {
float currentAmount = 0f;
float maxAmount = 5f;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
if(Input.GetKeyDown ("insert any key here")){
if(Time.timeScale == 1.0f)
Time.timeScale = 0.3f;
else
Time.timeScale = 1.0f;
Time.fixedDeltaTime = 0.02f * Time.timeScale;
}
if(Time.timeScale == 0.03f){
currentAmount += Time.deltaTime;
}
if(currentAmount > maxAmount){
currentAmount = 0f;
Time.timeScale = 1.0f;
}
}
}
Also in C#:
- c# join string array
- c# console delay
- validating file upload asp.net core mvc
- if entity.is Transient() Update Mvc 5 c#
- how to put double quotes in a string c#
- get string character by index c#
- c# get current directory xamarin
- s3 upload base64 .net core
- loop over enum values
- rotatearound unity
- how to stream video from vlc in c#
- double tryparse dot comma
- sending data photon c#
- unity get child
- c# download string url
- ASP select box all states
- change Backcolor c#
- c# expandoobject indexer
- c# clone stream
- C# invoke
- convert array to list Unity C#
- unity get velocity of gameobject
- c# string
- unity c# public all codes