Advertisement
SizilStank

Untitled

Oct 21st, 2022
1,123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.58 KB | Gaming | 0 0
  1. private void ThrusterCheck()
  2.     {
  3.         if (_thrustMax <= _thrustMin)
  4.         {
  5.             _thrustMax = _thrustMin;
  6.             _canThrust = false;
  7.  
  8.             if (_thrustMin == _thrustMax)
  9.             {
  10.                 StartCoroutine(ResettingThruster());              
  11.             }
  12.         }
  13.     }
  14.  
  15.     IEnumerator ResettingThruster()
  16.     {
  17.         yield return new WaitForSeconds(5);
  18.         _thruster.ResetThrusters(_thrustMax = Mathf.Lerp(_min, _max, _fillTime));
  19.         _fillTime += 0.375f * Time.deltaTime;
  20.         _canThrust = true;
  21.         _thrustMin = 0;
  22.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement