Score not deducting correctly bug fixed.

dev-ali
Ali Sharoz 3 days ago
parent e3d447d0d2
commit 93b5425466

@ -614,7 +614,7 @@ MeshCollider:
m_LayerOverridePriority: 0 m_LayerOverridePriority: 0
m_IsTrigger: 1 m_IsTrigger: 1
m_ProvidesContacts: 0 m_ProvidesContacts: 0
m_Enabled: 1 m_Enabled: 0
serializedVersion: 5 serializedVersion: 5
m_Convex: 1 m_Convex: 1
m_CookingOptions: 30 m_CookingOptions: 30
@ -809,7 +809,7 @@ MeshCollider:
m_LayerOverridePriority: 0 m_LayerOverridePriority: 0
m_IsTrigger: 1 m_IsTrigger: 1
m_ProvidesContacts: 0 m_ProvidesContacts: 0
m_Enabled: 1 m_Enabled: 0
serializedVersion: 5 serializedVersion: 5
m_Convex: 1 m_Convex: 1
m_CookingOptions: 30 m_CookingOptions: 30
@ -1005,7 +1005,7 @@ MeshCollider:
m_LayerOverridePriority: 0 m_LayerOverridePriority: 0
m_IsTrigger: 1 m_IsTrigger: 1
m_ProvidesContacts: 0 m_ProvidesContacts: 0
m_Enabled: 1 m_Enabled: 0
serializedVersion: 5 serializedVersion: 5
m_Convex: 1 m_Convex: 1
m_CookingOptions: 30 m_CookingOptions: 30
@ -1185,7 +1185,7 @@ MeshCollider:
m_LayerOverridePriority: 0 m_LayerOverridePriority: 0
m_IsTrigger: 1 m_IsTrigger: 1
m_ProvidesContacts: 0 m_ProvidesContacts: 0
m_Enabled: 1 m_Enabled: 0
serializedVersion: 5 serializedVersion: 5
m_Convex: 1 m_Convex: 1
m_CookingOptions: 30 m_CookingOptions: 30
@ -1365,7 +1365,7 @@ MeshCollider:
m_LayerOverridePriority: 0 m_LayerOverridePriority: 0
m_IsTrigger: 1 m_IsTrigger: 1
m_ProvidesContacts: 0 m_ProvidesContacts: 0
m_Enabled: 1 m_Enabled: 0
serializedVersion: 5 serializedVersion: 5
m_Convex: 1 m_Convex: 1
m_CookingOptions: 30 m_CookingOptions: 30
@ -1545,7 +1545,7 @@ MeshCollider:
m_LayerOverridePriority: 0 m_LayerOverridePriority: 0
m_IsTrigger: 1 m_IsTrigger: 1
m_ProvidesContacts: 0 m_ProvidesContacts: 0
m_Enabled: 1 m_Enabled: 0
serializedVersion: 5 serializedVersion: 5
m_Convex: 1 m_Convex: 1
m_CookingOptions: 30 m_CookingOptions: 30
@ -1725,7 +1725,7 @@ MeshCollider:
m_LayerOverridePriority: 0 m_LayerOverridePriority: 0
m_IsTrigger: 1 m_IsTrigger: 1
m_ProvidesContacts: 0 m_ProvidesContacts: 0
m_Enabled: 1 m_Enabled: 0
serializedVersion: 5 serializedVersion: 5
m_Convex: 1 m_Convex: 1
m_CookingOptions: 30 m_CookingOptions: 30

@ -50,9 +50,12 @@ public class CrowManager : NetworkBehaviour
/// <summary> /// <summary>
/// Determines which player should be the crow. /// Determines which player should be the crow.
/// </summary> /// </summary>
int unoccupiedPlayers = 0;
private void DetermineCrow() private void DetermineCrow()
{ {
int unoccupiedPlayers = 0; unoccupiedPlayers = 0;
ServerCharacter potentialCrow = null; ServerCharacter potentialCrow = null;
foreach (var player in players) foreach (var player in players)

@ -15,7 +15,6 @@ namespace Unity.Multiplayer.Samples.BossRoom
private NetworkVariable<ulong> occupierId = new NetworkVariable<ulong>(0, NetworkVariableReadPermission.Everyone, NetworkVariableWritePermission.Server); private NetworkVariable<ulong> occupierId = new NetworkVariable<ulong>(0, NetworkVariableReadPermission.Everyone, NetworkVariableWritePermission.Server);
private Collider platformCollider; private Collider platformCollider;
private Animator animator; private Animator animator;
private void Awake() private void Awake()
{ {
platformCollider = GetComponent<Collider>(); platformCollider = GetComponent<Collider>();
@ -24,12 +23,18 @@ namespace Unity.Multiplayer.Samples.BossRoom
animator = GetComponent<Animator>(); animator = GetComponent<Animator>();
} }
private void Start()
{
Invoke(nameof(ColliderEnabler),2);
}
public void AssignID(int id) public void AssignID(int id)
{ {
if (IsServer) PlatformID.Value = id; if (IsServer) PlatformID.Value = id;
} }
void ColliderEnabler()
{
platformCollider.enabled = true;
}
public void StartRotation() => transform.DOLocalRotate(Vector3.up, 120).SetSpeedBased(true).SetId(PlatformID).SetLoops(-1, LoopType.Incremental); public void StartRotation() => transform.DOLocalRotate(Vector3.up, 120).SetSpeedBased(true).SetId(PlatformID).SetLoops(-1, LoopType.Incremental);
private void PauseRotation() => DOTween.Pause(PlatformID); private void PauseRotation() => DOTween.Pause(PlatformID);
@ -65,6 +70,7 @@ namespace Unity.Multiplayer.Samples.BossRoom
public void Occupy(ServerCharacter player) public void Occupy(ServerCharacter player)
{ {
Debug.Log("Platform Occupied by: " + player.uIStateDisplayHandler.m_UIState.playerName);
if (!IsServer || IsOccupied) return; if (!IsServer || IsOccupied) return;
Pause(); Pause();

@ -141,7 +141,7 @@ namespace Unity.Multiplayer.Samples.BossRoom
return m_Platforms.All(platform => platform.IsOccupied); return m_Platforms.All(platform => platform.IsOccupied);
} }
public bool AssignPlayerToPlatform(ServerCharacter player) /*public bool AssignPlayerToPlatform(ServerCharacter player)
{ {
if (!IsServer) if (!IsServer)
{ {
@ -158,7 +158,7 @@ namespace Unity.Multiplayer.Samples.BossRoom
Debug.LogWarning($"No unoccupied platforms available for {player.name}."); Debug.LogWarning($"No unoccupied platforms available for {player.name}.");
return false; return false;
} }*/
public Platform GetPlatformOccupiedByPlayer(ServerCharacter player) public Platform GetPlatformOccupiedByPlayer(ServerCharacter player)
{ {

Loading…
Cancel
Save