@@ -78,24 +78,24 @@ public sealed class Blink : MonoBehaviour
7878
7979 private void Awake ( )
8080 {
81- this . renderer = GetComponent < Renderer > ( ) ;
81+ renderer = GetComponent < Renderer > ( ) ;
8282 }
8383
8484 private void OnEnable ( )
8585 {
86- this . blinking = false ;
87- this . cooldown = false ;
86+ blinking = false ;
87+ cooldown = false ;
8888 }
8989
9090 private void Update ( )
9191 {
92- if ( Time . time >= this . nextUpdateTime )
92+ if ( Time . time >= nextUpdateTime )
9393 {
94- if ( Random . value < this . blinkChance ) {
94+ if ( Random . value < blinkChance ) {
9595 BlinkOnce ( ) ;
9696 }
9797
98- this . nextUpdateTime = Time . time + this . updateInterval ;
98+ nextUpdateTime = Time . time + updateInterval ;
9999 }
100100 }
101101
@@ -104,50 +104,50 @@ private void Update()
104104 /// </summary>
105105 public void BlinkOnce ( )
106106 {
107- if ( this . blinking || this . cooldown ) {
107+ if ( blinking || cooldown ) {
108108 return ;
109109 }
110110
111- this . blinking = true ;
111+ blinking = true ;
112112
113- AssignMaterial ( this . blinkingMaterial ) ;
114- Invoke ( nameof ( FinishBlink ) , this . blinkDuration . Random ( ) ) ;
113+ AssignMaterial ( blinkingMaterial ) ;
114+ Invoke ( nameof ( FinishBlink ) , blinkDuration . Random ( ) ) ;
115115 }
116116
117117 private void FinishBlink ( )
118118 {
119- this . blinking = false ;
119+ blinking = false ;
120120
121- AssignMaterial ( this . notBlinkingMaterial ) ;
121+ AssignMaterial ( notBlinkingMaterial ) ;
122122 Cooldown ( ) ;
123123 }
124124
125125 private void AssignMaterial ( Material material )
126126 {
127- this . renderer . material = material ;
127+ renderer . material = material ;
128128
129- if ( this . sharedRenderers != null )
129+ if ( sharedRenderers != null )
130130 {
131- for ( int i = 0 ; i < this . sharedRenderers . Length ; i ++ ) {
132- this . sharedRenderers [ i ] . material = material ;
131+ for ( int i = 0 ; i < sharedRenderers . Length ; i ++ ) {
132+ sharedRenderers [ i ] . material = material ;
133133 }
134134 }
135135 }
136136
137137 private void Cooldown ( )
138138 {
139- float duration = this . blinkCooldown . Random ( ) ;
139+ float duration = blinkCooldown . Random ( ) ;
140140
141141 if ( duration > 0f )
142142 {
143- this . cooldown = true ;
144- Invoke ( nameof ( CooldownComplete ) , this . blinkCooldown . Random ( ) ) ;
143+ cooldown = true ;
144+ Invoke ( nameof ( CooldownComplete ) , blinkCooldown . Random ( ) ) ;
145145 }
146146 }
147147
148148 private void CooldownComplete ( )
149149 {
150- this . cooldown = false ;
150+ cooldown = false ;
151151 }
152152
153153 }
0 commit comments