Elo system update

This commit is contained in:
2026-04-29 13:10:00 +07:00
parent ed86fface3
commit 1222d39fdf
25 changed files with 462 additions and 293 deletions

View File

@@ -1,6 +1,7 @@
using UnityEngine;
using Fusion;
using System;
using Hallucinate.Network;
namespace OnlyScove.Scripts
{
@@ -24,10 +25,23 @@ namespace OnlyScove.Scripts
void OnHealthChangedRender()
{
OnHealthChanged?.Invoke(Health);
if (Health <= 0 && Object.HasStateAuthority)
{
// Find the other player as winner
foreach (var player in Runner.ActivePlayers)
{
if (player != Object.InputAuthority)
{
MatchResultManager.Instance?.ProcessMatchEnd(player);
break;
}
}
}
if (Object.HasInputAuthority)
{
// UI Placeholder: Trigger Health UI Change
// Example: UI.UIEventBus.TriggerHealthChange(Health / 100f);
}
}
@@ -37,7 +51,6 @@ namespace OnlyScove.Scripts
if (Object.HasInputAuthority)
{
// UI Placeholder: Trigger Stamina UI Change
// Example: UI.UIEventBus.TriggerStaminaChange(Stamina / 100f);
}
}