SlowMotionEffect

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class SlowMotionEffect : MonoBehaviour {

 FMOD.Studio.EventInstance BT;
 FMOD.Studio.ParameterInstance I;

 float GameSpeed;

 void Awake ()
 {
  BT = FMODUnity.RuntimeManager.CreateInstance ("snapshot:/Bullet Time Script");
  BT.getParameter ("SnapShot Intensity",out I);
  BT.start ();
 }

 void Update() {
  I.setValue (GameSpeed);
  Time.timeScale = GameSpeed;
  if (Input.GetKey (KeyCode.Q)) {
   GameSpeed = 0.5f;
  } else {
   GameSpeed = 1f;
  }
 }
}
Back