@@ -152,11 +152,37 @@ public void UpdateBoxes()
152152 Destroy ( go ) ;
153153 }
154154
155+ // Check for players that joined (late join)
156+ foreach ( var player in StartOfRound . Instance . allPlayerScripts )
157+ {
158+ var playerExists = player . isPlayerDead || player . isPlayerControlled ;
159+ var idx = playerBoxes . FindIndex ( box => box . IsPlayer ( player ) ) ;
160+
161+ if ( ! playerExists || idx != - 1 )
162+ continue ;
163+
164+ var box = Instantiate ( spectatingPlayerPrefab , playersContainer ) . GetComponent < SpectatingPlayer > ( ) ;
165+ box . Setup ( player ) ;
166+
167+ playerBoxes . Add ( box ) ;
168+ }
169+
155170 // Update all boxes
156171 foreach ( var box in playerBoxes )
157172 box . UpdateState ( ) ;
158173 }
159174
175+ public void PlayerRevived ( )
176+ {
177+ voteProgress = 0 ;
178+ voteProgressBar . localScale = new Vector3 ( 0 , 1 , 1 ) ;
179+
180+ voteButton . GetComponentInChildren < TextMeshProUGUI > ( ) . text = "VOTE TO LEAVE" ;
181+ voteButton . interactable = true ;
182+
183+ enabled = false ;
184+ }
185+
160186 private void HandleGaze ( )
161187 {
162188 if ( UnityEngine . Physics . Raycast ( new Ray ( raySource . position - raySource . forward * 0.5f , raySource . forward ) ,
@@ -183,7 +209,7 @@ private void HandleVoting()
183209 if ( StartOfRound . Instance . shipIsLeaving || ! StartOfRound . Instance . currentLevel . planetHasTime )
184210 return ;
185211
186- voteProgress += Time . deltaTime * ( isVoting ? 0.2f : - 0.4f ) ;
212+ voteProgress += Time . deltaTime * ( isVoting ? 0.3f : - 0.5f ) ;
187213 voteProgress = Mathf . Clamp01 ( voteProgress ) ;
188214
189215 voteProgressBar . localScale = new Vector3 ( Mathf . SmoothStep ( 0 , 1 , voteProgress ) , 1 , 1 ) ;
0 commit comments