diff --git a/.idea/.idea.HALLUCINATE/.idea/workspace.xml b/.idea/.idea.HALLUCINATE/.idea/workspace.xml index 529e290e..71ec12d6 100644 --- a/.idea/.idea.HALLUCINATE/.idea/workspace.xml +++ b/.idea/.idea.HALLUCINATE/.idea/workspace.xml @@ -6,8 +6,553 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -141,7 +689,7 @@ - + diff --git a/Assets/Editor/UIManagerEditor.cs b/Assets/Editor/UIManagerEditor.cs deleted file mode 100644 index f7bb900a..00000000 --- a/Assets/Editor/UIManagerEditor.cs +++ /dev/null @@ -1,70 +0,0 @@ -using UnityEditor; -using UnityEngine; -using UI; - -namespace UIEditor -{ - [CustomEditor(typeof(UIManager))] - public class UIManagerEditor : UnityEditor.Editor - { - public override void OnInspectorGUI() - { - UIManager manager = (UIManager)target; - - // Draw default fields (Initial Screen, Focus Radius, Global Opacity, etc.) - base.OnInspectorGUI(); - - EditorGUILayout.Space(10); - EditorGUILayout.LabelField("GLOBAL STYLING", EditorStyles.boldLabel); - - // Re-sync if opacity slider changes - EditorGUI.BeginChangeCheck(); - if (EditorGUI.EndChangeCheck()) - { - manager.SyncScreens(); - EditorUtility.SetDirty(manager); - } - - EditorGUILayout.Space(20); - EditorGUILayout.LabelField("QUICK DASHBOARD", EditorStyles.boldLabel); - EditorGUILayout.HelpBox("Click các nút dưới đây để xem nhanh giao diện mà không cần Play game.", MessageType.Info); - - if (manager.screens != null) - { - foreach (var screen in manager.screens) - { - EditorGUILayout.BeginHorizontal(); - - // Nút bấm để hiện duy nhất màn hình này - if (GUILayout.Button($"SHOW: {screen.screenName}", GUILayout.Height(30))) - { - manager.ShowOnly(screen.screenName); - EditorUtility.SetDirty(manager); - } - - // Toggle nhanh trạng thái Active - bool newActive = EditorGUILayout.Toggle(screen.isActive, GUILayout.Width(20)); - if (newActive != screen.isActive) - { - screen.isActive = newActive; - manager.SyncScreens(); - EditorUtility.SetDirty(manager); - } - - EditorGUILayout.EndHorizontal(); - } - } - - EditorGUILayout.Space(10); - if (GUILayout.Button("HIDE ALL SCREENS", GUILayout.Height(25))) - { - foreach (var s in manager.screens) s.isActive = false; - manager.SyncScreens(); - EditorUtility.SetDirty(manager); - } - - EditorGUILayout.Space(10); - EditorGUILayout.HelpBox("TIP: Bạn có thể thay đổi Global Opacity ở trên để xem độ mờ của toàn bộ UI.", MessageType.None); - } - } -} diff --git a/Assets/Editor/UIManagerEditor.cs.meta b/Assets/Editor/UIManagerEditor.cs.meta deleted file mode 100644 index e0e7bda8..00000000 --- a/Assets/Editor/UIManagerEditor.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 0e118f8ca802ae54e92d305688e5b5e3 \ No newline at end of file diff --git a/Assets/Prefabs/Player.prefab b/Assets/Prefabs/Player.prefab index 4cb4b488..a0f81df1 100644 --- a/Assets/Prefabs/Player.prefab +++ b/Assets/Prefabs/Player.prefab @@ -9,19 +9,23 @@ GameObject: serializedVersion: 6 m_Component: - component: {fileID: 3154409663696148700} - - component: {fileID: 5811177247042239962} - component: {fileID: 8915611492738107882} + - component: {fileID: 5811177247042239962} - component: {fileID: 9098752589608501196} - component: {fileID: 5600577104145922999} - component: {fileID: 3010251870038942475} - component: {fileID: 830356296960548640} - - component: {fileID: 3043298118541876184} - - component: {fileID: 3866929919288054183} - - component: {fileID: 5773292363125757170} - component: {fileID: 504047695906043424} - component: {fileID: -5076913349690967641} - component: {fileID: 5474834257287499008} - component: {fileID: 591040529181574494} + - component: {fileID: 7826563193135964281} + - component: {fileID: 517879385770431681} + - component: {fileID: 8601091490777624370} + - component: {fileID: 7730391503324595278} + - component: {fileID: 3043298118541876184} + - component: {fileID: 5773292363125757170} + - component: {fileID: 3866929919288054183} m_Layer: 0 m_Name: Player m_TagString: Player @@ -45,29 +49,8 @@ Transform: - {fileID: 8004958684693924044} - {fileID: 1837528887711025940} - {fileID: 2204320233506982349} - - {fileID: 197467923929726417} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &5811177247042239962 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1054594849095937263} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 169e37d35fede30409266070c88b118f, type: 3} - m_Name: - m_EditorClassIdentifier: Assembly-CSharp::OnlyScove.Scripts.EnvironmentScanner - forwardRayOffset: {x: 0, y: 2.5, z: 0} - forwardRayLength: 10 - obstacleLayer: - serializedVersion: 2 - m_Bits: 128 - heightRayLength: 0 - interactionOffset: {x: 0, y: 1.5, z: 0} - interactionRadius: 0.5 --- !u!143 &8915611492738107882 CharacterController: m_ObjectHideFlags: 0 @@ -93,6 +76,26 @@ CharacterController: m_SkinWidth: 0.019215723 m_MinMoveDistance: 0.001 m_Center: {x: 0, y: 0.8984509, z: 0.05} +--- !u!114 &5811177247042239962 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1054594849095937263} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 169e37d35fede30409266070c88b118f, type: 3} + m_Name: + m_EditorClassIdentifier: Assembly-CSharp::OnlyScove.Scripts.EnvironmentScanner + forwardRayOffset: {x: 0, y: 2.5, z: 0} + forwardRayLength: 10 + obstacleLayer: + serializedVersion: 2 + m_Bits: 128 + heightRayLength: 0 + interactionOffset: {x: 0, y: 1.5, z: 0} + interactionRadius: 0.5 --- !u!95 &9098752589608501196 Animator: serializedVersion: 7 @@ -377,93 +380,13 @@ MonoBehaviour: k__BackingField: {fileID: 5600577104145922999} k__BackingField: {fileID: 9098752589608501196} k__BackingField: {fileID: 5811177247042239962} - speedParamName: Speed - velocityXParamName: Velocity X - velocityZParamName: Velocity Z - k__BackingField: 5 - k__BackingField: 10 - k__BackingField: 9 - k__BackingField: 1.5 - k__BackingField: 15 - k__BackingField: 500 - k__BackingField: 0.2 - k__BackingField: 2 - k__BackingField: -9.81 - k__BackingField: -20 - k__BackingField: 0.11529434 - k__BackingField: {x: 0, y: 0.079278834, z: 0.05} - k__BackingField: - serializedVersion: 2 - m_Bits: 64 - k__BackingField: 2 - k__BackingField: - serializedVersion: 2 - m_Bits: 512 + Stats: {fileID: 7826563193135964281} + Interaction: {fileID: 517879385770431681} + Movement: {fileID: 8601091490777624370} + AnimationHandler: {fileID: 7730391503324595278} _NetworkedCameraRotation: {x: 0, y: 0, z: 0, w: 0} _NetworkedMoveInput: {x: 0, y: 0} _NetworkedSpeed: 0 - _NetworkedPosition: {x: 0, y: 0, z: 0} ---- !u!114 &3043298118541876184 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1054594849095937263} - m_Enabled: 0 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: e16a6690e589f0449ad89a6bf508ab62, type: 3} - m_Name: - m_EditorClassIdentifier: Assembly-CSharp::OnlyScove.Scripts.GameSetup.CharacterAutoSetup - defaultHeight: 1.8 - defaultShoulderWidth: 0.4 - modelRoot: {fileID: 0} - autoDetectOnStart: 0 - zCenterOffset: 0.05 ---- !u!114 &3866929919288054183 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1054594849095937263} - m_Enabled: 0 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 1630760c9d97a5f4eb1bc179549c95cd, type: 3} - m_Name: - m_EditorClassIdentifier: Assembly-CSharp::SukunaAbilityController - inputReader: {fileID: 5600577104145922999} - blackProjectilePrefab: {fileID: 7925862234553078923, guid: a9db8dc0d7288b8418ab54e786fbffa7, type: 3} - redProjectilePrefab: {fileID: 1113287330716207023, guid: 03163717f6c5cad409e7e7f079f06ea5, type: 3} - attackRate: 0.1 - forwardOffset: 4.55 - verticalOffset: 1 - rangeX: {x: -360, y: 360} - rangeY: {x: -10, y: 10} - rangeZ: {x: 50, y: 120} ---- !u!114 &5773292363125757170 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1054594849095937263} - m_Enabled: 0 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 271dd39a46bad974485107bb1a070e0a, type: 3} - m_Name: - m_EditorClassIdentifier: Assembly-CSharp::OnlyScove.Scripts.SukunaDomainController - playerStateMachine: {fileID: 830356296960548640} - slashPrefab: {fileID: 7424378359907903745, guid: 80f98b444eac25541afe9e9081c8303a, type: 3} - shrinePrefab: {fileID: 5712645696331672719, guid: b0b71c635e9971346ae9ab6b7ecdd65d, type: 3} - domainVolumeProfile: {fileID: 11400000, guid: 837c34edbcc0ece44ae8c54e25ec20de, type: 2} - cinematicCameraPoint: {fileID: 0} - domainRadius: 30 - domainDuration: 10 - slashRate: 100 - shrineRiseHeight: 5 - shrineFloorOffset: 0.5 - camMoveSpeed: 4 --- !u!114 &504047695906043424 MonoBehaviour: m_ObjectHideFlags: 0 @@ -501,6 +424,10 @@ MonoBehaviour: - {fileID: 830356296960548640} - {fileID: 504047695906043424} - {fileID: 5474834257287499008} + - {fileID: 7826563193135964281} + - {fileID: 517879385770431681} + - {fileID: 8601091490777624370} + - {fileID: 7730391503324595278} ForceRemoteRenderTimeframe: 0 --- !u!114 &5474834257287499008 MonoBehaviour: @@ -514,9 +441,9 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 70abb536cf50f2948882e913634daedf, type: 3} m_Name: m_EditorClassIdentifier: Assembly-CSharp::_PlayerInfo - _playerName: + _playerName: Runner playerDataManager: {fileID: 0} - nameText: {fileID: 4162277074137292865} + nameText: {fileID: 0} characterIcons: - {fileID: 2663176581072049613} - {fileID: 9158604782533009244} @@ -537,108 +464,144 @@ MonoBehaviour: followOffset: {x: 1.5, y: 2, z: 0} smoothTime: 0.15 lookAtCamera: 1 ---- !u!1 &2962936552048247184 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 197467923929726417} - - component: {fileID: 1018225786754720096} - - component: {fileID: 4475173704176190241} - - component: {fileID: 289368611602352569} - m_Layer: 5 - m_Name: Canvas - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &197467923929726417 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2962936552048247184} - m_LocalRotation: {x: 0, y: 1, z: 0, w: 0} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 0.01, y: 0.01, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: - - {fileID: 7931877178581140798} - m_Father: {fileID: 3154409663696148700} - m_LocalEulerAnglesHint: {x: 0, y: 180, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: -0.9036, y: 1.8528} - m_SizeDelta: {x: 509.2823, y: 17.4373} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!223 &1018225786754720096 -Canvas: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2962936552048247184} - m_Enabled: 1 - serializedVersion: 3 - m_RenderMode: 2 - m_Camera: {fileID: 0} - m_PlaneDistance: 100 - m_PixelPerfect: 0 - m_ReceivesEvents: 1 - m_OverrideSorting: 0 - m_OverridePixelPerfect: 0 - m_SortingBucketNormalizedSize: 0 - m_VertexColorAlwaysGammaSpace: 0 - m_AdditionalShaderChannelsFlag: 25 - m_UpdateRectTransformForStandalone: 0 - m_SortingLayerID: 0 - m_SortingOrder: 0 - m_TargetDisplay: 0 ---- !u!114 &4475173704176190241 +--- !u!114 &7826563193135964281 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2962936552048247184} + m_GameObject: {fileID: 1054594849095937263} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} + m_Script: {fileID: 11500000, guid: a1494b79b59fcdf4d9f7956dde31bc42, type: 3} m_Name: - m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.CanvasScaler - m_UiScaleMode: 0 - m_ReferencePixelsPerUnit: 100 - m_ScaleFactor: 1 - m_ReferenceResolution: {x: 800, y: 600} - m_ScreenMatchMode: 0 - m_MatchWidthOrHeight: 0 - m_PhysicalUnit: 3 - m_FallbackScreenDPI: 96 - m_DefaultSpriteDPI: 96 - m_DynamicPixelsPerUnit: 1 - m_PresetInfoIsWorld: 1 ---- !u!114 &289368611602352569 + m_EditorClassIdentifier: Assembly-CSharp::OnlyScove.Scripts.PlayerStats + _Health: 100 + _Stamina: 100 + _NoiseLevel: 0 +--- !u!114 &517879385770431681 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2962936552048247184} + m_GameObject: {fileID: 1054594849095937263} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Script: {fileID: 11500000, guid: 9dcff2851697b4f4c8c25ef8381665ba, type: 3} m_Name: - m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.GraphicRaycaster - m_IgnoreReversedGraphics: 1 - m_BlockingObjects: 0 - m_BlockingMask: + m_EditorClassIdentifier: Assembly-CSharp::OnlyScove.Scripts.PlayerInteraction + InteractionRange: 2 + InteractionMask: serializedVersion: 2 - m_Bits: 4294967295 + m_Bits: 512 +--- !u!114 &8601091490777624370 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1054594849095937263} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 79bbcfd4d37b7834ebe0d61bb649714d, type: 3} + m_Name: + m_EditorClassIdentifier: Assembly-CSharp::OnlyScove.Scripts.PlayerMovement + k__BackingField: 3 + k__BackingField: 6 + k__BackingField: 9 + k__BackingField: 1.5 + k__BackingField: 10 + k__BackingField: 500 + k__BackingField: 2 + k__BackingField: -15 + k__BackingField: -20 + k__BackingField: 0.2 + k__BackingField: {x: 0, y: 0, z: 0} + k__BackingField: + serializedVersion: 2 + m_Bits: 64 + _IsGrounded: 0 + _WasGrounded: 0 + _VelocityY: 0 + _NetworkedPosition: {x: 0, y: 0, z: 0} +--- !u!114 &7730391503324595278 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1054594849095937263} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 965ec86f3b9695640bdc85e624d0e9e7, type: 3} + m_Name: + m_EditorClassIdentifier: Assembly-CSharp::OnlyScove.Scripts.PlayerAnimationHandler + speedParamName: Speed + velocityXParamName: Velocity X + velocityZParamName: Velocity Z + animationDamping: 0.2 +--- !u!114 &3043298118541876184 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1054594849095937263} + m_Enabled: 0 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e16a6690e589f0449ad89a6bf508ab62, type: 3} + m_Name: + m_EditorClassIdentifier: Assembly-CSharp::OnlyScove.Scripts.GameSetup.CharacterAutoSetup + defaultHeight: 1.8 + defaultShoulderWidth: 0.4 + modelRoot: {fileID: 0} + autoDetectOnStart: 0 + zCenterOffset: 0.05 +--- !u!114 &5773292363125757170 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1054594849095937263} + m_Enabled: 0 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 271dd39a46bad974485107bb1a070e0a, type: 3} + m_Name: + m_EditorClassIdentifier: Assembly-CSharp::OnlyScove.Scripts.SukunaDomainController + playerStateMachine: {fileID: 830356296960548640} + slashPrefab: {fileID: 7424378359907903745, guid: 80f98b444eac25541afe9e9081c8303a, type: 3} + shrinePrefab: {fileID: 5712645696331672719, guid: b0b71c635e9971346ae9ab6b7ecdd65d, type: 3} + domainVolumeProfile: {fileID: 11400000, guid: 837c34edbcc0ece44ae8c54e25ec20de, type: 2} + cinematicCameraPoint: {fileID: 0} + domainRadius: 30 + domainDuration: 10 + slashRate: 100 + shrineRiseHeight: 5 + shrineFloorOffset: 0.5 + camMoveSpeed: 4 +--- !u!114 &3866929919288054183 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1054594849095937263} + m_Enabled: 0 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1630760c9d97a5f4eb1bc179549c95cd, type: 3} + m_Name: + m_EditorClassIdentifier: Assembly-CSharp::SukunaAbilityController + inputReader: {fileID: 5600577104145922999} + blackProjectilePrefab: {fileID: 7925862234553078923, guid: a9db8dc0d7288b8418ab54e786fbffa7, type: 3} + redProjectilePrefab: {fileID: 1113287330716207023, guid: 03163717f6c5cad409e7e7f079f06ea5, type: 3} + attackRate: 0.1 + forwardOffset: 4.55 + verticalOffset: 1 + rangeX: {x: -360, y: 360} + rangeY: {x: -10, y: 10} + rangeZ: {x: 50, y: 120} --- !u!1 &3751838835891881608 GameObject: m_ObjectHideFlags: 0 @@ -803,143 +766,6 @@ Transform: m_Children: [] m_Father: {fileID: 3154409663696148700} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &8169517334317903866 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 7931877178581140798} - - component: {fileID: 5886073058445326450} - - component: {fileID: 4162277074137292865} - m_Layer: 5 - m_Name: PlayerNameCanvas - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &7931877178581140798 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8169517334317903866} - 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: 197467923929726417} - 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_AnchoredPosition: {x: -90.9, y: 14.141} - m_SizeDelta: {x: 291.33, y: 45.719} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!222 &5886073058445326450 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8169517334317903866} - m_CullTransparentMesh: 1 ---- !u!114 &4162277074137292865 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8169517334317903866} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} - m_Name: - m_EditorClassIdentifier: Unity.TextMeshPro::TMPro.TextMeshProUGUI - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_text: PlayerName - m_isRightToLeft: 0 - m_fontAsset: {fileID: 11400000, guid: a32ff21294cb0854181fe2ea1602ab9f, type: 2} - m_sharedMaterial: {fileID: -5366533617542256513, guid: a32ff21294cb0854181fe2ea1602ab9f, type: 2} - m_fontSharedMaterials: [] - m_fontMaterial: {fileID: 0} - m_fontMaterials: [] - m_fontColor32: - serializedVersion: 2 - rgba: 4294967295 - m_fontColor: {r: 1, g: 1, b: 1, a: 1} - m_enableVertexGradient: 0 - m_colorMode: 3 - m_fontColorGradient: - topLeft: {r: 1, g: 1, b: 1, a: 1} - topRight: {r: 1, g: 1, b: 1, a: 1} - bottomLeft: {r: 1, g: 1, b: 1, a: 1} - bottomRight: {r: 1, g: 1, b: 1, a: 1} - m_fontColorGradientPreset: {fileID: 0} - m_spriteAsset: {fileID: 0} - m_tintAllSprites: 0 - m_StyleSheet: {fileID: 0} - m_TextStyleHashCode: -1183493901 - m_overrideHtmlColors: 0 - m_faceColor: - serializedVersion: 2 - rgba: 4294967295 - m_fontSize: 44.85 - m_fontSizeBase: 36 - m_fontWeight: 400 - m_enableAutoSizing: 1 - m_fontSizeMin: 18 - m_fontSizeMax: 72 - m_fontStyle: 1 - m_HorizontalAlignment: 2 - m_VerticalAlignment: 512 - m_textAlignment: 65535 - m_characterSpacing: 0 - m_characterHorizontalScale: 1 - m_wordSpacing: 0 - m_lineSpacing: 0 - m_lineSpacingMax: 0 - m_paragraphSpacing: 0 - m_charWidthMaxAdj: 0 - m_TextWrappingMode: 1 - m_wordWrappingRatios: 0.4 - m_overflowMode: 0 - m_linkedTextComponent: {fileID: 0} - parentLinkedComponent: {fileID: 0} - m_enableKerning: 0 - m_ActiveFontFeatures: 6e72656b - m_enableExtraPadding: 0 - checkPaddingRequired: 0 - m_isRichText: 1 - m_EmojiFallbackSupport: 1 - m_parseCtrlCharacters: 1 - m_isOrthographic: 1 - m_isCullingEnabled: 0 - m_horizontalMapping: 0 - m_verticalMapping: 0 - m_uvLineOffset: 0 - m_geometrySortingOrder: 0 - m_IsTextObjectScaleStatic: 0 - m_VertexBufferAutoSizeReduction: 0 - m_useMaxVisibleDescender: 1 - m_pageToDisplay: 1 - m_margin: {x: 0, y: 0, z: 0, w: 0} - m_isUsingLegacyAnimationComponent: 0 - m_isVolumetricText: 0 - m_hasFontAssetChanged: 0 - m_baseMaterial: {fileID: 0} - m_maskOffset: {x: 0, y: 0, z: 0, w: 0} --- !u!1 &8335303598418656312 GameObject: m_ObjectHideFlags: 0 @@ -1074,15 +900,15 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: -8679921383154817045, guid: 5847774ba45dc754598435b50d4a0247, type: 3} propertyPath: m_LocalRotation.x - value: -0 + value: 0 objectReference: {fileID: 0} - target: {fileID: -8679921383154817045, guid: 5847774ba45dc754598435b50d4a0247, type: 3} propertyPath: m_LocalRotation.y - value: -0 + value: 0 objectReference: {fileID: 0} - target: {fileID: -8679921383154817045, guid: 5847774ba45dc754598435b50d4a0247, type: 3} propertyPath: m_LocalRotation.z - value: -0 + value: 0 objectReference: {fileID: 0} - target: {fileID: -8679921383154817045, guid: 5847774ba45dc754598435b50d4a0247, type: 3} propertyPath: m_LocalEulerAnglesHint.x diff --git a/Assets/Scove/UIScaleTest.unity b/Assets/Scove/UIScaleTest.unity index f372bdb2..78116e9d 100644 --- a/Assets/Scove/UIScaleTest.unity +++ b/Assets/Scove/UIScaleTest.unity @@ -119,7 +119,7 @@ NavMeshSettings: debug: m_Flags: 0 m_NavMeshData: {fileID: 0} ---- !u!1 &257796813 +--- !u!1 &458228298 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -127,31 +127,49 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 257796816} - - component: {fileID: 257796814} - - component: {fileID: 257796815} + - component: {fileID: 458228301} + - component: {fileID: 458228300} + - component: {fileID: 458228299} m_Layer: 0 - m_Name: Doc_Lounge + m_Name: UIManager m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!114 &257796814 +--- !u!114 &458228299 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 257796813} + m_GameObject: {fileID: 458228298} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: bcb7b8ed439bb4546b0648c627c2ce5d, type: 3} + m_Name: + m_EditorClassIdentifier: Assembly-CSharp::Hallucinate.UI.UIManager + mainMenuTemplate: {fileID: 9197481963319205126, guid: 8dcbe9fd5e8c43c43921af21a6347624, type: 3} + lobbyTemplate: {fileID: 9197481963319205126, guid: 2b2480fff4320714e9b503e7d5ef2c9f, type: 3} + profileTemplate: {fileID: 9197481963319205126, guid: e481c7d94f843374cb57e215bf9b0624, type: 3} + settingsTemplate: {fileID: 9197481963319205126, guid: 1e24e32e93afac8449d0bb181ab5c6a9, type: 3} + hudTemplate: {fileID: 9197481963319205126, guid: b87ba33c06a8c1d46a3d9f03416ebf3f, type: 3} + showDebugInfo: 1 +--- !u!114 &458228300 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 458228298} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 19102, guid: 0000000000000000e000000000000000, type: 0} m_Name: m_EditorClassIdentifier: UnityEngine.dll::UnityEngine.UIElements.UIDocument - m_PanelSettings: {fileID: 11400000, guid: 04bb65da4fe76fc4a9926df48b2ba88b, type: 2} + m_PanelSettings: {fileID: 11400000, guid: c093ebe66178f9047be53f245ccc3c2d, type: 2} m_ParentUI: {fileID: 0} - sourceAsset: {fileID: 9197481963319205126, guid: 1acf05b4c3eb7964b9b87b16b66c85f8, type: 3} + sourceAsset: {fileID: 0} m_SortingOrder: 0 m_Position: 0 m_WorldSpaceSizeMode: 1 @@ -160,32 +178,20 @@ MonoBehaviour: m_PivotReferenceSize: 0 m_Pivot: 0 m_WorldSpaceCollider: {fileID: 0} ---- !u!114 &257796815 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 257796813} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: ac201603ede0899488995be3d88ea0dc, type: 3} - m_Name: - m_EditorClassIdentifier: Assembly-CSharp::UI.LoungeController ---- !u!4 &257796816 +--- !u!4 &458228301 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 257796813} + m_GameObject: {fileID: 458228298} serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalPosition: {x: -16124.571, y: -11651.664, z: 100.93924} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] - m_Father: {fileID: 1183887570} + m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &626355268 GameObject: @@ -314,144 +320,6 @@ MonoBehaviour: m_ShadowLayerMask: 1 m_RenderingLayers: 1 m_ShadowRenderingLayers: 1 ---- !u!1 &666657091 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 666657093} - - component: {fileID: 666657092} - - component: {fileID: 666657094} - m_Layer: 0 - m_Name: Doc_Profile - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &666657092 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 666657091} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 19102, guid: 0000000000000000e000000000000000, type: 0} - m_Name: - m_EditorClassIdentifier: UnityEngine.dll::UnityEngine.UIElements.UIDocument - m_PanelSettings: {fileID: 11400000, guid: 04bb65da4fe76fc4a9926df48b2ba88b, type: 2} - m_ParentUI: {fileID: 0} - sourceAsset: {fileID: 9197481963319205126, guid: 4b61efb7dda830a43ad6b05998e85a6d, type: 3} - m_SortingOrder: 0 - m_Position: 0 - m_WorldSpaceSizeMode: 1 - m_WorldSpaceWidth: 1920 - m_WorldSpaceHeight: 1080 - m_PivotReferenceSize: 0 - m_Pivot: 0 - m_WorldSpaceCollider: {fileID: 0} ---- !u!4 &666657093 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 666657091} - 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: 1183887570} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &666657094 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 666657091} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: fdea16b110511ef45889ed832b63560b, type: 3} - m_Name: - m_EditorClassIdentifier: Assembly-CSharp::UI.ProfileController ---- !u!1 &1136953558 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1136953560} - - component: {fileID: 1136953559} - - component: {fileID: 1136953561} - m_Layer: 0 - m_Name: Doc_HUD - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &1136953559 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1136953558} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 19102, guid: 0000000000000000e000000000000000, type: 0} - m_Name: - m_EditorClassIdentifier: UnityEngine.dll::UnityEngine.UIElements.UIDocument - m_PanelSettings: {fileID: 11400000, guid: 04bb65da4fe76fc4a9926df48b2ba88b, type: 2} - m_ParentUI: {fileID: 0} - sourceAsset: {fileID: 9197481963319205126, guid: b8da157d472223d4889a01228b36ef8b, type: 3} - m_SortingOrder: 0 - m_Position: 0 - m_WorldSpaceSizeMode: 1 - m_WorldSpaceWidth: 1920 - m_WorldSpaceHeight: 1080 - m_PivotReferenceSize: 0 - m_Pivot: 0 - m_WorldSpaceCollider: {fileID: 0} ---- !u!4 &1136953560 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1136953558} - 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: 1183887570} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &1136953561 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1136953558} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: e79b70607af6eeb458c8eb6605e39b56, type: 3} - m_Name: - m_EditorClassIdentifier: Assembly-CSharp::UI.HUDController - hudDocument: {fileID: 1136953559} - autoHideDelay: 5 --- !u!1 &1157680018 GameObject: m_ObjectHideFlags: 0 @@ -499,237 +367,6 @@ Transform: m_Children: [] m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &1183887568 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1183887570} - - component: {fileID: 1183887569} - m_Layer: 0 - m_Name: UIManager - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &1183887569 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1183887568} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: bcb7b8ed439bb4546b0648c627c2ce5d, type: 3} - m_Name: - m_EditorClassIdentifier: Assembly-CSharp::UI.UIManager - screens: - - screenName: MainMenu - document: {fileID: 2003742651} - isOverlay: 0 - isActive: 1 - - screenName: Lobby - document: {fileID: 1471116802} - isOverlay: 0 - isActive: 0 - - screenName: Lounge - document: {fileID: 257796814} - isOverlay: 0 - isActive: 0 - - screenName: HUD - document: {fileID: 1136953559} - isOverlay: 0 - isActive: 0 - - screenName: Settings - document: {fileID: 1582124357} - isOverlay: 1 - isActive: 0 - - screenName: Profile - document: {fileID: 666657092} - isOverlay: 0 - isActive: 0 - initialScreen: MainMenu - trailSprite: {fileID: 21300000, guid: b9c4a623634019648b505c6122243b00, type: 3} - trailFadeSpeed: 3 - trailCount: 15 - focusRadius: 300 - globalOpacity: 1 - isMainMenuActive: 0 ---- !u!4 &1183887570 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1183887568} - serializedVersion: 2 - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -16135.612, y: -11645.337, z: 92.19762} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: - - {fileID: 2003742650} - - {fileID: 1471116803} - - {fileID: 257796816} - - {fileID: 1136953560} - - {fileID: 1582124358} - - {fileID: 666657093} - m_Father: {fileID: 0} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &1471116801 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1471116803} - - component: {fileID: 1471116802} - - component: {fileID: 1471116804} - m_Layer: 0 - m_Name: Doc_Lobby - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &1471116802 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1471116801} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 19102, guid: 0000000000000000e000000000000000, type: 0} - m_Name: - m_EditorClassIdentifier: UnityEngine.dll::UnityEngine.UIElements.UIDocument - m_PanelSettings: {fileID: 11400000, guid: 04bb65da4fe76fc4a9926df48b2ba88b, type: 2} - m_ParentUI: {fileID: 0} - sourceAsset: {fileID: 9197481963319205126, guid: 971b07b6bc60233469ca493b8f558225, type: 3} - m_SortingOrder: 0 - m_Position: 0 - m_WorldSpaceSizeMode: 1 - m_WorldSpaceWidth: 1920 - m_WorldSpaceHeight: 1080 - m_PivotReferenceSize: 0 - m_Pivot: 0 - m_WorldSpaceCollider: {fileID: 0} ---- !u!4 &1471116803 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1471116801} - 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: 1183887570} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &1471116804 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1471116801} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 9c37c552a9c18a242bcc8860a0a5212f, type: 3} - m_Name: - m_EditorClassIdentifier: Assembly-CSharp::UI.LobbyController ---- !u!1 &1582124356 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1582124358} - - component: {fileID: 1582124357} - - component: {fileID: 1582124359} - - component: {fileID: 1582124360} - m_Layer: 0 - m_Name: Doc_Settings - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &1582124357 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1582124356} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 19102, guid: 0000000000000000e000000000000000, type: 0} - m_Name: - m_EditorClassIdentifier: UnityEngine.dll::UnityEngine.UIElements.UIDocument - m_PanelSettings: {fileID: 11400000, guid: 04bb65da4fe76fc4a9926df48b2ba88b, type: 2} - m_ParentUI: {fileID: 0} - sourceAsset: {fileID: 9197481963319205126, guid: b35e62e5dcc1bfb42bf0d3f630fc356d, type: 3} - m_SortingOrder: 0 - m_Position: 0 - m_WorldSpaceSizeMode: 1 - m_WorldSpaceWidth: 1920 - m_WorldSpaceHeight: 1080 - m_PivotReferenceSize: 0 - m_Pivot: 0 - m_WorldSpaceCollider: {fileID: 0} ---- !u!4 &1582124358 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1582124356} - 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: 1183887570} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &1582124359 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1582124356} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 5534bcf4869df944883c6fd2a17a6a5a, type: 3} - m_Name: - m_EditorClassIdentifier: Assembly-CSharp::UI.SettingsController ---- !u!114 &1582124360 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1582124356} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 5c17a3f09ee49ff48a0e3e2b45080257, type: 3} - m_Name: - m_EditorClassIdentifier: Assembly-CSharp::UI.LocalizationManager --- !u!1 &1588175186 GameObject: m_ObjectHideFlags: 0 @@ -917,84 +554,12 @@ MonoBehaviour: m_VarianceClampScale: 0.9 m_ContrastAdaptiveSharpening: 0 m_Version: 2 ---- !u!1 &2003742649 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 2003742650} - - component: {fileID: 2003742651} - - component: {fileID: 2003742652} - m_Layer: 0 - m_Name: Doc_MainMenu - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &2003742650 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2003742649} - 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: 1183887570} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &2003742651 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2003742649} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 19102, guid: 0000000000000000e000000000000000, type: 0} - m_Name: - m_EditorClassIdentifier: UnityEngine.dll::UnityEngine.UIElements.UIDocument - m_PanelSettings: {fileID: 11400000, guid: 04bb65da4fe76fc4a9926df48b2ba88b, type: 2} - m_ParentUI: {fileID: 0} - sourceAsset: {fileID: 9197481963319205126, guid: 1e4b5a7d928d98949af5f96c310e5e05, type: 3} - m_SortingOrder: 0 - m_Position: 0 - m_WorldSpaceSizeMode: 1 - m_WorldSpaceWidth: 1920 - m_WorldSpaceHeight: 1080 - m_PivotReferenceSize: 0 - m_Pivot: 0 - m_WorldSpaceCollider: {fileID: 0} ---- !u!114 &2003742652 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2003742649} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 691980524acfc544f9660cfc35ce3616, type: 3} - m_Name: - m_EditorClassIdentifier: Assembly-CSharp::UI.MainMenuController - transitionDuration: 0.5 - idleTimeout: 5 - pulseSpeed: 2 - pulseAmount: 0.1 --- !u!1660057539 &9223372036854775807 SceneRoots: m_ObjectHideFlags: 0 m_Roots: - {fileID: 1848374381} - {fileID: 626355270} - - {fileID: 1183887570} - {fileID: 1588175188} - {fileID: 1157680020} + - {fileID: 458228301} diff --git a/Assets/Scripts/Fusion/BasicSpawner.cs b/Assets/Scripts/Fusion/BasicSpawner.cs index ebf2d098..7f9488a9 100644 --- a/Assets/Scripts/Fusion/BasicSpawner.cs +++ b/Assets/Scripts/Fusion/BasicSpawner.cs @@ -166,6 +166,7 @@ public class BasicSpawner : MonoBehaviour, INetworkRunnerCallbacks public void OnSessionListUpdated(NetworkRunner runner, List sessionList) { if (LobbyManager != null) LobbyManager.DisplayRoomList(sessionList); + // UI.UIEventBus.TriggerRoomListUpdate(); } public void OnInputMissing(NetworkRunner runner, PlayerRef player, NetworkInput input) { } diff --git a/Assets/Scripts/Player Controller/PlayerAnimationHandler.cs b/Assets/Scripts/Player Controller/PlayerAnimationHandler.cs new file mode 100644 index 00000000..ae394559 --- /dev/null +++ b/Assets/Scripts/Player Controller/PlayerAnimationHandler.cs @@ -0,0 +1,54 @@ +using UnityEngine; +using Fusion; + +namespace OnlyScove.Scripts +{ + public class PlayerAnimationHandler : NetworkBehaviour + { + [Header("Animator Settings")] + [SerializeField] private string speedParamName = "Speed"; + [SerializeField] private string velocityXParamName = "Velocity X"; + [SerializeField] private string velocityZParamName = "Velocity Z"; + [SerializeField] private float animationDamping = 0.2f; + + private Animator anim; + private int speedHash; + private int velocityXHash; + private int velocityZHash; + private bool hasSpeedParam; + private bool hasVelocityXParam; + private bool hasVelocityZParam; + + public void Initialize(Animator animator) + { + this.anim = animator; + if (anim != null) + { + foreach (AnimatorControllerParameter param in anim.parameters) + { + if (param.name == speedParamName) hasSpeedParam = true; + if (param.name == velocityXParamName) hasVelocityXParam = true; + if (param.name == velocityZParamName) hasVelocityZParam = true; + } + } + + speedHash = Animator.StringToHash(speedParamName); + velocityXHash = Animator.StringToHash(velocityXParamName); + velocityZHash = Animator.StringToHash(velocityZParamName); + } + + public void UpdateAnimator(float speed, Vector2 moveInput, float deltaTime) + { + if (anim == null) return; + + if (hasSpeedParam) anim.SetFloat(speedHash, speed, animationDamping, deltaTime); + if (hasVelocityXParam) anim.SetFloat(velocityXHash, moveInput.x * speed, animationDamping, deltaTime); + if (hasVelocityZParam) anim.SetFloat(velocityZHash, moveInput.y * speed, animationDamping, deltaTime); + } + + public void SetSpeed(float speed) + { + if (anim != null && hasSpeedParam) anim.SetFloat(speedHash, speed); + } + } +} diff --git a/Assets/Scripts/Player Controller/PlayerAnimationHandler.cs.meta b/Assets/Scripts/Player Controller/PlayerAnimationHandler.cs.meta new file mode 100644 index 00000000..d6f88fc0 --- /dev/null +++ b/Assets/Scripts/Player Controller/PlayerAnimationHandler.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 965ec86f3b9695640bdc85e624d0e9e7 \ No newline at end of file diff --git a/Assets/Scripts/Player Controller/PlayerInteraction.cs b/Assets/Scripts/Player Controller/PlayerInteraction.cs new file mode 100644 index 00000000..1e7c713b --- /dev/null +++ b/Assets/Scripts/Player Controller/PlayerInteraction.cs @@ -0,0 +1,75 @@ +using UnityEngine; +using Fusion; +using System.Collections.Generic; +using System; + +namespace OnlyScove.Scripts +{ + public class PlayerInteraction : NetworkBehaviour + { + [Header("Interaction Settings")] + [SerializeField] public float InteractionRange = 2f; + [SerializeField] public LayerMask InteractionMask; + + public event Action OnInteractableTargetChanged; + + private List interactablesNearby = new List(); + private int currentInteractableIndex = 0; + private EnvironmentScanner scanner; + + public void Initialize(EnvironmentScanner scanner) + { + this.scanner = scanner; + } + + public void UpdateInteractables() + { + if (scanner == null) return; + + interactablesNearby.Clear(); + IInteractable target = scanner.ScanForInteractable(InteractionRange, InteractionMask); + + if (target != null) interactablesNearby.Add(target); + OnInteractableTargetChanged?.Invoke(target); + + if (Object != null && Object.HasInputAuthority) + { + // UI Placeholder: Interaction UI + // Example: UI.UIEventBus.TriggerInteractionPrompt(target?.InteractionPrompt); + // Example: UI.UIEventBus.TriggerInteractionVisibility(target != null); + } + + currentInteractableIndex = 0; + } + + public void NextInteract() + { + if (interactablesNearby.Count <= 1) return; + currentInteractableIndex = (currentInteractableIndex + 1) % interactablesNearby.Count; + NotifyTargetChanged(); + } + + public void PreviousInteract() + { + if (interactablesNearby.Count <= 1) return; + currentInteractableIndex = (currentInteractableIndex - 1 + interactablesNearby.Count) % interactablesNearby.Count; + NotifyTargetChanged(); + } + + private void NotifyTargetChanged() + { + IInteractable target = GetInteractable(); + OnInteractableTargetChanged?.Invoke(target); + if (Object != null && Object.HasInputAuthority) + { + // UI Placeholder: Update Prompt + // Example: UI.UIEventBus.TriggerInteractionPrompt(target?.InteractionPrompt); + } + } + + public IInteractable GetInteractable() + { + return (interactablesNearby == null || interactablesNearby.Count == 0) ? null : interactablesNearby[currentInteractableIndex]; + } + } +} diff --git a/Assets/Scripts/Player Controller/PlayerInteraction.cs.meta b/Assets/Scripts/Player Controller/PlayerInteraction.cs.meta new file mode 100644 index 00000000..a9d1ab85 --- /dev/null +++ b/Assets/Scripts/Player Controller/PlayerInteraction.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 9dcff2851697b4f4c8c25ef8381665ba \ No newline at end of file diff --git a/Assets/Scripts/Player Controller/PlayerMovement.cs b/Assets/Scripts/Player Controller/PlayerMovement.cs new file mode 100644 index 00000000..04b6b24f --- /dev/null +++ b/Assets/Scripts/Player Controller/PlayerMovement.cs @@ -0,0 +1,71 @@ +using UnityEngine; +using Fusion; + +namespace OnlyScove.Scripts +{ + public class PlayerMovement : NetworkBehaviour + { + [field: Header("Movement Settings")] + [field: SerializeField] public float WalkSpeed { get; private set; } = 3f; + [field: SerializeField] public float RunSpeed { get; private set; } = 6f; + [field: SerializeField] public float SprintSpeed { get; private set; } = 9f; + [field: SerializeField] public float SneakSpeed { get; private set; } = 1.5f; + [field: SerializeField] public float DashForce { get; private set; } = 10f; + [field: SerializeField] public float RotationSpeed { get; private set; } = 500f; + + [field: Header("Airborne Settings")] + [field: SerializeField] public float JumpHeight { get; private set; } = 2f; + [field: SerializeField] public float Gravity { get; private set; } = -15f; + [field: SerializeField] public float ThrustDownwardForce { get; private set; } = -20f; + + [field: Header("Ground Check")] + [field: SerializeField] public float GroundCheckRadius { get; private set; } = 0.2f; + [field: SerializeField] public Vector3 GroundCheckOffset { get; private set; } + [field: SerializeField] public LayerMask GroundMask { get; private set; } + + [Networked] public bool IsGrounded { get; set; } + [Networked] public bool WasGrounded { get; set; } + [Networked] public float VelocityY { get; set; } + [Networked] public Vector3 NetworkedPosition { get; set; } + + private CharacterController controller; + + public void Initialize(CharacterController controller) + { + this.controller = controller; + } + + public void CheckGround(Transform playerTransform) + { + if (Object == null || (!Object.HasStateAuthority && !Object.HasInputAuthority)) return; + + WasGrounded = IsGrounded; + IsGrounded = Physics.CheckSphere(playerTransform.TransformPoint(GroundCheckOffset), GroundCheckRadius, GroundMask); + } + + public void Move(CharacterController controller, Vector3 velocity, float deltaTime) + { + if (controller != null && controller.enabled) + { + controller.Move(velocity * deltaTime); + if (Object != null && Object.HasStateAuthority) + { + NetworkedPosition = transform.position; + } + } + } + + public void Rotate(Transform playerTransform, Vector3 moveDirection, float deltaTime) + { + if (moveDirection == Vector3.zero) return; + Quaternion targetRot = Quaternion.LookRotation(moveDirection); + playerTransform.rotation = Quaternion.RotateTowards(playerTransform.rotation, targetRot, RotationSpeed * deltaTime); + } + + public void SetGroundCheck(float radius, Vector3 offset) + { + GroundCheckRadius = radius; + GroundCheckOffset = offset; + } + } +} diff --git a/Assets/Scripts/Player Controller/PlayerMovement.cs.meta b/Assets/Scripts/Player Controller/PlayerMovement.cs.meta new file mode 100644 index 00000000..f97ca812 --- /dev/null +++ b/Assets/Scripts/Player Controller/PlayerMovement.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 79bbcfd4d37b7834ebe0d61bb649714d \ No newline at end of file diff --git a/Assets/Scripts/Player Controller/PlayerStateMachine.cs b/Assets/Scripts/Player Controller/PlayerStateMachine.cs index 3e302b04..128e4b6d 100644 --- a/Assets/Scripts/Player Controller/PlayerStateMachine.cs +++ b/Assets/Scripts/Player Controller/PlayerStateMachine.cs @@ -5,6 +5,8 @@ using Fusion; namespace OnlyScove.Scripts { [RequireComponent(typeof(CharacterController), typeof(InputReader), typeof(Animator))] + [RequireComponent(typeof(PlayerStats), typeof(PlayerInteraction), typeof(PlayerMovement))] + [RequireComponent(typeof(PlayerAnimationHandler))] public class PlayerStateMachine : NetworkBehaviour { [field: Header("References")] @@ -14,61 +16,38 @@ namespace OnlyScove.Scripts [field: SerializeField] public EnvironmentScanner Scanner { get; private set; } public CameraController Cam { get; private set; } - [field: Header("Animator Settings")] - [SerializeField] private string speedParamName = "Speed"; - [SerializeField] private string velocityXParamName = "Velocity X"; - [SerializeField] private string velocityZParamName = "Velocity Z"; - - private int speedHash; - private int velocityXHash; - private int velocityZHash; - - [field: Header("Movement Settings")] - [field: SerializeField] public float WalkSpeed { get; private set; } = 3f; - [field: SerializeField] public float RunSpeed { get; private set; } = 6f; - [field: SerializeField] public float SprintSpeed { get; private set; } = 9f; - [field: SerializeField] public float SneakSpeed { get; private set; } = 1.5f; - [field: SerializeField] public float DashForce { get; private set; } = 10f; - [field: SerializeField] public float RotationSpeed { get; private set; } = 500f; - [field: SerializeField] public float AnimationDamping { get; private set; } = 0.2f; - - [field: Header("Airborne Settings")] - [field: SerializeField] public float JumpHeight { get; private set; } = 2f; - [field: SerializeField] public float Gravity { get; private set; } = -15f; - [field: SerializeField] public float ThrustDownwardForce { get; private set; } = -20f; - - [field: Header("Ground Check")] - [field: SerializeField] public float GroundCheckRadius { get; private set; } = 0.2f; - [field: SerializeField] public Vector3 GroundCheckOffset { get; private set; } - [field: SerializeField] public LayerMask GroundMask { get; private set; } - - [field: Header("Interaction")] - [field: SerializeField] public float InteractionRange { get; private set; } = 2f; - [field: SerializeField] public LayerMask InteractionMask { get; private set; } + [Header("Modules")] + public PlayerStats Stats; + public PlayerInteraction Interaction; + public PlayerMovement Movement; + public PlayerAnimationHandler AnimationHandler; [Networked] public Quaternion NetworkedCameraRotation { get; set; } [Networked] public Vector2 NetworkedMoveInput { get; set; } [Networked] public float NetworkedSpeed { get; set; } - [Networked] public Vector3 NetworkedPosition { get; set; } - - [Header("Player Stats")] - [Networked, OnChangedRender(nameof(OnHealthChangedRender))] public float Health { get; set; } = 100f; - [Networked, OnChangedRender(nameof(OnStaminaChangedRender))] public float Stamina { get; set; } = 100f; - [Networked, OnChangedRender(nameof(OnNoiseLevelChangedRender))] public float NoiseLevel { get; set; } = 0f; - - public event System.Action OnHealthChanged; - public event System.Action OnStaminaChanged; - public event System.Action OnNoiseLevelChanged; - public event System.Action OnInteractableTargetChanged; + // Pass-through properties for State Compatibility public Vector2 MoveInput { get; private set; } public bool IsSprintHeld { get; private set; } - public float VelocityY { get; set; } - public bool IsGrounded { get; private set; } - public bool WasGrounded { get; private set; } - public string CurrentStateName => currentState != null ? currentState.GetType().Name : "None"; - public static PlayerStateMachine Local { get; private set; } + public float VelocityY { get => Movement.VelocityY; set => Movement.VelocityY = value; } + public bool IsGrounded => Movement.IsGrounded; + public bool WasGrounded => Movement.WasGrounded; + public float WalkSpeed => Movement.WalkSpeed; + public float RunSpeed => Movement.RunSpeed; + public float SprintSpeed => Movement.SprintSpeed; + public float SneakSpeed => Movement.SneakSpeed; + public float DashForce => Movement.DashForce; + public float JumpHeight => Movement.JumpHeight; + public float ThrustDownwardForce => Movement.ThrustDownwardForce; + public float Gravity => Movement.Gravity; + + public float InteractionRange => Interaction.InteractionRange; + public LayerMask InteractionMask => Interaction.InteractionMask; + + public static PlayerStateMachine Local { get; private set; } + public string CurrentStateName => currentState != null ? currentState.GetType().Name : "None"; + public Quaternion CameraRotation { get @@ -80,11 +59,6 @@ namespace OnlyScove.Scripts private PlayerBaseState currentState; private bool hasControl = true; - private bool hasSpeedParam; - private bool hasVelocityXParam; - private bool hasVelocityZParam; - private List interactablesNearby = new List(); - private int currentInteractableIndex = 0; private float localAnimatorSpeed; protected virtual void Awake() @@ -93,20 +67,15 @@ namespace OnlyScove.Scripts Input = GetComponent(); Anim = GetComponentInChildren(); Scanner = GetComponent(); + + Stats = GetComponent(); + Interaction = GetComponent(); + Movement = GetComponent(); + AnimationHandler = GetComponent(); - if (Anim != null) - { - foreach (AnimatorControllerParameter param in Anim.parameters) - { - if (param.name == speedParamName) hasSpeedParam = true; - if (param.name == velocityXParamName) hasVelocityXParam = true; - if (param.name == velocityZParamName) hasVelocityZParam = true; - } - } - - speedHash = Animator.StringToHash(speedParamName); - velocityXHash = Animator.StringToHash(velocityXParamName); - velocityZHash = Animator.StringToHash(velocityZParamName); + AnimationHandler.Initialize(Anim); + Movement.Initialize(Controller); + Interaction.Initialize(Scanner); } private void Start() @@ -123,10 +92,6 @@ namespace OnlyScove.Scripts } } - void OnHealthChangedRender() => OnHealthChanged?.Invoke(Health); - void OnStaminaChangedRender() => OnStaminaChanged?.Invoke(Stamina); - void OnNoiseLevelChangedRender() => OnNoiseLevelChanged?.Invoke(NoiseLevel); - private void InitializePlayer() { if (currentState == null) SwitchState(new PlayerIdleState(this)); @@ -142,17 +107,15 @@ namespace OnlyScove.Scripts Cam.followTarget = transform; Cam.inputReader = Input; } - Input.OnNextInteractEvent += OnNextInteract; - Input.OnPreviousInteractEvent += OnPreviousInteract; + Input.OnNextInteractEvent += Interaction.NextInteract; + Input.OnPreviousInteractEvent += Interaction.PreviousInteract; if (Controller != null) Controller.enabled = true; } } public void Rotate(Vector3 moveDirection, float deltaTime) { - if (moveDirection == Vector3.zero) return; - Quaternion targetRot = Quaternion.LookRotation(moveDirection); - transform.rotation = Quaternion.RotateTowards(transform.rotation, targetRot, RotationSpeed * deltaTime); + Movement.Rotate(transform, moveDirection, deltaTime); } public void Move(Vector3 velocity, float animatorSpeed, float deltaTime) @@ -160,12 +123,8 @@ namespace OnlyScove.Scripts bool canMove = (Runner == null || !Runner.IsRunning) || Object.HasInputAuthority || Runner.IsServer; if (!canMove) return; - if (Controller != null && Controller.enabled) - { - Controller.Move(velocity * deltaTime); - if (Object != null && Runner != null && Runner.IsRunning) NetworkedPosition = transform.position; - } - + Movement.Move(Controller, velocity, deltaTime); + localAnimatorSpeed = animatorSpeed; if (Object != null && Object.HasStateAuthority) { @@ -177,13 +136,9 @@ namespace OnlyScove.Scripts private void UpdateAnimator(float deltaTime) { - if (Anim == null) return; float speedValue = (Runner == null || !Runner.IsRunning || Object.HasInputAuthority) ? localAnimatorSpeed : NetworkedSpeed; Vector2 inputVector = (Runner == null || !Runner.IsRunning || Object.HasInputAuthority) ? MoveInput : NetworkedMoveInput; - - if (hasSpeedParam) Anim.SetFloat(speedHash, speedValue, AnimationDamping, deltaTime); - if (hasVelocityXParam) Anim.SetFloat(velocityXHash, inputVector.x * speedValue, AnimationDamping, deltaTime); - if (hasVelocityZParam) Anim.SetFloat(velocityZHash, inputVector.y * speedValue, AnimationDamping, deltaTime); + AnimationHandler.UpdateAnimator(speedValue, inputVector, deltaTime); } public override void FixedUpdateNetwork() @@ -191,10 +146,11 @@ namespace OnlyScove.Scripts bool isRunning = Runner != null && Runner.IsRunning; if (Object == null && isRunning) return; - if (isRunning && NetworkedPosition != Vector3.zero && !Object.HasInputAuthority) + // Proxy Sync + if (isRunning && Movement.NetworkedPosition != Vector3.zero && !Object.HasInputAuthority) { Controller.enabled = false; - transform.position = NetworkedPosition; + transform.position = Movement.NetworkedPosition; Controller.enabled = true; } @@ -209,19 +165,13 @@ namespace OnlyScove.Scripts MoveInput = new Vector2(UnityEngine.Input.GetAxisRaw("Horizontal"), UnityEngine.Input.GetAxisRaw("Vertical")); IsSprintHeld = UnityEngine.Input.GetKey(KeyCode.LeftShift); } - else - { - MoveInput = Vector2.zero; - IsSprintHeld = false; - } if (!isRunning || Object.HasInputAuthority || Runner.IsServer) { if (hasControl) { - WasGrounded = IsGrounded; - CheckGround(); - UpdateInteractablesList(); + Movement.CheckGround(transform); + Interaction.UpdateInteractables(); currentState?.Tick(isRunning ? Runner.DeltaTime : Time.fixedDeltaTime); } } @@ -236,34 +186,8 @@ namespace OnlyScove.Scripts if (Runner == null || !Runner.IsRunning) FixedUpdateNetwork(); } - private void CheckGround() => IsGrounded = Physics.CheckSphere(transform.TransformPoint(GroundCheckOffset), GroundCheckRadius, GroundMask); - - private void UpdateInteractablesList() - { - interactablesNearby.Clear(); - IInteractable target = Scanner.ScanForInteractable(InteractionRange, InteractionMask); - if (target != null) interactablesNearby.Add(target); - OnInteractableTargetChanged?.Invoke(target); - currentInteractableIndex = 0; - } - - private void OnNextInteract() - { - if (interactablesNearby.Count <= 1) return; - currentInteractableIndex = (currentInteractableIndex + 1) % interactablesNearby.Count; - OnInteractableTargetChanged?.Invoke(GetInteractable()); - } - - private void OnPreviousInteract() - { - if (interactablesNearby.Count <= 1) return; - currentInteractableIndex = (currentInteractableIndex - 1 + interactablesNearby.Count) % interactablesNearby.Count; - OnInteractableTargetChanged?.Invoke(GetInteractable()); - } - - public IInteractable GetInteractable() => interactablesNearby.Count == 0 ? null : interactablesNearby[currentInteractableIndex]; - - public void SetGroundCheck(float radius, Vector3 offset) { GroundCheckRadius = radius; GroundCheckOffset = offset; } + public IInteractable GetInteractable() => Interaction.GetInteractable(); + public void SetGroundCheck(float radius, Vector3 offset) => Movement.SetGroundCheck(radius, offset); public void SwitchState(PlayerBaseState newState) { @@ -276,13 +200,14 @@ namespace OnlyScove.Scripts { hasControl = control; if (Controller != null) Controller.enabled = control; - if (!control && Anim != null) Anim.SetFloat(speedHash, 0f); + if (!control) AnimationHandler.SetSpeed(0f); } private void OnDrawGizmosSelected() { + if (Movement == null) return; Gizmos.color = new Color(0, 1, 0, 0.5f); - Gizmos.DrawSphere(transform.TransformPoint(GroundCheckOffset), GroundCheckRadius); + Gizmos.DrawSphere(transform.TransformPoint(Movement.GroundCheckOffset), Movement.GroundCheckRadius); } } } diff --git a/Assets/Scripts/Player Controller/PlayerStats.cs b/Assets/Scripts/Player Controller/PlayerStats.cs new file mode 100644 index 00000000..ae81db9b --- /dev/null +++ b/Assets/Scripts/Player Controller/PlayerStats.cs @@ -0,0 +1,58 @@ +using UnityEngine; +using Fusion; +using System; + +namespace OnlyScove.Scripts +{ + public class PlayerStats : NetworkBehaviour + { + [Header("Player Stats")] + [Networked, OnChangedRender(nameof(OnHealthChangedRender))] public float Health { get; set; } = 100f; + [Networked, OnChangedRender(nameof(OnStaminaChangedRender))] public float Stamina { get; set; } = 100f; + [Networked, OnChangedRender(nameof(OnNoiseLevelChangedRender))] public float NoiseLevel { get; set; } = 0f; + + public event Action OnHealthChanged; + public event Action OnStaminaChanged; + public event Action OnNoiseLevelChanged; + + public override void Spawned() + { + // Initial UI sync placeholder + UpdateUI(); + } + + void OnHealthChangedRender() + { + OnHealthChanged?.Invoke(Health); + if (Object.HasInputAuthority) + { + // UI Placeholder: Trigger Health UI Change + // Example: UI.UIEventBus.TriggerHealthChange(Health / 100f); + } + } + + void OnStaminaChangedRender() + { + OnStaminaChanged?.Invoke(Stamina); + if (Object.HasInputAuthority) + { + // UI Placeholder: Trigger Stamina UI Change + // Example: UI.UIEventBus.TriggerStaminaChange(Stamina / 100f); + } + } + + void OnNoiseLevelChangedRender() + { + OnNoiseLevelChanged?.Invoke(NoiseLevel); + } + + private void UpdateUI() + { + if (Object.HasInputAuthority) + { + OnHealthChangedRender(); + OnStaminaChangedRender(); + } + } + } +} diff --git a/Assets/Scripts/Player Controller/PlayerStats.cs.meta b/Assets/Scripts/Player Controller/PlayerStats.cs.meta new file mode 100644 index 00000000..d9ae7dc2 --- /dev/null +++ b/Assets/Scripts/Player Controller/PlayerStats.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: a1494b79b59fcdf4d9f7956dde31bc42 \ No newline at end of file diff --git a/Assets/Scripts/UI/BaseUIController.cs b/Assets/Scripts/UI/BaseUIController.cs new file mode 100644 index 00000000..ad14c5f4 --- /dev/null +++ b/Assets/Scripts/UI/BaseUIController.cs @@ -0,0 +1,55 @@ +using UnityEngine; +using UnityEngine.UIElements; +using PrimeTween; +using System.Threading.Tasks; + +namespace Hallucinate.UI +{ + public abstract class BaseUIController + { + protected VisualElement root; + protected UIManager uiManager; + + public virtual void Initialize(VisualElement uxmlRoot, UIManager manager) + { + root = uxmlRoot; + uiManager = manager; + + // Default to hidden + Hide(); + } + + public virtual void Show() + { + if (root != null) + root.style.display = DisplayStyle.Flex; + } + + public virtual void Hide() + { + if (root != null) + root.style.display = DisplayStyle.None; + } + + public virtual async Task PlayTransitionIn() + { + if (root == null) return; + + Show(); + // Fly-in from right using Custom tween for style.translate + root.style.translate = new StyleTranslate(new Translate(Length.Percent(100), 0)); + await Tween.Custom(100f, 0f, duration: 0.5f, ease: Ease.OutBack, + onValueChange: val => root.style.translate = new StyleTranslate(new Translate(Length.Percent(val), 0))); + } + + public virtual async Task PlayTransitionOut() + { + if (root == null) return; + + // Fly-out to left + await Tween.Custom(0f, -100f, duration: 0.5f, ease: Ease.InBack, + onValueChange: val => root.style.translate = new StyleTranslate(new Translate(Length.Percent(val), 0))); + Hide(); + } + } +} diff --git a/Assets/Scripts/UI/BaseUIController.cs.meta b/Assets/Scripts/UI/BaseUIController.cs.meta new file mode 100644 index 00000000..349e027d --- /dev/null +++ b/Assets/Scripts/UI/BaseUIController.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 872f8bfaee91588488a3393579135de9 \ No newline at end of file diff --git a/Assets/Scripts/UI/HUDController.cs b/Assets/Scripts/UI/HUDController.cs index f020b780..1dffb2e4 100644 --- a/Assets/Scripts/UI/HUDController.cs +++ b/Assets/Scripts/UI/HUDController.cs @@ -1,197 +1,80 @@ using UnityEngine; using UnityEngine.UIElements; -using OnlyScove.Scripts; -using System.Collections.Generic; -using UnityEngine.InputSystem; +using PrimeTween; +using System.Threading.Tasks; -namespace UI +namespace Hallucinate.UI { - public class HUDController : MonoBehaviour + public class HUDController : BaseUIController { - [Header("UI Document")] - public UIDocument hudDocument; + private VisualElement _topLeft; + private VisualElement _bottomLeft; + + private ProgressBar _healthBar; + private ProgressBar _staminaBar; + + private float _lastActionTime; + private const float FADE_TIMEOUT = 5.0f; + private bool _isFaded = false; - private VisualElement _healthFill; - private VisualElement _staminaFill; - private Label _healthText; - private VisualElement _interactionPrompt; - private Label _interactionLabel; - - private VisualElement _statsArea; - private VisualElement _inventoryArea; - private VisualElement _infoArea; - - private float _lastInputTime; - private bool _isHUDVisible = true; - public float autoHideDelay = 5f; - - private void OnEnable() + public override void Initialize(VisualElement uxmlRoot, UIManager manager) { - if (hudDocument == null) - hudDocument = GetComponent(); + base.Initialize(uxmlRoot, manager); - var root = hudDocument.rootVisualElement; + _topLeft = root.Q("TopLeft"); + _bottomLeft = root.Q("BottomLeft"); + _healthBar = root.Q("HealthBar"); + _staminaBar = root.Q("StaminaBar"); - _healthFill = root.Q("health-fill"); - _staminaFill = root.Q("stamina-fill"); - _healthText = root.Q