VR Development Framework
v 1.0.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
virtual void AVR.Core.AVR_CameraFade.Update ( )
inlineprotectedvirtual

Definition at line 81 of file AVR_CameraFade.cs.

82  {
83  if (do_fade_in)
84  {
85  float t = Time.time - stime;
86  overlayColor.a = Mathf.Lerp(start_value, end_value, t / fade_in_duration);
87  fadeMaterial.SetColor("_Color", overlayColor);
88 
89  if (t > fade_in_duration)
90  {
91  do_fade_in = false;
92  stime = Time.time;
93  }
94  }
95 
96  if (do_fade_out && !do_fade_in)
97  {
98  float t = Time.time - stime;
99  overlayColor.a = Mathf.Lerp(end_value, start_value, t / fade_out_duration);
100  fadeMaterial.SetColor("_Color", overlayColor);
101 
102  if (t > fade_out_duration)
103  {
104  do_fade_out = false;
105  }
106  }
107  }
float fade_in_duration
Time for fade-in effect to conclude.
float end_value
Ending alpha value of the color
float start_value
Starting alpha value of the color
float fade_out_duration
Time for fade-out effect to conclude.
Color overlayColor
Value of the "_Color" component of the materials shader.