diff --git a/Assets/DotaStyleCameraController.cs b/Assets/DotaStyleCameraController.cs new file mode 100644 index 0000000..4c5b0be --- /dev/null +++ b/Assets/DotaStyleCameraController.cs @@ -0,0 +1,53 @@ +using UnityEngine; +using Cinemachine; + +public class FreeLookCamera360Panning : MonoBehaviour +{ + public CinemachineFreeLook freeLookCamera; + public Transform player; // Player's Transform to follow + public float panSpeed = 10f; // Speed of panning + public float edgeThreshold = 10f; // Edge detection range in pixels + + private bool isPanning = false; + + void Update() + { + HandleEdgeScrolling(); + } + + void HandleEdgeScrolling() + { + Vector3 mousePos = Input.mousePosition; + float screenWidth = Screen.width; + float screenHeight = Screen.height; + Vector3 moveDirection = Vector3.zero; + + // Detect if cursor is near screen edges + if (mousePos.x <= edgeThreshold) moveDirection += -freeLookCamera.transform.right; // Move left + if (mousePos.x >= screenWidth - edgeThreshold) moveDirection += freeLookCamera.transform.right; // Move right + if (mousePos.y <= edgeThreshold) moveDirection += -freeLookCamera.transform.forward; // Move backward + if (mousePos.y >= screenHeight - edgeThreshold) moveDirection += freeLookCamera.transform.forward; // Move forward + + if (moveDirection != Vector3.zero) + { + if (!isPanning) + { + freeLookCamera.Follow = null; // Stop following the player + freeLookCamera.LookAt = null; // Stop aiming at the player + isPanning = true; + } + + // Move the camera in world space (360-degree movement) + freeLookCamera.transform.Translate(moveDirection * panSpeed * Time.deltaTime, Space.World); + } + else + { + if (isPanning) + { + freeLookCamera.Follow = player; // Re-enable following the player + freeLookCamera.LookAt = player; // Re-enable aiming at the player + isPanning = false; + } + } + } +} diff --git a/Assets/DotaStyleCameraController.cs.meta b/Assets/DotaStyleCameraController.cs.meta new file mode 100644 index 0000000..3e5d0d4 --- /dev/null +++ b/Assets/DotaStyleCameraController.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9cb547df9849d1a4ca8e4bfe9602d979 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/PolygonDungeonRealms/Materials/PlatformTimer.mat b/Assets/PolygonDungeonRealms/Materials/PlatformTimer.mat index 2bcdf2e..5e5fbde 100644 --- a/Assets/PolygonDungeonRealms/Materials/PlatformTimer.mat +++ b/Assets/PolygonDungeonRealms/Materials/PlatformTimer.mat @@ -147,7 +147,7 @@ Material: - _ClearCoatMask: 0 - _ClearCoatSmoothness: 0 - _ClipUvDown: 0 - - _ClipUvLeft: 1 + - _ClipUvLeft: 0.227 - _ClipUvRight: 0 - _ClipUvUp: 0 - _ColorChangeLuminosity: 0 diff --git a/Assets/Prefabs/ScoreBG.prefab b/Assets/Prefabs/ScoreBG.prefab index b2105f8..68e2c5a 100644 --- a/Assets/Prefabs/ScoreBG.prefab +++ b/Assets/Prefabs/ScoreBG.prefab @@ -92,12 +92,12 @@ MonoBehaviour: m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_fontSize: 30 + m_fontSize: 90 m_fontSizeBase: 36 m_fontWeight: 400 m_enableAutoSizing: 1 m_fontSizeMin: 18 - m_fontSizeMax: 72 + m_fontSizeMax: 90 m_fontStyle: 0 m_HorizontalAlignment: 2 m_VerticalAlignment: 512 @@ -168,10 +168,10 @@ RectTransform: - {fileID: 8442231638847994970} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 100, y: 30} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &1695171216466614393 CanvasRenderer: diff --git a/Assets/Scenes/BossRoom.unity b/Assets/Scenes/BossRoom.unity index 9176cc5..e5311de 100644 --- a/Assets/Scenes/BossRoom.unity +++ b/Assets/Scenes/BossRoom.unity @@ -282,6 +282,41 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 33984975} m_CullTransparentMesh: 1 +--- !u!1 &34523586 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 34523587} + m_Layer: 5 + m_Name: ScoreSpawnPos + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &34523587 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 34523586} + 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: 5277713031054755334} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 1, y: 0.5} + m_AnchorMax: {x: 1, y: 0.5} + m_AnchoredPosition: {x: 60, y: 32} + m_SizeDelta: {x: 200, y: 91.5} + m_Pivot: {x: 0, y: 0.5} --- !u!1 &39189377 GameObject: m_ObjectHideFlags: 0 @@ -11598,7 +11633,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!224 &823937456 RectTransform: m_ObjectHideFlags: 0 @@ -11616,10 +11651,10 @@ RectTransform: - {fileID: 1438397218} m_Father: {fileID: 3784538605243177480} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 680.9, y: -64} + m_SizeDelta: {x: 128, y: 128} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &823937457 MonoBehaviour: @@ -13742,7 +13777,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 1676734516724634599, guid: 0193228de87741d40a42e561901c9083, type: 3} propertyPath: m_LocalRotation.w - value: 0.80276686 + value: 0.8027669 objectReference: {fileID: 0} - target: {fileID: 1676734516724634599, guid: 0193228de87741d40a42e561901c9083, type: 3} propertyPath: m_LocalRotation.x @@ -13750,11 +13785,11 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 1676734516724634599, guid: 0193228de87741d40a42e561901c9083, type: 3} propertyPath: m_LocalRotation.y - value: 0.2921833 + value: 0.29218328 objectReference: {fileID: 0} - target: {fileID: 1676734516724634599, guid: 0193228de87741d40a42e561901c9083, type: 3} propertyPath: m_LocalRotation.z - value: -0.17778286 + value: -0.17778282 objectReference: {fileID: 0} - target: {fileID: 1676734516866984540, guid: 0193228de87741d40a42e561901c9083, type: 3} propertyPath: m_VerticalDamping @@ -13849,6 +13884,17 @@ PrefabInstance: m_AddedGameObjects: [] m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 0193228de87741d40a42e561901c9083, type: 3} +--- !u!114 &1060857732 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 1676734517288307196, guid: 0193228de87741d40a42e561901c9083, type: 3} + m_PrefabInstance: {fileID: 1060857731} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 319d2fe34a804e245819465c9505ea59, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &1061769866 GameObject: m_ObjectHideFlags: 0 @@ -14390,6 +14436,9 @@ PrefabInstance: - targetCorrespondingSourceObject: {fileID: 203267159508449517, guid: 36b3ee75677a1544191c0ddaaadd8140, type: 3} insertIndex: -1 addedObject: {fileID: 1124806923} + - targetCorrespondingSourceObject: {fileID: 203267159508449517, guid: 36b3ee75677a1544191c0ddaaadd8140, type: 3} + insertIndex: -1 + addedObject: {fileID: 1124806924} m_SourcePrefab: {fileID: 100100000, guid: 36b3ee75677a1544191c0ddaaadd8140, type: 3} --- !u!1 &1124806921 stripped GameObject: @@ -14457,6 +14506,22 @@ MonoBehaviour: blendDistance: 0 weight: 1 sharedProfile: {fileID: 11400000, guid: fdaccf5e8b9489c4ab68d01f18640998, type: 2} +--- !u!114 &1124806924 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1124806921} + m_Enabled: 0 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9cb547df9849d1a4ca8e4bfe9602d979, type: 3} + m_Name: + m_EditorClassIdentifier: + freeLookCamera: {fileID: 1060857732} + player: {fileID: 0} + panSpeed: 10 + edgeThreshold: 10 --- !u!1 &1140754828 GameObject: m_ObjectHideFlags: 0 @@ -17780,13 +17845,44 @@ PrefabInstance: m_RemovedComponents: [] m_RemovedGameObjects: [] m_AddedGameObjects: [] - m_AddedComponents: [] + m_AddedComponents: + - targetCorrespondingSourceObject: {fileID: 8030665820898736734, guid: 67acc9bc9157b4841be3fa7d0ea9f488, type: 3} + insertIndex: -1 + addedObject: {fileID: 1717472792} m_SourcePrefab: {fileID: 100100000, guid: 67acc9bc9157b4841be3fa7d0ea9f488, type: 3} --- !u!4 &1717472790 stripped Transform: m_CorrespondingSourceObject: {fileID: 2345875387662447015, guid: 67acc9bc9157b4841be3fa7d0ea9f488, type: 3} m_PrefabInstance: {fileID: 1717472789} m_PrefabAsset: {fileID: 0} +--- !u!1 &1717472791 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 8030665820898736734, guid: 67acc9bc9157b4841be3fa7d0ea9f488, type: 3} + m_PrefabInstance: {fileID: 1717472789} + m_PrefabAsset: {fileID: 0} +--- !u!114 &1717472792 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1717472791} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 474bcb49853aa07438625e644c072ee6, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Version: 3 + m_UsePipelineSettings: 1 + m_AdditionalLightsShadowResolutionTier: 2 + m_LightLayerMask: 1 + m_RenderingLayers: 1 + m_CustomShadowLayers: 0 + m_ShadowLayerMask: 1 + m_ShadowRenderingLayers: 1 + m_LightCookieSize: {x: 1, y: 1} + m_LightCookieOffset: {x: 0, y: 0} + m_SoftShadowQuality: 0 --- !u!1 &1717751563 GameObject: m_ObjectHideFlags: 0 @@ -211600,6 +211696,10 @@ PrefabInstance: propertyPath: m_Enabled value: 0 objectReference: {fileID: 0} + - target: {fileID: 9059929380243764538, guid: 334e483163a0ba54bb764e318223c9ba, type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} - target: {fileID: 9059929380243764539, guid: 334e483163a0ba54bb764e318223c9ba, type: 3} propertyPath: m_AnchorMax.y value: 0 @@ -211672,6 +211772,10 @@ PrefabInstance: propertyPath: m_Enabled value: 0 objectReference: {fileID: 0} + - target: {fileID: 9059929380544550686, guid: 334e483163a0ba54bb764e318223c9ba, type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} - target: {fileID: 9059929380544550687, guid: 334e483163a0ba54bb764e318223c9ba, type: 3} propertyPath: m_AnchorMax.y value: 0 @@ -211760,6 +211864,14 @@ PrefabInstance: propertyPath: m_Enabled value: 0 objectReference: {fileID: 0} + - target: {fileID: 9059929381413149714, guid: 334e483163a0ba54bb764e318223c9ba, type: 3} + propertyPath: m_Name + value: Button5 + objectReference: {fileID: 0} + - target: {fileID: 9059929381413149714, guid: 334e483163a0ba54bb764e318223c9ba, type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} - target: {fileID: 9059929381413149715, guid: 334e483163a0ba54bb764e318223c9ba, type: 3} propertyPath: m_AnchorMax.y value: 0 @@ -211784,10 +211896,26 @@ PrefabInstance: propertyPath: m_AnchoredPosition.y value: 0 objectReference: {fileID: 0} + - target: {fileID: 9059929381720061996, guid: 334e483163a0ba54bb764e318223c9ba, type: 3} + propertyPath: m_Color.b + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9059929381720061996, guid: 334e483163a0ba54bb764e318223c9ba, type: 3} + propertyPath: m_Color.g + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9059929381720061996, guid: 334e483163a0ba54bb764e318223c9ba, type: 3} + propertyPath: m_Color.r + value: 0 + objectReference: {fileID: 0} - target: {fileID: 9059929381720061998, guid: 334e483163a0ba54bb764e318223c9ba, type: 3} propertyPath: m_EmotePanel value: objectReference: {fileID: 3141000975622230787} + - target: {fileID: 9059929381720061998, guid: 334e483163a0ba54bb764e318223c9ba, type: 3} + propertyPath: CrowButtons.Array.size + value: 3 + objectReference: {fileID: 0} - target: {fileID: 9059929381720061998, guid: 334e483163a0ba54bb764e318223c9ba, type: 3} propertyPath: m_SpecialAction3Button value: @@ -211796,6 +211924,42 @@ PrefabInstance: propertyPath: m_SpecialAction4Button value: objectReference: {fileID: 823937459} + - target: {fileID: 9059929381720061998, guid: 334e483163a0ba54bb764e318223c9ba, type: 3} + propertyPath: OtherButtons.Array.size + value: 4 + objectReference: {fileID: 0} + - target: {fileID: 9059929381720061998, guid: 334e483163a0ba54bb764e318223c9ba, type: 3} + propertyPath: CrowButtons.Array.data[0] + value: + objectReference: {fileID: 3784538605243177482} + - target: {fileID: 9059929381720061998, guid: 334e483163a0ba54bb764e318223c9ba, type: 3} + propertyPath: CrowButtons.Array.data[1] + value: + objectReference: {fileID: 823937455} + - target: {fileID: 9059929381720061998, guid: 334e483163a0ba54bb764e318223c9ba, type: 3} + propertyPath: CrowButtons.Array.data[2] + value: + objectReference: {fileID: 3784538605243177486} + - target: {fileID: 9059929381720061998, guid: 334e483163a0ba54bb764e318223c9ba, type: 3} + propertyPath: CrowButtons.Array.data[3] + value: + objectReference: {fileID: 823937455} + - target: {fileID: 9059929381720061998, guid: 334e483163a0ba54bb764e318223c9ba, type: 3} + propertyPath: OtherButtons.Array.data[0] + value: + objectReference: {fileID: 3784538605243177487} + - target: {fileID: 9059929381720061998, guid: 334e483163a0ba54bb764e318223c9ba, type: 3} + propertyPath: OtherButtons.Array.data[1] + value: + objectReference: {fileID: 3784538605243177485} + - target: {fileID: 9059929381720061998, guid: 334e483163a0ba54bb764e318223c9ba, type: 3} + propertyPath: OtherButtons.Array.data[2] + value: + objectReference: {fileID: 1341040666} + - target: {fileID: 9059929381720061998, guid: 334e483163a0ba54bb764e318223c9ba, type: 3} + propertyPath: OtherButtons.Array.data[3] + value: + objectReference: {fileID: 3784538605243177486} - target: {fileID: 9059929381720062001, guid: 334e483163a0ba54bb764e318223c9ba, type: 3} propertyPath: m_Name value: Hero Action Bar @@ -211888,29 +212052,41 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 9059929381720062003, guid: 334e483163a0ba54bb764e318223c9ba, type: 3} + propertyPath: m_StartCorner + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9059929381720062003, guid: 334e483163a0ba54bb764e318223c9ba, type: 3} + propertyPath: m_ChildAlignment + value: 8 + objectReference: {fileID: 0} + - target: {fileID: 9059929381734582208, guid: 334e483163a0ba54bb764e318223c9ba, type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} - target: {fileID: 9059929381734582209, guid: 334e483163a0ba54bb764e318223c9ba, type: 3} propertyPath: m_AnchorMax.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 9059929381734582209, guid: 334e483163a0ba54bb764e318223c9ba, type: 3} propertyPath: m_AnchorMin.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 9059929381734582209, guid: 334e483163a0ba54bb764e318223c9ba, type: 3} propertyPath: m_SizeDelta.x - value: 0 + value: 128 objectReference: {fileID: 0} - target: {fileID: 9059929381734582209, guid: 334e483163a0ba54bb764e318223c9ba, type: 3} propertyPath: m_SizeDelta.y - value: 0 + value: 128 objectReference: {fileID: 0} - target: {fileID: 9059929381734582209, guid: 334e483163a0ba54bb764e318223c9ba, type: 3} propertyPath: m_AnchoredPosition.x - value: 0 + value: 236.90002 objectReference: {fileID: 0} - target: {fileID: 9059929381734582209, guid: 334e483163a0ba54bb764e318223c9ba, type: 3} propertyPath: m_AnchoredPosition.y - value: 0 + value: -64 objectReference: {fileID: 0} - target: {fileID: 9059929381734582210, guid: 334e483163a0ba54bb764e318223c9ba, type: 3} propertyPath: m_Enabled @@ -268548,10 +268724,54 @@ PrefabInstance: serializedVersion: 3 m_TransformParent: {fileID: 5277713031461887262} m_Modifications: + - target: {fileID: 9325793021838405, guid: 8b2306d4cfca3b642afa5534b0ba275a, type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1498536700839112458, guid: 8b2306d4cfca3b642afa5534b0ba275a, type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2313713326485022797, guid: 8b2306d4cfca3b642afa5534b0ba275a, type: 3} + propertyPath: m_AnchoredPosition.y + value: -32 + objectReference: {fileID: 0} + - target: {fileID: 3196235205257965966, guid: 8b2306d4cfca3b642afa5534b0ba275a, type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3229532745780684517, guid: 8b2306d4cfca3b642afa5534b0ba275a, type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3524365414310894523, guid: 8b2306d4cfca3b642afa5534b0ba275a, type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3753620914738943690, guid: 8b2306d4cfca3b642afa5534b0ba275a, type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3981823909133418398, guid: 8b2306d4cfca3b642afa5534b0ba275a, type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4442907927267738384, guid: 8b2306d4cfca3b642afa5534b0ba275a, type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4727115088504872497, guid: 8b2306d4cfca3b642afa5534b0ba275a, type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} - target: {fileID: 5210474333085558483, guid: 8b2306d4cfca3b642afa5534b0ba275a, type: 3} propertyPath: m_HeroName value: objectReference: {fileID: 0} + - target: {fileID: 5210474333085558483, guid: 8b2306d4cfca3b642afa5534b0ba275a, type: 3} + propertyPath: ScoreSpawnPos + value: + objectReference: {fileID: 34523587} - target: {fileID: 5210474333085558483, guid: 8b2306d4cfca3b642afa5534b0ba275a, type: 3} propertyPath: m_PlayerAvatars value: @@ -268648,6 +268868,26 @@ PrefabInstance: propertyPath: m_IsActive value: 1 objectReference: {fileID: 0} + - target: {fileID: 5476457569395703647, guid: 8b2306d4cfca3b642afa5534b0ba275a, type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5515393536810559540, guid: 8b2306d4cfca3b642afa5534b0ba275a, type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5814719359608132970, guid: 8b2306d4cfca3b642afa5534b0ba275a, type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6074385635569178651, guid: 8b2306d4cfca3b642afa5534b0ba275a, type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6276118368565473615, guid: 8b2306d4cfca3b642afa5534b0ba275a, type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} - target: {fileID: 6568942726144729918, guid: 8b2306d4cfca3b642afa5534b0ba275a, type: 3} propertyPath: m_AnchorMax.x value: 0 @@ -268656,17 +268896,32 @@ PrefabInstance: propertyPath: m_AnchorMax.y value: 0 objectReference: {fileID: 0} + - target: {fileID: 6769867780048309697, guid: 8b2306d4cfca3b642afa5534b0ba275a, type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} - target: {fileID: 7313727169446888281, guid: 8b2306d4cfca3b642afa5534b0ba275a, type: 3} propertyPath: m_AnchorMax.x - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 7313727169446888281, guid: 8b2306d4cfca3b642afa5534b0ba275a, type: 3} propertyPath: m_AnchorMax.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 8399451797345624539, guid: 8b2306d4cfca3b642afa5534b0ba275a, type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8571000404631634029, guid: 8b2306d4cfca3b642afa5534b0ba275a, type: 3} + propertyPath: m_IsActive value: 0 objectReference: {fileID: 0} m_RemovedComponents: [] m_RemovedGameObjects: [] - m_AddedGameObjects: [] + m_AddedGameObjects: + - targetCorrespondingSourceObject: {fileID: 5210474334002245094, guid: 8b2306d4cfca3b642afa5534b0ba275a, type: 3} + insertIndex: -1 + addedObject: {fileID: 34523587} m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 8b2306d4cfca3b642afa5534b0ba275a, type: 3} --- !u!224 &5277713031054755333 stripped @@ -268674,6 +268929,11 @@ RectTransform: m_CorrespondingSourceObject: {fileID: 5210474333085558486, guid: 8b2306d4cfca3b642afa5534b0ba275a, type: 3} m_PrefabInstance: {fileID: 5277713031054755332} m_PrefabAsset: {fileID: 0} +--- !u!224 &5277713031054755334 stripped +RectTransform: + m_CorrespondingSourceObject: {fileID: 5210474334002245094, guid: 8b2306d4cfca3b642afa5534b0ba275a, type: 3} + m_PrefabInstance: {fileID: 5277713031054755332} + m_PrefabAsset: {fileID: 0} --- !u!114 &5277713031461887256 MonoBehaviour: m_ObjectHideFlags: 0 diff --git a/Assets/Scenes/BossRoom/DungeonEntrance.unity b/Assets/Scenes/BossRoom/DungeonEntrance.unity index ceea8bf..5d1ae03 100644 --- a/Assets/Scenes/BossRoom/DungeonEntrance.unity +++ b/Assets/Scenes/BossRoom/DungeonEntrance.unity @@ -189,7 +189,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!4 &54039277 Transform: m_ObjectHideFlags: 0 @@ -200,8 +200,8 @@ Transform: serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 16, y: 0.05, z: 16} - m_ConstrainProportionsScale: 0 + m_LocalScale: {x: 18, y: 0.05624998, z: 18} + m_ConstrainProportionsScale: 1 m_Children: [] m_Father: {fileID: 3169561862507413951} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -510,7 +510,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!4 &403260885 Transform: m_ObjectHideFlags: 0 @@ -521,8 +521,8 @@ Transform: serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 16, y: 0.05, z: 16} - m_ConstrainProportionsScale: 0 + m_LocalScale: {x: 18, y: 0.05624998, z: 18} + m_ConstrainProportionsScale: 1 m_Children: [] m_Father: {fileID: 249976107358570836} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -801,7 +801,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!4 &566881365 Transform: m_ObjectHideFlags: 0 @@ -812,8 +812,8 @@ Transform: serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 16, y: 0.05, z: 16} - m_ConstrainProportionsScale: 0 + m_LocalScale: {x: 18, y: 0.05624998, z: 18} + m_ConstrainProportionsScale: 1 m_Children: [] m_Father: {fileID: 5195700795859028913} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -1258,7 +1258,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!4 &1065926028 Transform: m_ObjectHideFlags: 0 @@ -1269,8 +1269,8 @@ Transform: serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 16, y: 0.05, z: 16} - m_ConstrainProportionsScale: 0 + m_LocalScale: {x: 18, y: 0.05624998, z: 18} + m_ConstrainProportionsScale: 1 m_Children: [] m_Father: {fileID: 6996768595326639848} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -2021,7 +2021,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!4 &1699078071 Transform: m_ObjectHideFlags: 0 @@ -2032,8 +2032,8 @@ Transform: serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 16, y: 0.05, z: 16} - m_ConstrainProportionsScale: 0 + m_LocalScale: {x: 18, y: 0.05624998, z: 18} + m_ConstrainProportionsScale: 1 m_Children: [] m_Father: {fileID: 5590359088119101749} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -2222,7 +2222,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!4 &1845327948 Transform: m_ObjectHideFlags: 0 @@ -2233,8 +2233,8 @@ Transform: serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 16, y: 0.05, z: 16} - m_ConstrainProportionsScale: 0 + m_LocalScale: {x: 18, y: 0.05624998, z: 18} + m_ConstrainProportionsScale: 1 m_Children: [] m_Father: {fileID: 1326862948614608678} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -2375,7 +2375,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!4 &1962636494 Transform: m_ObjectHideFlags: 0 @@ -2386,8 +2386,8 @@ Transform: serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 16, y: 0.05, z: 16} - m_ConstrainProportionsScale: 0 + m_LocalScale: {x: 18, y: 0.05624998, z: 18} + m_ConstrainProportionsScale: 1 m_Children: [] m_Father: {fileID: 1223475210011116500} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/Assets/Scripts/Gameplay/GameState/ServerBossRoomState.cs b/Assets/Scripts/Gameplay/GameState/ServerBossRoomState.cs index 61089e3..e8d3b2a 100644 --- a/Assets/Scripts/Gameplay/GameState/ServerBossRoomState.cs +++ b/Assets/Scripts/Gameplay/GameState/ServerBossRoomState.cs @@ -62,6 +62,7 @@ namespace Unity.BossRoom.Gameplay.GameState [Inject] ConnectionManager m_ConnectionManager; [Inject] PersistentGameState m_PersistentGameState; public Scoreboard scoreboard; + public static bool playerSpawned; protected override void Awake() { base.Awake(); diff --git a/Assets/Scripts/Gameplay/GameplayObjects/Character/ServerCharacter.cs b/Assets/Scripts/Gameplay/GameplayObjects/Character/ServerCharacter.cs index 3554fcb..917dc58 100644 --- a/Assets/Scripts/Gameplay/GameplayObjects/Character/ServerCharacter.cs +++ b/Assets/Scripts/Gameplay/GameplayObjects/Character/ServerCharacter.cs @@ -27,7 +27,7 @@ namespace Unity.BossRoom.Gameplay.GameplayObjects.Character ClientCharacter m_ClientCharacter; public ClientCharacter clientCharacter => m_ClientCharacter; - + [SerializeField] CharacterClass m_CharacterClass; @@ -149,20 +149,22 @@ namespace Unity.BossRoom.Gameplay.GameplayObjects.Character public bool IsOnAPlatform { get; private set; } = false; public bool IsCrow { get; private set; } = false; public bool IsSwapping { get; private set; } = false; - + public UIStateDisplayHandler uIStateDisplayHandler; public GameObject playerModel; // Original player model public GameObject crowModel; public Platform m_OccupiedPlatform; + public HeroActionBar heroActionBar; void Awake() { m_ServerActionPlayer = new ServerActionPlayer(this); NetLifeState = GetComponent(); NetHealthState = GetComponent(); m_State = GetComponent(); - uIStateDisplayHandler= GetComponent(); + uIStateDisplayHandler = GetComponent(); + heroActionBar = FindObjectOfType(); } //Hazim @@ -172,7 +174,7 @@ namespace Unity.BossRoom.Gameplay.GameplayObjects.Character { if (NetworkManager.Singleton.LocalClientId == OwnerClientId) { - var uistate= uIStateDisplayHandler.m_UIState; + var uistate = uIStateDisplayHandler.m_UIState; var panel = uistate.swapConfirmationPanel; if (panel != null) @@ -199,7 +201,7 @@ namespace Unity.BossRoom.Gameplay.GameplayObjects.Character } } - + public void SetAsCrow(bool status) { if (IsServer) @@ -225,13 +227,43 @@ namespace Unity.BossRoom.Gameplay.GameplayObjects.Character playerModel.SetActive(true); crowModel.SetActive(false); } - + [ClientRpc] private void UpdateCrowStatusClientRpc(bool status) { + if (IsOwner==false) + { + return; + } IsCrow = status; // Update the value for all clients + + if(heroActionBar==null) + { + Debug.Log("Hero action bar was null"); + heroActionBar=FindObjectOfType(); + } + + foreach (var button in heroActionBar.OtherButtons) + { + button.SetActive(!status); + } + foreach (var button in heroActionBar.CrowButtons) + { + button.SetActive(status); + } + //ToggleButtons(heroActionBar.OtherButtons, !status); + //ToggleButtons(heroActionBar.CrowButtons, status); } + //// Helper method to enable/disable button lists + //private void ToggleButtons(List buttons, bool isActive) + //{ + // foreach (var button in buttons) + // { + // button.SetActive(isActive); + // } + //} + public void SetTargetPlatform(int platformId) { if (IsServer) @@ -272,7 +304,7 @@ namespace Unity.BossRoom.Gameplay.GameplayObjects.Character public void OnLeavingPlatform(int platformId) { - + SetOnPlatform(false, platformId); // Automatically syncs to all clients } @@ -406,15 +438,15 @@ namespace Unity.BossRoom.Gameplay.GameplayObjects.Character } } - - + + [Rpc(SendTo.Server, RequireOwnership = false)] public void NotifySwapDecisionRpc(bool isAccepted) { if (!PendingSwapRequest.HasValue) return; ulong initiatingPlayerId = PendingSwapRequest.Value; - + if (NetworkManager.Singleton.SpawnManager.SpawnedObjects.TryGetValue(initiatingPlayerId, out var initiatingPlayerObj) && initiatingPlayerObj.TryGetComponent(out ServerCharacter initiatingPlayer)) { @@ -424,14 +456,14 @@ namespace Unity.BossRoom.Gameplay.GameplayObjects.Character { InitiateSwap(initiatingPlayer, this); Debug.Log($"Swap confirmed: {initiatingPlayer.name} and {this.name} are swapping."); - + } } PendingSwapRequest = null; } - + public void InitiateSwap(ServerCharacter initiatingPlayer, ServerCharacter targetPlayer) { var initiatingPlatform = PlatformManager.Instance.GetPlatformOccupiedByPlayer(initiatingPlayer); diff --git a/Assets/Scripts/Gameplay/Platform.cs b/Assets/Scripts/Gameplay/Platform.cs index 3445475..b8c96e4 100644 --- a/Assets/Scripts/Gameplay/Platform.cs +++ b/Assets/Scripts/Gameplay/Platform.cs @@ -160,7 +160,13 @@ namespace Unity.Multiplayer.Samples.BossRoom StopCoroutine(penaltyCoroutine); penaltyCoroutine = null; } + VacateTimeClientRpc(); + + } + [ClientRpc] + void VacateTimeClientRpc() + { if (timerCoroutine != null) { StopCoroutine(timerCoroutine); @@ -243,9 +249,15 @@ namespace Unity.Multiplayer.Samples.BossRoom ScoreManager.Instance.AddPlayerScore(player.OwnerClientId, score); } - penaltyCoroutine = StartCoroutine(HandleOccupationPenalty(player)); EnableBarrier(); + penaltyCoroutine = StartCoroutine(HandleOccupationPenalty(player)); + OccupyTimerClientRpc(); + } + + [ClientRpc] + public void OccupyTimerClientRpc() + { if (TimerObject != null) { TimerObject.SetActive(true); diff --git a/Assets/Scripts/Gameplay/UI/HeroActionBar.cs b/Assets/Scripts/Gameplay/UI/HeroActionBar.cs index fce7628..dfcdefb 100644 --- a/Assets/Scripts/Gameplay/UI/HeroActionBar.cs +++ b/Assets/Scripts/Gameplay/UI/HeroActionBar.cs @@ -45,6 +45,8 @@ namespace Unity.BossRoom.Gameplay.UI /// Our input-sender. Initialized in RegisterInputSender() /// ClientInputSender m_InputSender; + public List CrowButtons; + public List OtherButtons; /// /// Identifiers for the buttons on the action bar. @@ -57,7 +59,6 @@ namespace Unity.BossRoom.Gameplay.UI EmoteBar, Special3, Special4, - } /// diff --git a/Assets/Scripts/Gameplay/UI/PartyHUD.cs b/Assets/Scripts/Gameplay/UI/PartyHUD.cs index f2c5b16..b6c0fb0 100644 --- a/Assets/Scripts/Gameplay/UI/PartyHUD.cs +++ b/Assets/Scripts/Gameplay/UI/PartyHUD.cs @@ -52,7 +52,7 @@ namespace Unity.BossRoom.Gameplay.UI private Dictionary m_TrackedAllies = new Dictionary(); private ClientInputSender m_ClientSender; - + public Transform ScoreSpawnPos; void Awake() { // Make sure arrays are initialized diff --git a/Assets/Scripts/Gameplay/UI/UIStateDisplay.cs b/Assets/Scripts/Gameplay/UI/UIStateDisplay.cs index f5a8b08..521ee2f 100644 --- a/Assets/Scripts/Gameplay/UI/UIStateDisplay.cs +++ b/Assets/Scripts/Gameplay/UI/UIStateDisplay.cs @@ -20,6 +20,11 @@ namespace Unity.BossRoom.Gameplay.UI [SerializeField] UIHealth m_UIHealth; public FloatingScore floatingScorePrefab; + PartyHUD m_PartyHUD; + private void Awake() + { + m_PartyHUD=FindObjectOfType(); + } private void OnEnable() { ScoreManager.OnScoreUpdated += OnScoreChanged; @@ -41,8 +46,8 @@ namespace Unity.BossRoom.Gameplay.UI public void DisplayHealth(NetworkVariable networkedHealth, int maxValue) { - m_UIHealth.gameObject.SetActive(true); - m_UIHealth.Initialize(networkedHealth, maxValue); + // m_UIHealth.gameObject.SetActive(true); + // m_UIHealth.Initialize(networkedHealth, maxValue); } public void HideHealth() @@ -70,7 +75,7 @@ namespace Unity.BossRoom.Gameplay.UI private void RpcPlayScoreAnimationClientRpc(int change, UnityEngine.Transform spawnPosition) { // Instantiate the floating score effect prefab on each client. - FloatingScore effect = Instantiate(floatingScorePrefab, spawnPosition); + FloatingScore effect = Instantiate(floatingScorePrefab, m_PartyHUD.ScoreSpawnPos); effect.transform.localPosition = Vector3.zero; effect.transform.localEulerAngles= Vector3.zero; effect.Initialize(change); diff --git a/Assets/Scripts/Gameplay/UserInput/ClientInputSender.cs b/Assets/Scripts/Gameplay/UserInput/ClientInputSender.cs index 63f8c69..6307c0f 100644 --- a/Assets/Scripts/Gameplay/UserInput/ClientInputSender.cs +++ b/Assets/Scripts/Gameplay/UserInput/ClientInputSender.cs @@ -532,7 +532,6 @@ namespace Unity.BossRoom.Gameplay.UserInput private void HandleAbilityInput() { - if (Input.GetKeyDown(KeyCode.E)) // Dash'N'Crash { if (!m_ServerCharacter.IsCrow) @@ -544,14 +543,10 @@ namespace Unity.BossRoom.Gameplay.UserInput } if (Input.GetKeyDown(KeyCode.R)) // Freeze Throw { - Debug.Log("Ali Sharoz UnComment This!"); - - ActivateAbilityIfAllowed(GameDataSource.Instance.FreezeThrowAbilityKey); + ActivateAbilityIfAllowed(GameDataSource.Instance.FreezeThrowAbilityKey); } if (Input.GetKeyDown(KeyCode.F)) // Vector Wall { - Debug.Log("Ali Sharoz UnComment This!"); - if (m_ServerCharacter.IsCrow) { m_UIMessageFeed.DisplayMessage("Ability not available for crow"); @@ -561,12 +556,11 @@ namespace Unity.BossRoom.Gameplay.UserInput } if (Input.GetKeyDown(KeyCode.C)) // The Executioner { - Debug.Log("UnComment this Ali"); - //if (m_ServerCharacter.IsCrow) - //{ - // m_UIMessageFeed.DisplayMessage("Ability not available for crow"); - // return; - //} + if (m_ServerCharacter.IsCrow) + { + m_UIMessageFeed.DisplayMessage("Ability not available for crow"); + return; + } ActivateAbilityIfAllowed(GameDataSource.Instance.TheExecutionerKey); } if (Input.GetKeyDown(KeyCode.V)) // Crow's Foresight @@ -577,11 +571,8 @@ namespace Unity.BossRoom.Gameplay.UserInput return; } ActivateAbilityIfAllowed(GameDataSource.Instance.CrowsForesightKey); - } - - + } } - private void HandleSprint() { if(m_ServerCharacter.IsCrow) return;