diff --git a/Assets/Scenes/BossRoom.unity b/Assets/Scenes/BossRoom.unity index d13dbe8..fe6bc16 100644 --- a/Assets/Scenes/BossRoom.unity +++ b/Assets/Scenes/BossRoom.unity @@ -8978,6 +8978,72 @@ Transform: m_CorrespondingSourceObject: {fileID: 5655447013084909147, guid: 8b9c63e7d70c5ff48a03aad51e17103c, type: 3} m_PrefabInstance: {fileID: 828804356} m_PrefabAsset: {fileID: 0} +--- !u!1 &862711267 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 862711270} + - component: {fileID: 862711268} + - component: {fileID: 862711269} + m_Layer: 0 + m_Name: ScoreManager + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &862711268 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 862711267} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3} + m_Name: + m_EditorClassIdentifier: + GlobalObjectIdHash: 631707658 + InScenePlacedSourceGlobalObjectIdHash: 0 + AlwaysReplicateAsRoot: 0 + SynchronizeTransform: 1 + ActiveSceneSynchronization: 0 + SceneMigrationSynchronization: 1 + SpawnWithObservers: 1 + DontDestroyWithOwner: 0 + AutoObjectParentSync: 1 +--- !u!114 &862711269 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 862711267} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c42f66f946855da4b99f79c5bde1d545, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!4 &862711270 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 862711267} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &863331223 GameObject: m_ObjectHideFlags: 0 @@ -9287,11 +9353,11 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 1676734516695783279, guid: 0193228de87741d40a42e561901c9083, type: 3} propertyPath: m_LocalRotation.y - value: 0.30972984 + value: 0.3097298 objectReference: {fileID: 0} - target: {fileID: 1676734516695783279, guid: 0193228de87741d40a42e561901c9083, type: 3} propertyPath: m_LocalRotation.z - value: -0.1450697 + value: -0.14506969 objectReference: {fileID: 0} - target: {fileID: 1676734516724634599, guid: 0193228de87741d40a42e561901c9083, type: 3} propertyPath: m_LocalPosition.z @@ -10179,7 +10245,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!224 &1599220877 RectTransform: m_ObjectHideFlags: 0 @@ -278996,3 +279062,4 @@ SceneRoots: - {fileID: 396364068} - {fileID: 7822537384937625691} - {fileID: 1521032484} + - {fileID: 862711270} diff --git a/Assets/Scenes/BossRoom/DungeonEntrance.unity b/Assets/Scenes/BossRoom/DungeonEntrance.unity index d2f07a9..f172f3b 100644 --- a/Assets/Scenes/BossRoom/DungeonEntrance.unity +++ b/Assets/Scenes/BossRoom/DungeonEntrance.unity @@ -1213,8 +1213,8 @@ Transform: m_GameObject: {fileID: 1415641637} serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0.58, y: -0.14, z: 1.84} - m_LocalScale: {x: 1.2077, y: 1.2077, z: 1.2077} + m_LocalPosition: {x: -0.4553, y: -0.14, z: -1.0268} + m_LocalScale: {x: 2.1429026, y: 1.2077, z: 2.595087} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} diff --git a/Assets/Scenes/BossRoom/NavMesh-DungeonNavMesh.asset b/Assets/Scenes/BossRoom/NavMesh-DungeonNavMesh.asset index 00073fc..75ba938 100644 Binary files a/Assets/Scenes/BossRoom/NavMesh-DungeonNavMesh.asset and b/Assets/Scenes/BossRoom/NavMesh-DungeonNavMesh.asset differ diff --git a/Assets/Scripts/Gameplay/Platform.cs b/Assets/Scripts/Gameplay/Platform.cs index d9512be..e05f818 100644 --- a/Assets/Scripts/Gameplay/Platform.cs +++ b/Assets/Scripts/Gameplay/Platform.cs @@ -121,8 +121,6 @@ namespace Unity.Multiplayer.Samples.BossRoom } public void Occupy(ServerCharacter player) { - //AnimationPauser(); - if (!IsServer) { Debug.LogError("Occupy can only be called on the server."); @@ -159,13 +157,9 @@ namespace Unity.Multiplayer.Samples.BossRoom public void Vacate(ServerCharacter player) { - //AnimationResumer(); - if (!IsServer) { Debug.LogError("Vacate can only be called on the server."); - //AnimationResumer(); - return; } ResumeAnimation(); @@ -184,7 +178,7 @@ namespace Unity.Multiplayer.Samples.BossRoom private void OnTriggerEnter(Collider other) { - //if (!IsServer) return; + if (!IsServer) return; if (other.TryGetComponent(out var player)) { @@ -207,7 +201,6 @@ namespace Unity.Multiplayer.Samples.BossRoom private void OnTriggerExit(Collider other) { if (!IsServer) return; - if (other.TryGetComponent(out var player)) { Vacate(player); diff --git a/Assets/Scripts/Gameplay/UserInput/ClientInputSender.cs b/Assets/Scripts/Gameplay/UserInput/ClientInputSender.cs index 86cae60..3948ebf 100644 --- a/Assets/Scripts/Gameplay/UserInput/ClientInputSender.cs +++ b/Assets/Scripts/Gameplay/UserInput/ClientInputSender.cs @@ -36,7 +36,7 @@ namespace Unity.BossRoom.Gameplay.UserInput LayerMask m_GroundLayerMask; LayerMask m_ActionLayerMask; - LayerMask m_PlatformLayerMask; + LayerMask m_SwapInputLayerMask; const float k_MaxNavMeshDistance = 1f; @@ -159,7 +159,8 @@ namespace Unity.BossRoom.Gameplay.UserInput m_GroundLayerMask = LayerMask.GetMask(new[] { "Ground" }); m_ActionLayerMask = LayerMask.GetMask(new[] { "PCs", "NPCs", "Ground" }); - m_PlatformLayerMask = LayerMask.GetMask(new[]{"Platform"}); + m_SwapInputLayerMask = LayerMask.GetMask(new[]{"PCs"}); + m_RaycastHitComparer = new RaycastHitComparer(); m_UIMessageFeed = FindObjectOfType(); } @@ -543,15 +544,16 @@ namespace Unity.BossRoom.Gameplay.UserInput IsSwapModeActive = !IsSwapModeActive; if (IsSwapModeActive) { - FindObjectOfType().DisplayMessage("Swap mode activated"); + m_UIMessageFeed.DisplayMessage("Swap mode activated"); Debug.Log("Swap mode activated. Click on a player to request a swap."); } else { - FindObjectOfType().DisplayMessage("Swap mode deactivated"); + m_UIMessageFeed.DisplayMessage("Swap mode deactivated"); Debug.Log("Swap mode deactivated."); } } + /// /// Handles the swap request when in swap mode. @@ -559,7 +561,7 @@ namespace Unity.BossRoom.Gameplay.UserInput private void HandleSwapRequest() { var ray = m_MainCamera.ScreenPointToRay(Input.mousePosition); - int hits = Physics.RaycastNonAlloc(ray, k_CachedHit, k_MouseInputRaycastDistance); + int hits = Physics.RaycastNonAlloc(ray, k_CachedHit, k_MouseInputRaycastDistance, m_SwapInputLayerMask); if (hits > 0) { for (int i = 0; i < hits; i++)