diff --git a/Assets/Scripts/Gameplay/Platform.cs b/Assets/Scripts/Gameplay/Platform.cs index 3596dab..04a2910 100644 --- a/Assets/Scripts/Gameplay/Platform.cs +++ b/Assets/Scripts/Gameplay/Platform.cs @@ -8,7 +8,7 @@ namespace Unity.Multiplayer.Samples.BossRoom public class Platform : NetworkBehaviour { public int PlatformID { get; private set; } - public bool IsOccupied => OccupierId.Value != 0; + public bool IsOccupied{ get; private set; } private NetworkVariable OccupierId = new NetworkVariable(0, NetworkVariableReadPermission.Everyone, NetworkVariableWritePermission.Server); private Collider m_PlatformCollider; @@ -26,6 +26,7 @@ namespace Unity.Multiplayer.Samples.BossRoom public void AssignID(int id) { PlatformID = id; + IsOccupied = false; Debug.Log($"Platform {name} assigned ID: {PlatformID}"); } @@ -43,6 +44,7 @@ namespace Unity.Multiplayer.Samples.BossRoom return; } + IsOccupied = true; OccupierId.Value = player.OwnerClientId; player.SetOnPlatform(true); @@ -63,6 +65,7 @@ namespace Unity.Multiplayer.Samples.BossRoom return; } + IsOccupied = false; OccupierId.Value = 0; player.SetOnPlatform(false);