Scoreboard bug and swaplines not destroying bug fixed

dev-ali
Ali Sharoz 2 days ago
parent a15f6d6b34
commit 7d9fb0ce4c

@ -38,7 +38,7 @@ RenderSettings:
m_ReflectionIntensity: 1 m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0} m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0} m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} m_IndirectSpecularColor: {r: 0.18194216, g: 0.2276266, b: 0.3074139, a: 1}
m_UseRadianceAmbientProbe: 0 m_UseRadianceAmbientProbe: 0
--- !u!157 &3 --- !u!157 &3
LightmapSettings: LightmapSettings:
@ -2406,7 +2406,7 @@ GameObject:
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0
m_IsActive: 1 m_IsActive: 0
--- !u!224 &476537027 --- !u!224 &476537027
RectTransform: RectTransform:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -13903,11 +13903,11 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 1676734515771252668, guid: 0193228de87741d40a42e561901c9083, type: 3} - target: {fileID: 1676734515771252668, guid: 0193228de87741d40a42e561901c9083, type: 3}
propertyPath: m_LocalRotation.y propertyPath: m_LocalRotation.y
value: 0.28987613 value: 0.28987604
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 1676734515771252668, guid: 0193228de87741d40a42e561901c9083, type: 3} - target: {fileID: 1676734515771252668, guid: 0193228de87741d40a42e561901c9083, type: 3}
propertyPath: m_LocalRotation.z propertyPath: m_LocalRotation.z
value: -0.1815204 value: -0.1815203
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 1676734516302391364, guid: 0193228de87741d40a42e561901c9083, type: 3} - target: {fileID: 1676734516302391364, guid: 0193228de87741d40a42e561901c9083, type: 3}
propertyPath: m_UpdateMethod propertyPath: m_UpdateMethod
@ -13959,7 +13959,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 1676734516724634599, guid: 0193228de87741d40a42e561901c9083, type: 3} - target: {fileID: 1676734516724634599, guid: 0193228de87741d40a42e561901c9083, type: 3}
propertyPath: m_LocalRotation.w propertyPath: m_LocalRotation.w
value: 0.80276686 value: 0.8027669
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 1676734516724634599, guid: 0193228de87741d40a42e561901c9083, type: 3} - target: {fileID: 1676734516724634599, guid: 0193228de87741d40a42e561901c9083, type: 3}
propertyPath: m_LocalRotation.x propertyPath: m_LocalRotation.x
@ -13967,11 +13967,11 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 1676734516724634599, guid: 0193228de87741d40a42e561901c9083, type: 3} - target: {fileID: 1676734516724634599, guid: 0193228de87741d40a42e561901c9083, type: 3}
propertyPath: m_LocalRotation.y propertyPath: m_LocalRotation.y
value: 0.2921833 value: 0.29218328
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 1676734516724634599, guid: 0193228de87741d40a42e561901c9083, type: 3} - target: {fileID: 1676734516724634599, guid: 0193228de87741d40a42e561901c9083, type: 3}
propertyPath: m_LocalRotation.z propertyPath: m_LocalRotation.z
value: -0.17778286 value: -0.17778282
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 1676734516866984540, guid: 0193228de87741d40a42e561901c9083, type: 3} - target: {fileID: 1676734516866984540, guid: 0193228de87741d40a42e561901c9083, type: 3}
propertyPath: m_VerticalDamping propertyPath: m_VerticalDamping

@ -491,13 +491,12 @@ namespace Unity.BossRoom.Gameplay.GameplayObjects.Character
[Rpc(SendTo.Server, RequireOwnership = false)] [Rpc(SendTo.Server, RequireOwnership = false)]
public void NotifySwapDecisionRpc(bool isAccepted) public void NotifySwapDecisionRpc(bool isAccepted)
{ {
if (PendingSwapRequests.Count == 0) return; if (PendingSwapRequests.Count == 0) return;
ulong initiatingPlayerId = 0; ulong initiatingPlayerId = 0;
foreach (var entry in PendingSwapRequests) // Find a valid swap request foreach (var entry in PendingSwapRequests)
{ {
initiatingPlayerId = entry.Key; initiatingPlayerId = entry.Key;
break; break;
@ -518,10 +517,9 @@ namespace Unity.BossRoom.Gameplay.GameplayObjects.Character
} }
} }
// Remove all pending swap requests
PendingSwapRequests.Clear(); PendingSwapRequests.Clear();
// Destroy all swap lines // Destroy swap lines on the server
foreach (var line in m_SwapLines.Values) foreach (var line in m_SwapLines.Values)
{ {
if (line != null) if (line != null)
@ -529,9 +527,23 @@ namespace Unity.BossRoom.Gameplay.GameplayObjects.Character
Destroy(line.gameObject); Destroy(line.gameObject);
} }
} }
m_SwapLines.Clear(); // Clear the dictionary after destroying lines m_SwapLines.Clear();
}
// Call ClientRpc to destroy swap lines on clients
DestroySwapLinesClientRpc();
}
[ClientRpc]
private void DestroySwapLinesClientRpc()
{
foreach (var line in m_SwapLines.Values)
{
if (line != null)
{
Destroy(line.gameObject);
}
}
m_SwapLines.Clear();
}
public void InitiateSwap(ServerCharacter initiatingPlayer, ServerCharacter targetPlayer) public void InitiateSwap(ServerCharacter initiatingPlayer, ServerCharacter targetPlayer)

Loading…
Cancel
Save