VR Development Framework
v 1.0.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
IEnumerator AVR.Motion.AVR_MovementProvider.FadeDash ( )
inlineprivate

This coroutine is exectued when a fade-dash-movement is performed.

Definition at line 136 of file AVR_MovementProvider.cs.

137  {
138  CameraFadeEffect.StartEffect(); // Shut curtains
139  yield return new WaitWhile(() => CameraFadeEffect.isBusy());
140 
141  // Set active flag
142  dash_origin = playerRig.FeetInWorldSpace;
143  dash_stime = Time.time;
144  tp_in_progress = true;
145 
146  float inter = 0.0f;
147  while(inter < 1.0f) {
148  yield return new WaitForEndOfFrame();
149  inter = ((Time.time - dash_stime) * dash_speed) / (Vector3.Distance(dash_origin, destination));
150  MoveRigToFeetLocation(Vector3.Lerp(dash_origin, destination, inter));
151  }
152 
153  CameraFadeEffect.EndEffect(); // Reopen curtains
154  yield return new WaitWhile(() => CameraFadeEffect.isBusy());
155  tp_in_progress = false; // Reset flag
156  }
abstract bool isBusy()
True if the effect is starting/started or ending but not yet ended.
float dash_speed
When using DASH or FADE_DASH, this determines the speed (in units/s) we travel towards the target loc...
AVR_Effect CameraFadeEffect
CameraFadeEffect used when teleportmode is FADE_COLOR or FADE_DASH.