SHARE
TWEET

timecontrol

a guest Apr 26th, 2017 81 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void Update()
  2.     {
  3.        
  4.         if (Input.GetKey(KeyCode.B))
  5.         {
  6.             timeSlider.value -= Time.deltaTime / timeFallRate * timeFallMult;
  7.             Clock enemyclock = Timekeeper.instance.Clock("enemy");
  8.             Clock playerclock = Timekeeper.instance.Clock ("player");
  9.  
  10.             enemyclock.localTimeScale = 0.5f;
  11.             playerclock.localTimeScale = 0.5f;
  12.  
  13.             //Not Working
  14.  
  15.             //enemyclock.LerpTimeScale(timeScaleSlow,2,true);
  16.             //player.LerpTimeScale (timeScaleSlow, 2, true);
  17.  
  18.  
  19.             Debug.Log ("slomo active button down");
  20.         }
  21.         else
  22.         {
  23.             timeSlider.value += Time.deltaTime / timeRegainRate * timeRegainMult;
  24.             Clock enemyclock = Timekeeper.instance.Clock("enemy");
  25.             Clock playerclock = Timekeeper.instance.Clock ("player");
  26.  
  27.             enemyclock.localTimeScale = 1;
  28.             playerclock.localTimeScale = 1;
  29.  
  30.             //Not Working
  31.  
  32.             //enemyclock.LerpTimeScale(timeScaleNormal,2,true);
  33.             //playerclock.LerpTimeScale (timeScaleNormal, 2, true);
  34.  
  35.  
  36.  
  37.             Debug.Log ("slomo inactive button up");
  38.         }
  39.  
  40.         if (timeSlider.value >= maxTime)
  41.         {
  42.             timeSlider.value = maxTime;
  43.         }
  44.  
  45.         //Timeslider empty back to normal Time
  46.    
  47.         else if(timeSlider.value <= 0)
  48.  
  49.         {
  50.             timeSlider.value = 0;
  51.             Clock enemyclock = Timekeeper.instance.Clock("enemy");
  52.             Clock playerclock = Timekeeper.instance.Clock ("player");
  53.             enemyclock.localTimeScale = 1;
  54.             playerclock.localTimeScale = 1;
  55.  
  56.             //Not Working
  57.  
  58.             //enemyclock.LerpTimeScale(timeScaleNormal,2,true);
  59.             //playerclock.LerpTimeScale (timeScaleNormal, 2, true);
  60.  
  61.             Debug.Log ("slomo time empty");
  62.         }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top