Elo system update
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user