unity error

This commit is contained in:
2026-08-12 13:45:19 +05:30
parent c2f4c2f808
commit 9970488938
27 changed files with 4150 additions and 114 deletions
+14
View File
@@ -161,6 +161,7 @@ public class GameManager : NetworkBehaviour
bool _dedicatedReportedRedJoin;
bool _dedicatedReportedBlueJoin;
bool _dedicatedReportedGameOver;
bool _replayRecordingStarted;
public static Action<Team> OnTeamChanged;
public static bool isMoving{
@@ -575,6 +576,14 @@ public class GameManager : NetworkBehaviour
Logger.Log("Game started On Server");
}
}
// Host practice (tutorial) and dedicated matches both record once NetworkServer is ready.
// Retry until StartRecording succeeds — StartHost can lag one frame behind gameStarted.
if (gameStarted && !_replayRecordingStarted && NetworkServer.active)
{
if (ReplayRecorder.StartRecording(DedicatedMatchId, this))
_replayRecordingStarted = true;
}
}
UpdateLocalTurnTimerBeep();
@@ -736,6 +745,7 @@ public class GameManager : NetworkBehaviour
if(hitCounter == 1){
//kickoff goal
Logger.Log("Kickoff goal");
ReplayRecorder.RecordGoal(concedingTeam, redScore, blueScore, kickoff: true);
SetKickoffTeam(concedingTeam);
StartCoroutine(CoroutineOnGoal(team,true));//true = Kickoff goal, reset only the ball
hitCounter = 0;
@@ -754,16 +764,19 @@ public class GameManager : NetworkBehaviour
Logger.Log($"Red goal scored, red score is now {redScore}");
}
ReplayRecorder.RecordGoal(concedingTeam, redScore, blueScore, kickoff: false);
SetKickoffTeam(concedingTeam);
if(blueScore >= 3){
isGameEnded = true;
ReplayRecorder.StopAndFlush();
ReportDedicatedMatchGameOver(Team.Blue);
RpcGameOver(Team.Blue);
gameOver(Team.Blue);
}else if(redScore >= 3){
isGameEnded = true;
ReplayRecorder.StopAndFlush();
ReportDedicatedMatchGameOver(Team.Red);
RpcGameOver(Team.Red);
gameOver(Team.Red);
@@ -963,6 +976,7 @@ public class GameManager : NetworkBehaviour
}
IEnumerator CoroutineReset(bool kickoff = false){
ReplayRecorder.RecordReset(kickoff);
float resetDuration = 0.5f;
if(!kickoff){
foreach(Puck puck in pucks){