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

@@ -146,14 +146,6 @@ namespace OnlyScove.Scripts
bool isRunning = Runner != null && Runner.IsRunning;
if (Object == null && isRunning) return;
// Proxy Sync
if (isRunning && Movement.NetworkedPosition != Vector3.zero && !Object.HasInputAuthority)
{
Controller.enabled = false;
transform.position = Movement.NetworkedPosition;
Controller.enabled = true;
}
if (GetInput(out PlayerInputData data))
{
MoveInput = data.Direction;
@@ -175,10 +167,24 @@ namespace OnlyScove.Scripts
currentState?.Tick(isRunning ? Runner.DeltaTime : Time.fixedDeltaTime);
}
}
else
}
public override void Render()
{
bool isRunning = Runner != null && Runner.IsRunning;
if (isRunning && !Object.HasInputAuthority)
{
// Smooth interpolation for proxies
if (Movement.NetworkedPosition != Vector3.zero)
{
transform.position = Vector3.Lerp(transform.position, Movement.NetworkedPosition, Runner.DeltaTime * 15f);
}
UpdateAnimator(Runner.DeltaTime);
}
else if (!isRunning)
{
UpdateAnimator(Time.deltaTime);
}
}
private void Update()

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);
}
}