From 9e16e4be73da24a1e226a02149c92e79dafe53b7 Mon Sep 17 00:00:00 2001 From: yvmou_ Date: Thu, 17 Sep 2026 22:14:10 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=80=E5=8D=95=E7=9A=84=E7=8E=A9=E5=AE=B6?= =?UTF-8?q?=E9=A2=84=E5=88=B6=E4=BD=93=E5=92=8C=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/DefaultPrefabObjects.asset | 1 + Assets/_Game/Prefabs.meta | 8 + Assets/_Game/Prefabs/Player.prefab | 293 +++++ Assets/_Game/Prefabs/Player.prefab.meta | 7 + Assets/_Game/Scenes/MainScene.unity | 1157 +++++++++++++++-- Assets/_Game/Scripts.meta | 8 + Assets/_Game/Scripts/PlayerController.cs | 219 ++++ Assets/_Game/Scripts/PlayerController.cs.meta | 2 + 8 files changed, 1600 insertions(+), 95 deletions(-) create mode 100644 Assets/_Game/Prefabs.meta create mode 100644 Assets/_Game/Prefabs/Player.prefab create mode 100644 Assets/_Game/Prefabs/Player.prefab.meta create mode 100644 Assets/_Game/Scripts.meta create mode 100644 Assets/_Game/Scripts/PlayerController.cs create mode 100644 Assets/_Game/Scripts/PlayerController.cs.meta diff --git a/Assets/DefaultPrefabObjects.asset b/Assets/DefaultPrefabObjects.asset index ec9afc8..51477ac 100644 --- a/Assets/DefaultPrefabObjects.asset +++ b/Assets/DefaultPrefabObjects.asset @@ -21,6 +21,7 @@ MonoBehaviour: - {fileID: 201277550, guid: 5b712878ecece354ba4ffb026c0a221c, type: 3} - {fileID: 4512293259955182956, guid: b8017cef39731ba439c70fecc09488e3, type: 3} - {fileID: 201277550, guid: 26a567abbe21227428f5c3d309d1d73c, type: 3} + - {fileID: 3597132959123631746, guid: 687b16b0a8065d74fa4380e93a8a3d81, type: 3} - {fileID: 4512293259955182956, guid: 44611030e61220d42ab7c37ba3c0ea92, type: 3} - {fileID: 8192566354860284824, guid: 6331b3542e64a564c81bc39cedf70c8d, type: 3} - {fileID: 4512293259955182956, guid: f32d4c19de900e64cb73cedcb8ba6f70, type: 3} diff --git a/Assets/_Game/Prefabs.meta b/Assets/_Game/Prefabs.meta new file mode 100644 index 0000000..db99892 --- /dev/null +++ b/Assets/_Game/Prefabs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e594db1b1feab634fa5d2b77441450a1 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Game/Prefabs/Player.prefab b/Assets/_Game/Prefabs/Player.prefab new file mode 100644 index 0000000..30efd10 --- /dev/null +++ b/Assets/_Game/Prefabs/Player.prefab @@ -0,0 +1,293 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &5354570318818660711 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1970733545076781942} + - component: {fileID: 2574156275777457598} + - component: {fileID: 1210119558697661830} + - component: {fileID: 3597132959123631746} + - component: {fileID: 4770153168491883514} + m_Layer: 0 + m_Name: Player + m_TagString: Player + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1970733545076781942 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5354570318818660711} + 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: + - {fileID: 7234523343942154409} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!143 &2574156275777457598 +CharacterController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5354570318818660711} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Height: 1.8 + m_Radius: 0.4 + m_SlopeLimit: 45 + m_StepOffset: 0.35 + m_SkinWidth: 0.08 + m_MinMoveDistance: 0.001 + m_Center: {x: 0, y: 0.9, z: 0} +--- !u!114 &1210119558697661830 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5354570318818660711} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b6780c1c0b9d27c46a0bd43f0d2291f6, type: 3} + m_Name: + m_EditorClassIdentifier: Assembly-CSharp::PlayerController + actionsAsset: {fileID: -944628639613478452, guid: 052faaac586de48259a63d0c4782560b, type: 3} + moveAction: {fileID: 0} + jumpAction: {fileID: 0} + sprintAction: {fileID: 0} + walkSpeed: 5 + sprintMultiplier: 1.8 + acceleration: 14 + rotationSpeed: 14 + jumpHeight: 1.4 + gravity: -22 + groundedForce: -2 + groundCheckRadius: 0.28 + groundCheckOffset: -0.92 + groundMask: + serializedVersion: 2 + m_Bits: 4294967295 + cameraPivot: {fileID: 0} + createCameraIfMissing: 1 + controlCursor: 1 + lookSensitivity: 0.12 + pitchMin: -35 + pitchMax: 70 + cameraDistance: 5 + cameraHeight: 1.2 + cameraSideOffset: 0.6 +--- !u!114 &3597132959123631746 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5354570318818660711} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: FishNet.Runtime::FishNet.Object.NetworkObject + _localLevelOfDetailCalculationType: 0 + _useLevelOfDetail: 0 + _useRootLevelOfDetail: 1 + NetworkObserver: {fileID: 0} + _enablePrediction: 0 + _predictionType: 0 + _localReconcileCorrectionType: 2 + _graphicalObject: {fileID: 0} + _detachGraphicalObject: 0 + _enableStateForwarding: 1 + _networkTransform: {fileID: 0} + _ownerInterpolation: 1 + _ownerSmoothedProperties: 255 + _adaptiveInterpolation: 3 + _spectatorSmoothedProperties: 255 + _spectatorInterpolation: 2 + _enableTeleport: 0 + _teleportThreshold: 1 + k__BackingField: 65535 + k__BackingField: 0 + k__BackingField: 15157568118727023227 + SceneId: 0 + SerializedTransformProperties: + Position: {x: 0, y: 0, z: 0} + Rotation: {x: 0, y: 0, z: 0, w: 0} + Scale: {x: 0, y: 0, z: 0} + IsValid: 0 + k__BackingField: 0 + WasActiveDuringEdit: 0 + WasActiveDuringEdit_Set1: 1 + k__BackingField: 0 + k__BackingField: {fileID: 0} + k__BackingField: {fileID: 0} + NetworkBehaviours: [] + InitializedParentNetworkBehaviour: {fileID: 0} + InitializedNestedNetworkObjects: [] + RuntimeParentNetworkBehaviour: {fileID: 0} + RuntimeChildNetworkBehaviours: [] + _isNetworked: 1 + _isSpawnable: 1 + _isGlobal: 0 + _initializeOrder: 0 + _preventDespawnOnDisconnect: 0 + _defaultDespawnType: 0 + _initializedTimestamp: 0 +--- !u!114 &4770153168491883514 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5354570318818660711} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a2836e36774ca1c4bbbee976e17b649c, type: 3} + m_Name: + m_EditorClassIdentifier: FishNet.Runtime::FishNet.Component.Transforming.NetworkTransform + _componentIndexCache: 255 + _addedNetworkObject: {fileID: 3597132959123631746} + _networkObjectCache: {fileID: 0} + _componentConfiguration: 0 + _synchronizeParent: 0 + _packing: + Position: 1 + Rotation: 1 + Scale: 0 + _useScaledTime: 1 + _interpolation: 2 + _extrapolation: 2 + _enableTeleport: 0 + _teleportThreshold: 1 + _clientAuthoritative: 1 + _sendToOwner: 1 + _interval: 1 + _synchronizePosition: 1 + _positionSensitivity: 0.001 + _positionSnapping: + X: 0 + Y: 0 + Z: 0 + _synchronizeRotation: 1 + _rotationSnapping: + X: 0 + Y: 0 + Z: 0 + _synchronizeScale: 1 + _scaleSensitivity: 0.001 + _scaleSnapping: + X: 0 + Y: 0 + Z: 0 +--- !u!1 &6149029535851407841 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7234523343942154409} + - component: {fileID: 5382409320781136276} + - component: {fileID: 4998907831547767837} + m_Layer: 0 + m_Name: Body + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7234523343942154409 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6149029535851407841} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0.9, z: 0} + m_LocalScale: {x: 0.9, y: 0.9, z: 0.9} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1970733545076781942} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &5382409320781136276 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6149029535851407841} + m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &4998907831547767837 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6149029535851407841} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_AdditionalVertexStreams: {fileID: 0} diff --git a/Assets/_Game/Prefabs/Player.prefab.meta b/Assets/_Game/Prefabs/Player.prefab.meta new file mode 100644 index 0000000..fd14a64 --- /dev/null +++ b/Assets/_Game/Prefabs/Player.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 687b16b0a8065d74fa4380e93a8a3d81 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Game/Scenes/MainScene.unity b/Assets/_Game/Scenes/MainScene.unity index 5971cd3..a24dbb3 100644 --- a/Assets/_Game/Scenes/MainScene.unity +++ b/Assets/_Game/Scenes/MainScene.unity @@ -232,6 +232,813 @@ Transform: m_Children: [] m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &821953337 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 39fa3d8997a24136984ca6e2c99902bc, type: 3} + m_Name: InputSystem_Actions(Clone) + m_EditorClassIdentifier: Unity.InputSystem::UnityEngine.InputSystem.InputActionAsset + m_ActionMaps: + - m_Name: Player + m_Id: df70fa95-8a34-4494-b137-73ab6b9c7d37 + m_Asset: {fileID: 821953337} + m_Actions: + - m_Name: Move + m_Type: 0 + m_ExpectedControlType: Vector2 + m_Id: 351f2ccd-1f9f-44bf-9bec-d62ac5c5f408 + m_Processors: + m_Interactions: + m_SingletonActionBindings: [] + m_Flags: 1 + m_Priority: 0 + - m_Name: Look + m_Type: 0 + m_ExpectedControlType: Vector2 + m_Id: 6b444451-8a00-4d00-a97e-f47457f736a8 + m_Processors: + m_Interactions: + m_SingletonActionBindings: [] + m_Flags: 1 + m_Priority: 0 + - m_Name: Attack + m_Type: 1 + m_ExpectedControlType: Button + m_Id: 6c2ab1b8-8984-453a-af3d-a3c78ae1679a + m_Processors: + m_Interactions: + m_SingletonActionBindings: [] + m_Flags: 0 + m_Priority: 0 + - m_Name: Interact + m_Type: 1 + m_ExpectedControlType: Button + m_Id: 852140f2-7766-474d-8707-702459ba45f3 + m_Processors: + m_Interactions: Hold + m_SingletonActionBindings: [] + m_Flags: 0 + m_Priority: 0 + - m_Name: Crouch + m_Type: 1 + m_ExpectedControlType: Button + m_Id: 27c5f898-bc57-4ee1-8800-db469aca5fe3 + m_Processors: + m_Interactions: + m_SingletonActionBindings: [] + m_Flags: 0 + m_Priority: 0 + - m_Name: Jump + m_Type: 1 + m_ExpectedControlType: Button + m_Id: f1ba0d36-48eb-4cd5-b651-1c94a6531f70 + m_Processors: + m_Interactions: + m_SingletonActionBindings: [] + m_Flags: 0 + m_Priority: 0 + - m_Name: Previous + m_Type: 1 + m_ExpectedControlType: Button + m_Id: 2776c80d-3c14-4091-8c56-d04ced07a2b0 + m_Processors: + m_Interactions: + m_SingletonActionBindings: [] + m_Flags: 0 + m_Priority: 0 + - m_Name: Next + m_Type: 1 + m_ExpectedControlType: Button + m_Id: b7230bb6-fc9b-4f52-8b25-f5e19cb2c2ba + m_Processors: + m_Interactions: + m_SingletonActionBindings: [] + m_Flags: 0 + m_Priority: 0 + - m_Name: Sprint + m_Type: 1 + m_ExpectedControlType: Button + m_Id: 641cd816-40e6-41b4-8c3d-04687c349290 + m_Processors: + m_Interactions: + m_SingletonActionBindings: [] + m_Flags: 0 + m_Priority: 0 + m_Bindings: + - m_Name: + m_Id: 978bfe49-cc26-4a3d-ab7b-7d7a29327403 + m_Path: /leftStick + m_Interactions: + m_Processors: + m_Groups: ;Gamepad + m_Action: Move + m_Flags: 0 + - m_Name: WASD + m_Id: 00ca640b-d935-4593-8157-c05846ea39b3 + m_Path: Dpad + m_Interactions: + m_Processors: + m_Groups: + m_Action: Move + m_Flags: 4 + - m_Name: up + m_Id: e2062cb9-1b15-46a2-838c-2f8d72a0bdd9 + m_Path: /w + m_Interactions: + m_Processors: + m_Groups: ;Keyboard&Mouse + m_Action: Move + m_Flags: 8 + - m_Name: up + m_Id: 8180e8bd-4097-4f4e-ab88-4523101a6ce9 + m_Path: /upArrow + m_Interactions: + m_Processors: + m_Groups: ;Keyboard&Mouse + m_Action: Move + m_Flags: 8 + - m_Name: down + m_Id: 320bffee-a40b-4347-ac70-c210eb8bc73a + m_Path: /s + m_Interactions: + m_Processors: + m_Groups: ;Keyboard&Mouse + m_Action: Move + m_Flags: 8 + - m_Name: down + m_Id: 1c5327b5-f71c-4f60-99c7-4e737386f1d1 + m_Path: /downArrow + m_Interactions: + m_Processors: + m_Groups: ;Keyboard&Mouse + m_Action: Move + m_Flags: 8 + - m_Name: left + m_Id: d2581a9b-1d11-4566-b27d-b92aff5fabbc + m_Path: /a + m_Interactions: + m_Processors: + m_Groups: ;Keyboard&Mouse + m_Action: Move + m_Flags: 8 + - m_Name: left + m_Id: 2e46982e-44cc-431b-9f0b-c11910bf467a + m_Path: /leftArrow + m_Interactions: + m_Processors: + m_Groups: ;Keyboard&Mouse + m_Action: Move + m_Flags: 8 + - m_Name: right + m_Id: fcfe95b8-67b9-4526-84b5-5d0bc98d6400 + m_Path: /d + m_Interactions: + m_Processors: + m_Groups: ;Keyboard&Mouse + m_Action: Move + m_Flags: 8 + - m_Name: right + m_Id: 77bff152-3580-4b21-b6de-dcd0c7e41164 + m_Path: /rightArrow + m_Interactions: + m_Processors: + m_Groups: ;Keyboard&Mouse + m_Action: Move + m_Flags: 8 + - m_Name: + m_Id: 1635d3fe-58b6-4ba9-a4e2-f4b964f6b5c8 + m_Path: /{Primary2DAxis} + m_Interactions: + m_Processors: + m_Groups: XR + m_Action: Move + m_Flags: 0 + - m_Name: + m_Id: 3ea4d645-4504-4529-b061-ab81934c3752 + m_Path: /stick + m_Interactions: + m_Processors: + m_Groups: Joystick + m_Action: Move + m_Flags: 0 + - m_Name: + m_Id: c1f7a91b-d0fd-4a62-997e-7fb9b69bf235 + m_Path: /rightStick + m_Interactions: + m_Processors: + m_Groups: ;Gamepad + m_Action: Look + m_Flags: 0 + - m_Name: + m_Id: 8c8e490b-c610-4785-884f-f04217b23ca4 + m_Path: /delta + m_Interactions: + m_Processors: + m_Groups: ;Keyboard&Mouse;Touch + m_Action: Look + m_Flags: 0 + - m_Name: + m_Id: 3e5f5442-8668-4b27-a940-df99bad7e831 + m_Path: /{Hatswitch} + m_Interactions: + m_Processors: + m_Groups: Joystick + m_Action: Look + m_Flags: 0 + - m_Name: + m_Id: 143bb1cd-cc10-4eca-a2f0-a3664166fe91 + m_Path: /buttonWest + m_Interactions: + m_Processors: + m_Groups: ;Gamepad + m_Action: Attack + m_Flags: 0 + - m_Name: + m_Id: 05f6913d-c316-48b2-a6bb-e225f14c7960 + m_Path: /leftButton + m_Interactions: + m_Processors: + m_Groups: ;Keyboard&Mouse + m_Action: Attack + m_Flags: 0 + - m_Name: + m_Id: 886e731e-7071-4ae4-95c0-e61739dad6fd + m_Path: /primaryTouch/tap + m_Interactions: + m_Processors: + m_Groups: ;Touch + m_Action: Attack + m_Flags: 0 + - m_Name: + m_Id: ee3d0cd2-254e-47a7-a8cb-bc94d9658c54 + m_Path: /trigger + m_Interactions: + m_Processors: + m_Groups: Joystick + m_Action: Attack + m_Flags: 0 + - m_Name: + m_Id: 8255d333-5683-4943-a58a-ccb207ff1dce + m_Path: /{PrimaryAction} + m_Interactions: + m_Processors: + m_Groups: XR + m_Action: Attack + m_Flags: 0 + - m_Name: + m_Id: b3c1c7f0-bd20-4ee7-a0f1-899b24bca6d7 + m_Path: /enter + m_Interactions: + m_Processors: + m_Groups: Keyboard&Mouse + m_Action: Attack + m_Flags: 0 + - m_Name: + m_Id: cbac6039-9c09-46a1-b5f2-4e5124ccb5ed + m_Path: /2 + m_Interactions: + m_Processors: + m_Groups: Keyboard&Mouse + m_Action: Next + m_Flags: 0 + - m_Name: + m_Id: e15ca19d-e649-4852-97d5-7fe8ccc44e94 + m_Path: /dpad/right + m_Interactions: + m_Processors: + m_Groups: Gamepad + m_Action: Next + m_Flags: 0 + - m_Name: + m_Id: f2e9ba44-c423-42a7-ad56-f20975884794 + m_Path: /leftShift + m_Interactions: + m_Processors: + m_Groups: Keyboard&Mouse + m_Action: Sprint + m_Flags: 0 + - m_Name: + m_Id: 8cbb2f4b-a784-49cc-8d5e-c010b8c7f4e6 + m_Path: /leftStickPress + m_Interactions: + m_Processors: + m_Groups: Gamepad + m_Action: Sprint + m_Flags: 0 + - m_Name: + m_Id: d8bf24bf-3f2f-4160-a97c-38ec1eb520ba + m_Path: /trigger + m_Interactions: + m_Processors: + m_Groups: XR + m_Action: Sprint + m_Flags: 0 + - m_Name: + m_Id: eb40bb66-4559-4dfa-9a2f-820438abb426 + m_Path: /space + m_Interactions: + m_Processors: + m_Groups: Keyboard&Mouse + m_Action: Jump + m_Flags: 0 + - m_Name: + m_Id: daba33a1-ad0c-4742-a909-43ad1cdfbeb6 + m_Path: /buttonSouth + m_Interactions: + m_Processors: + m_Groups: Gamepad + m_Action: Jump + m_Flags: 0 + - m_Name: + m_Id: 603f3daf-40bd-4854-8724-93e8017f59e3 + m_Path: /secondaryButton + m_Interactions: + m_Processors: + m_Groups: XR + m_Action: Jump + m_Flags: 0 + - m_Name: + m_Id: 1534dc16-a6aa-499d-9c3a-22b47347b52a + m_Path: /1 + m_Interactions: + m_Processors: + m_Groups: Keyboard&Mouse + m_Action: Previous + m_Flags: 0 + - m_Name: + m_Id: 25060bbd-a3a6-476e-8fba-45ae484aad05 + m_Path: /dpad/left + m_Interactions: + m_Processors: + m_Groups: Gamepad + m_Action: Previous + m_Flags: 0 + - m_Name: + m_Id: 1c04ea5f-b012-41d1-a6f7-02e963b52893 + m_Path: /e + m_Interactions: + m_Processors: + m_Groups: Keyboard&Mouse + m_Action: Interact + m_Flags: 0 + - m_Name: + m_Id: b3f66d0b-7751-423f-908b-a11c5bd95930 + m_Path: /buttonNorth + m_Interactions: + m_Processors: + m_Groups: Gamepad + m_Action: Interact + m_Flags: 0 + - m_Name: + m_Id: 4f4649ac-64a8-4a73-af11-b3faef356a4d + m_Path: /buttonEast + m_Interactions: + m_Processors: + m_Groups: Gamepad + m_Action: Crouch + m_Flags: 0 + - m_Name: + m_Id: 36e52cba-0905-478e-a818-f4bfcb9f3b9a + m_Path: /c + m_Interactions: + m_Processors: + m_Groups: Keyboard&Mouse + m_Action: Crouch + m_Flags: 0 + - m_Name: UI + m_Id: 272f6d14-89ba-496f-b7ff-215263d3219f + m_Asset: {fileID: 821953337} + m_Actions: + - m_Name: Navigate + m_Type: 2 + m_ExpectedControlType: Vector2 + m_Id: c95b2375-e6d9-4b88-9c4c-c5e76515df4b + m_Processors: + m_Interactions: + m_SingletonActionBindings: [] + m_Flags: 0 + m_Priority: 0 + - m_Name: Submit + m_Type: 1 + m_ExpectedControlType: Button + m_Id: 7607c7b6-cd76-4816-beef-bd0341cfe950 + m_Processors: + m_Interactions: + m_SingletonActionBindings: [] + m_Flags: 0 + m_Priority: 0 + - m_Name: Cancel + m_Type: 1 + m_ExpectedControlType: Button + m_Id: 15cef263-9014-4fd5-94d9-4e4a6234a6ef + m_Processors: + m_Interactions: + m_SingletonActionBindings: [] + m_Flags: 0 + m_Priority: 0 + - m_Name: Point + m_Type: 2 + m_ExpectedControlType: Vector2 + m_Id: 32b35790-4ed0-4e9a-aa41-69ac6d629449 + m_Processors: + m_Interactions: + m_SingletonActionBindings: [] + m_Flags: 1 + m_Priority: 0 + - m_Name: Click + m_Type: 2 + m_ExpectedControlType: Button + m_Id: 3c7022bf-7922-4f7c-a998-c437916075ad + m_Processors: + m_Interactions: + m_SingletonActionBindings: [] + m_Flags: 1 + m_Priority: 0 + - m_Name: RightClick + m_Type: 2 + m_ExpectedControlType: Button + m_Id: 44b200b1-1557-4083-816c-b22cbdf77ddf + m_Processors: + m_Interactions: + m_SingletonActionBindings: [] + m_Flags: 0 + m_Priority: 0 + - m_Name: MiddleClick + m_Type: 2 + m_ExpectedControlType: Button + m_Id: dad70c86-b58c-4b17-88ad-f5e53adf419e + m_Processors: + m_Interactions: + m_SingletonActionBindings: [] + m_Flags: 0 + m_Priority: 0 + - m_Name: ScrollWheel + m_Type: 2 + m_ExpectedControlType: Vector2 + m_Id: 0489e84a-4833-4c40-bfae-cea84b696689 + m_Processors: + m_Interactions: + m_SingletonActionBindings: [] + m_Flags: 0 + m_Priority: 0 + - m_Name: TrackedDevicePosition + m_Type: 2 + m_ExpectedControlType: Vector3 + m_Id: 24908448-c609-4bc3-a128-ea258674378a + m_Processors: + m_Interactions: + m_SingletonActionBindings: [] + m_Flags: 0 + m_Priority: 0 + - m_Name: TrackedDeviceOrientation + m_Type: 2 + m_ExpectedControlType: Quaternion + m_Id: 9caa3d8a-6b2f-4e8e-8bad-6ede561bd9be + m_Processors: + m_Interactions: + m_SingletonActionBindings: [] + m_Flags: 0 + m_Priority: 0 + m_Bindings: + - m_Name: Gamepad + m_Id: 809f371f-c5e2-4e7a-83a1-d867598f40dd + m_Path: 2DVector + m_Interactions: + m_Processors: + m_Groups: + m_Action: Navigate + m_Flags: 4 + - m_Name: up + m_Id: 14a5d6e8-4aaf-4119-a9ef-34b8c2c548bf + m_Path: /leftStick/up + m_Interactions: + m_Processors: + m_Groups: ;Gamepad + m_Action: Navigate + m_Flags: 8 + - m_Name: up + m_Id: 9144cbe6-05e1-4687-a6d7-24f99d23dd81 + m_Path: /rightStick/up + m_Interactions: + m_Processors: + m_Groups: ;Gamepad + m_Action: Navigate + m_Flags: 8 + - m_Name: down + m_Id: 2db08d65-c5fb-421b-983f-c71163608d67 + m_Path: /leftStick/down + m_Interactions: + m_Processors: + m_Groups: ;Gamepad + m_Action: Navigate + m_Flags: 8 + - m_Name: down + m_Id: 58748904-2ea9-4a80-8579-b500e6a76df8 + m_Path: /rightStick/down + m_Interactions: + m_Processors: + m_Groups: ;Gamepad + m_Action: Navigate + m_Flags: 8 + - m_Name: left + m_Id: 8ba04515-75aa-45de-966d-393d9bbd1c14 + m_Path: /leftStick/left + m_Interactions: + m_Processors: + m_Groups: ;Gamepad + m_Action: Navigate + m_Flags: 8 + - m_Name: left + m_Id: 712e721c-bdfb-4b23-a86c-a0d9fcfea921 + m_Path: /rightStick/left + m_Interactions: + m_Processors: + m_Groups: ;Gamepad + m_Action: Navigate + m_Flags: 8 + - m_Name: right + m_Id: fcd248ae-a788-4676-a12e-f4d81205600b + m_Path: /leftStick/right + m_Interactions: + m_Processors: + m_Groups: ;Gamepad + m_Action: Navigate + m_Flags: 8 + - m_Name: right + m_Id: 1f04d9bc-c50b-41a1-bfcc-afb75475ec20 + m_Path: /rightStick/right + m_Interactions: + m_Processors: + m_Groups: ;Gamepad + m_Action: Navigate + m_Flags: 8 + - m_Name: + m_Id: fb8277d4-c5cd-4663-9dc7-ee3f0b506d90 + m_Path: /dpad + m_Interactions: + m_Processors: + m_Groups: ;Gamepad + m_Action: Navigate + m_Flags: 0 + - m_Name: Joystick + m_Id: e25d9774-381c-4a61-b47c-7b6b299ad9f9 + m_Path: 2DVector + m_Interactions: + m_Processors: + m_Groups: + m_Action: Navigate + m_Flags: 4 + - m_Name: up + m_Id: 3db53b26-6601-41be-9887-63ac74e79d19 + m_Path: /stick/up + m_Interactions: + m_Processors: + m_Groups: Joystick + m_Action: Navigate + m_Flags: 8 + - m_Name: down + m_Id: 0cb3e13e-3d90-4178-8ae6-d9c5501d653f + m_Path: /stick/down + m_Interactions: + m_Processors: + m_Groups: Joystick + m_Action: Navigate + m_Flags: 8 + - m_Name: left + m_Id: 0392d399-f6dd-4c82-8062-c1e9c0d34835 + m_Path: /stick/left + m_Interactions: + m_Processors: + m_Groups: Joystick + m_Action: Navigate + m_Flags: 8 + - m_Name: right + m_Id: 942a66d9-d42f-43d6-8d70-ecb4ba5363bc + m_Path: /stick/right + m_Interactions: + m_Processors: + m_Groups: Joystick + m_Action: Navigate + m_Flags: 8 + - m_Name: Keyboard + m_Id: ff527021-f211-4c02-933e-5976594c46ed + m_Path: 2DVector + m_Interactions: + m_Processors: + m_Groups: + m_Action: Navigate + m_Flags: 4 + - m_Name: up + m_Id: 563fbfdd-0f09-408d-aa75-8642c4f08ef0 + m_Path: /w + m_Interactions: + m_Processors: + m_Groups: Keyboard&Mouse + m_Action: Navigate + m_Flags: 8 + - m_Name: up + m_Id: eb480147-c587-4a33-85ed-eb0ab9942c43 + m_Path: /upArrow + m_Interactions: + m_Processors: + m_Groups: Keyboard&Mouse + m_Action: Navigate + m_Flags: 8 + - m_Name: down + m_Id: 2bf42165-60bc-42ca-8072-8c13ab40239b + m_Path: /s + m_Interactions: + m_Processors: + m_Groups: Keyboard&Mouse + m_Action: Navigate + m_Flags: 8 + - m_Name: down + m_Id: 85d264ad-e0a0-4565-b7ff-1a37edde51ac + m_Path: /downArrow + m_Interactions: + m_Processors: + m_Groups: Keyboard&Mouse + m_Action: Navigate + m_Flags: 8 + - m_Name: left + m_Id: 74214943-c580-44e4-98eb-ad7eebe17902 + m_Path: /a + m_Interactions: + m_Processors: + m_Groups: Keyboard&Mouse + m_Action: Navigate + m_Flags: 8 + - m_Name: left + m_Id: cea9b045-a000-445b-95b8-0c171af70a3b + m_Path: /leftArrow + m_Interactions: + m_Processors: + m_Groups: Keyboard&Mouse + m_Action: Navigate + m_Flags: 8 + - m_Name: right + m_Id: 8607c725-d935-4808-84b1-8354e29bab63 + m_Path: /d + m_Interactions: + m_Processors: + m_Groups: Keyboard&Mouse + m_Action: Navigate + m_Flags: 8 + - m_Name: right + m_Id: 4cda81dc-9edd-4e03-9d7c-a71a14345d0b + m_Path: /rightArrow + m_Interactions: + m_Processors: + m_Groups: Keyboard&Mouse + m_Action: Navigate + m_Flags: 8 + - m_Name: + m_Id: 9e92bb26-7e3b-4ec4-b06b-3c8f8e498ddc + m_Path: '*/{Submit}' + m_Interactions: + m_Processors: + m_Groups: Keyboard&Mouse;Gamepad;Touch;Joystick;XR + m_Action: Submit + m_Flags: 0 + - m_Name: + m_Id: 82627dcc-3b13-4ba9-841d-e4b746d6553e + m_Path: '*/{Cancel}' + m_Interactions: + m_Processors: + m_Groups: Keyboard&Mouse;Gamepad;Touch;Joystick;XR + m_Action: Cancel + m_Flags: 0 + - m_Name: + m_Id: c52c8e0b-8179-41d3-b8a1-d149033bbe86 + m_Path: /position + m_Interactions: + m_Processors: + m_Groups: Keyboard&Mouse + m_Action: Point + m_Flags: 0 + - m_Name: + m_Id: e1394cbc-336e-44ce-9ea8-6007ed6193f7 + m_Path: /position + m_Interactions: + m_Processors: + m_Groups: Keyboard&Mouse + m_Action: Point + m_Flags: 0 + - m_Name: + m_Id: 5693e57a-238a-46ed-b5ae-e64e6e574302 + m_Path: /touch*/position + m_Interactions: + m_Processors: + m_Groups: Touch + m_Action: Point + m_Flags: 0 + - m_Name: + m_Id: 4faf7dc9-b979-4210-aa8c-e808e1ef89f5 + m_Path: /leftButton + m_Interactions: + m_Processors: + m_Groups: ;Keyboard&Mouse + m_Action: Click + m_Flags: 0 + - m_Name: + m_Id: 8d66d5ba-88d7-48e6-b1cd-198bbfef7ace + m_Path: /tip + m_Interactions: + m_Processors: + m_Groups: ;Keyboard&Mouse + m_Action: Click + m_Flags: 0 + - m_Name: + m_Id: 47c2a644-3ebc-4dae-a106-589b7ca75b59 + m_Path: /touch*/press + m_Interactions: + m_Processors: + m_Groups: Touch + m_Action: Click + m_Flags: 0 + - m_Name: + m_Id: bb9e6b34-44bf-4381-ac63-5aa15d19f677 + m_Path: /trigger + m_Interactions: + m_Processors: + m_Groups: XR + m_Action: Click + m_Flags: 0 + - m_Name: + m_Id: 38c99815-14ea-4617-8627-164d27641299 + m_Path: /scroll + m_Interactions: + m_Processors: + m_Groups: ;Keyboard&Mouse + m_Action: ScrollWheel + m_Flags: 0 + - m_Name: + m_Id: 4c191405-5738-4d4b-a523-c6a301dbf754 + m_Path: /rightButton + m_Interactions: + m_Processors: + m_Groups: Keyboard&Mouse + m_Action: RightClick + m_Flags: 0 + - m_Name: + m_Id: 24066f69-da47-44f3-a07e-0015fb02eb2e + m_Path: /middleButton + m_Interactions: + m_Processors: + m_Groups: Keyboard&Mouse + m_Action: MiddleClick + m_Flags: 0 + - m_Name: + m_Id: 7236c0d9-6ca3-47cf-a6ee-a97f5b59ea77 + m_Path: /devicePosition + m_Interactions: + m_Processors: + m_Groups: XR + m_Action: TrackedDevicePosition + m_Flags: 0 + - m_Name: + m_Id: 23e01e3a-f935-4948-8d8b-9bcac77714fb + m_Path: /deviceRotation + m_Interactions: + m_Processors: + m_Groups: XR + m_Action: TrackedDeviceOrientation + m_Flags: 0 + m_ControlSchemes: + - m_Name: Keyboard&Mouse + m_BindingGroup: Keyboard&Mouse + m_DeviceRequirements: + - m_ControlPath: + m_Flags: 0 + - m_ControlPath: + m_Flags: 0 + - m_Name: Gamepad + m_BindingGroup: Gamepad + m_DeviceRequirements: + - m_ControlPath: + m_Flags: 0 + - m_Name: Touch + m_BindingGroup: Touch + m_DeviceRequirements: + - m_ControlPath: + m_Flags: 0 + - m_Name: Joystick + m_BindingGroup: Joystick + m_DeviceRequirements: + - m_ControlPath: + m_Flags: 0 + - m_Name: XR + m_BindingGroup: XR + m_DeviceRequirements: + - m_ControlPath: + m_Flags: 0 + m_IsProjectWide: 1 --- !u!1 &870123117 GameObject: m_ObjectHideFlags: 0 @@ -359,7 +1166,193 @@ Transform: m_Children: [] m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} ---- !u!1001 &1009904896 +--- !u!1 &1092242091 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1092242094} + - component: {fileID: 1092242093} + - component: {fileID: 1092242092} + m_Layer: 0 + m_Name: VerifyPlayer + m_TagString: Player + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1092242092 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1092242091} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b6780c1c0b9d27c46a0bd43f0d2291f6, type: 3} + m_Name: + m_EditorClassIdentifier: Assembly-CSharp::PlayerController + actionsAsset: {fileID: 821953337} + moveAction: {fileID: 0} + jumpAction: {fileID: 0} + sprintAction: {fileID: 0} + walkSpeed: 5 + sprintMultiplier: 1.8 + acceleration: 14 + rotationSpeed: 14 + jumpHeight: 1.4 + gravity: -22 + groundedForce: -2 + groundCheckRadius: 0.28 + groundCheckOffset: -0.92 + groundMask: + serializedVersion: 2 + m_Bits: 4294967295 + cameraPivot: {fileID: 0} + createCameraIfMissing: 1 + controlCursor: 1 + lookSensitivity: 0.12 + pitchMin: -35 + pitchMax: 70 + cameraDistance: 5 + cameraHeight: 1.2 + cameraSideOffset: 0.6 +--- !u!143 &1092242093 +CharacterController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1092242091} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Height: 1.8 + m_Radius: 0.4 + m_SlopeLimit: 45 + m_StepOffset: 0.35 + m_SkinWidth: 0.08 + m_MinMoveDistance: 0.001 + m_Center: {x: 0, y: 0.9, z: 0} +--- !u!4 &1092242094 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1092242091} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 1, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1449239244} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1449239243 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1449239244} + - component: {fileID: 1449239246} + - component: {fileID: 1449239245} + m_Layer: 0 + m_Name: Body + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1449239244 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1449239243} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0.9, z: 0} + m_LocalScale: {x: 0.9, y: 0.9, z: 0.9} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1092242094} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &1449239245 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1449239243} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &1449239246 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1449239243} + m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1001 &1617942571 PrefabInstance: m_ObjectHideFlags: 0 serializedVersion: 2 @@ -369,7 +1362,7 @@ PrefabInstance: m_Modifications: - target: {fileID: 7443408887813606049, guid: 0b650fca685f2eb41a86538aa883e4c1, type: 3} propertyPath: m_LocalPosition.x - value: -5.58154 + value: 5.41057 objectReference: {fileID: 0} - target: {fileID: 7443408887813606049, guid: 0b650fca685f2eb41a86538aa883e4c1, type: 3} propertyPath: m_LocalPosition.y @@ -377,7 +1370,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 7443408887813606049, guid: 0b650fca685f2eb41a86538aa883e4c1, type: 3} propertyPath: m_LocalPosition.z - value: -4.61726 + value: -2.67011 objectReference: {fileID: 0} - target: {fileID: 7443408887813606049, guid: 0b650fca685f2eb41a86538aa883e4c1, type: 3} propertyPath: m_LocalRotation.w @@ -420,103 +1413,77 @@ PrefabInstance: m_AddedGameObjects: [] m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 0b650fca685f2eb41a86538aa883e4c1, type: 3} ---- !u!1 &2122252662 -GameObject: +--- !u!1001 &7788027435049821057 +PrefabInstance: m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 2122252665} - - component: {fileID: 2122252664} - - component: {fileID: 2122252663} - m_Layer: 0 - m_Name: Main Camera - m_TagString: MainCamera - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!81 &2122252663 -AudioListener: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2122252662} - m_Enabled: 1 ---- !u!20 &2122252664 -Camera: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2122252662} - m_Enabled: 1 serializedVersion: 2 - m_ClearFlags: 1 - m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} - m_projectionMatrixMode: 1 - m_GateFitMode: 2 - m_FOVAxisMode: 0 - m_Iso: 200 - m_ShutterSpeed: 0.005 - m_Aperture: 16 - m_FocusDistance: 10 - m_FocalLength: 50 - m_BladeCount: 5 - m_Curvature: {x: 2, y: 11} - m_BarrelClipping: 0.25 - m_Anamorphism: 0 - m_SensorSize: {x: 36, y: 24} - m_LensShift: {x: 0, y: 0} - m_NormalizedViewPortRect: - serializedVersion: 2 - x: 0 - y: 0 - width: 1 - height: 1 - near clip plane: 0.3 - far clip plane: 1000 - field of view: 60 - orthographic: 0 - orthographic size: 5 - m_Depth: -1 - m_CullingMask: - serializedVersion: 2 - m_Bits: 4294967295 - m_RenderingPath: -1 - m_TargetTexture: {fileID: 0} - m_TargetDisplay: 0 - m_TargetEye: 3 - m_HDR: 1 - m_AllowMSAA: 1 - m_AllowDynamicResolution: 0 - m_ForceIntoRT: 0 - m_OcclusionCulling: 1 - m_StereoConvergence: 10 - m_StereoSeparation: 0.022 ---- !u!4 &2122252665 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2122252662} - serializedVersion: 2 - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 1, z: -10} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 0} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 1970733545076781942, guid: 687b16b0a8065d74fa4380e93a8a3d81, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1970733545076781942, guid: 687b16b0a8065d74fa4380e93a8a3d81, type: 3} + propertyPath: m_LocalPosition.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 1970733545076781942, guid: 687b16b0a8065d74fa4380e93a8a3d81, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1970733545076781942, guid: 687b16b0a8065d74fa4380e93a8a3d81, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 1970733545076781942, guid: 687b16b0a8065d74fa4380e93a8a3d81, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1970733545076781942, guid: 687b16b0a8065d74fa4380e93a8a3d81, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1970733545076781942, guid: 687b16b0a8065d74fa4380e93a8a3d81, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1970733545076781942, guid: 687b16b0a8065d74fa4380e93a8a3d81, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1970733545076781942, guid: 687b16b0a8065d74fa4380e93a8a3d81, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1970733545076781942, guid: 687b16b0a8065d74fa4380e93a8a3d81, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3597132959123631746, guid: 687b16b0a8065d74fa4380e93a8a3d81, type: 3} + propertyPath: SceneId + value: 3891920315 + objectReference: {fileID: 0} + - target: {fileID: 3597132959123631746, guid: 687b16b0a8065d74fa4380e93a8a3d81, type: 3} + propertyPath: WasActiveDuringEdit + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5354570318818660711, guid: 687b16b0a8065d74fa4380e93a8a3d81, type: 3} + propertyPath: m_Name + value: Player + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 687b16b0a8065d74fa4380e93a8a3d81, type: 3} --- !u!1660057539 &9223372036854775807 SceneRoots: m_ObjectHideFlags: 0 m_Roots: - - {fileID: 2122252665} - {fileID: 870123120} - {fileID: 795392108} - - {fileID: 1009904896} + - {fileID: 1617942571} + - {fileID: 7788027435049821057} + - {fileID: 1092242094} diff --git a/Assets/_Game/Scripts.meta b/Assets/_Game/Scripts.meta new file mode 100644 index 0000000..6692088 --- /dev/null +++ b/Assets/_Game/Scripts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2f672c14ecb575d6e6f1211f82648588 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Game/Scripts/PlayerController.cs b/Assets/_Game/Scripts/PlayerController.cs new file mode 100644 index 0000000..d1339a2 --- /dev/null +++ b/Assets/_Game/Scripts/PlayerController.cs @@ -0,0 +1,219 @@ +using UnityEngine; +using UnityEngine.InputSystem; + +/// +/// Capsule player: camera-relative movement, jump, gravity and mouse look. +/// Input comes from the project asset Assets/InputSystem_Actions.inputactions +/// ("Player" map: Move / Jump / Sprint). +/// +[RequireComponent(typeof(CharacterController))] +public class PlayerController : MonoBehaviour +{ + [Header("Input")] + [Tooltip("Optional: the project's InputSystem_Actions asset. Actions are resolved by name from it.")] + [SerializeField] private InputActionAsset actionsAsset; + [Tooltip("Optional explicit references. Take priority over actionsAsset when set.")] + [SerializeField] private InputActionReference moveAction; + [SerializeField] private InputActionReference jumpAction; + [SerializeField] private InputActionReference sprintAction; + + private InputAction _move; + private InputAction _jump; + private InputAction _sprint; + + [Header("Movement")] + [SerializeField] private float walkSpeed = 5f; + [SerializeField] private float sprintMultiplier = 1.8f; + [SerializeField] private float acceleration = 14f; + [SerializeField] private float rotationSpeed = 14f; + [SerializeField] private float jumpHeight = 1.4f; + + [Header("Gravity")] + [SerializeField] private float gravity = -22f; + [SerializeField] private float groundedForce = -2f; + [Tooltip("Extra ground probe at the feet, in addition to CharacterController.isGrounded.")] + [SerializeField] private float groundCheckRadius = 0.12f; + [Tooltip("Probe height relative to the transform origin. The capsule's feet are at y = 0.")] + [SerializeField] private float groundCheckOffset = 0.12f; + [SerializeField] private LayerMask groundMask = ~0; + + [Header("Camera")] + [SerializeField] private Transform cameraPivot; + [Tooltip("Create a third-person camera at runtime when the scene has no Main Camera.")] + [SerializeField] private bool createCameraIfMissing = true; + [SerializeField] private bool controlCursor = true; + [SerializeField] private float lookSensitivity = 0.12f; + [SerializeField] private float pitchMin = -35f; + [SerializeField] private float pitchMax = 70f; + [SerializeField] private float cameraDistance = 5f; + [SerializeField] private float cameraHeight = 1.2f; + [SerializeField] private float cameraSideOffset = 0.6f; + + private CharacterController _controller; + private Vector3 _planarVelocity; + private float _verticalVelocity; + private bool _grounded; + private float _yaw; + private float _pitch = 15f; + private Camera _camera; + + public bool IsGrounded { get { return _grounded; } } + public float CurrentSpeed { get { return _planarVelocity.magnitude; } } + + private void Awake() + { + _controller = GetComponent(); + _yaw = transform.eulerAngles.y; + ResolveActions(); + EnableActions(true); + } + + /// + /// Prefers explicit InputActionReference fields, otherwise resolves + /// "Player/Move", "Player/Jump" and "Player/Sprint" from the actions asset. + /// + private void ResolveActions() + { + _move = moveAction != null ? moveAction.action : null; + _jump = jumpAction != null ? jumpAction.action : null; + _sprint = sprintAction != null ? sprintAction.action : null; + + if (actionsAsset == null) return; + + if (_move == null) _move = actionsAsset.FindAction("Player/Move", false); + if (_jump == null) _jump = actionsAsset.FindAction("Player/Jump", false); + if (_sprint == null) _sprint = actionsAsset.FindAction("Player/Sprint", false); + } + + private void OnEnable() + { + EnableActions(true); + if (controlCursor) + { + Cursor.lockState = CursorLockMode.Locked; + Cursor.visible = false; + } + } + + private void OnDisable() + { + if (controlCursor) + { + Cursor.lockState = CursorLockMode.None; + Cursor.visible = true; + } + } + + private void EnableActions(bool enable) + { + SetEnabled(_move, enable); + SetEnabled(_jump, enable); + SetEnabled(_sprint, enable); + } + + private static void SetEnabled(InputAction action, bool enable) + { + if (action == null) return; + if (enable) action.Enable(); + else action.Disable(); + } + + private void Update() + { + ReadLook(); + ReadMove(); + ApplyGravityAndJump(); + Move(); + UpdateCamera(); + } + + private void ReadLook() + { + if (Mouse.current == null) return; + Vector2 delta = Mouse.current.delta.ReadValue() * lookSensitivity; + _yaw += delta.x; + _pitch = Mathf.Clamp(_pitch - delta.y, pitchMin, pitchMax); + } + + private void ReadMove() + { + Vector2 input = _move != null ? _move.ReadValue() : Vector2.zero; + + Quaternion yawRotation = Quaternion.Euler(0f, _yaw, 0f); + Vector3 desired = yawRotation * new Vector3(input.x, 0f, input.y); + if (desired.sqrMagnitude > 1f) desired.Normalize(); + + float speed = walkSpeed; + if (_sprint != null && _sprint.IsPressed()) + speed *= sprintMultiplier; + + _planarVelocity = Vector3.MoveTowards(_planarVelocity, desired * speed, acceleration * Time.deltaTime); + } + + private void ApplyGravityAndJump() + { + // CharacterController.isGrounded is the authoritative check (its capsule + // matches the visual): the extra sphere probe only helps on slopes/steps. + Vector3 origin = transform.position + Vector3.up * groundCheckOffset; + bool probeHit = Physics.CheckSphere(origin, groundCheckRadius, groundMask, QueryTriggerInteraction.Ignore); + _grounded = _controller.isGrounded || probeHit; + + if (_grounded && _verticalVelocity < 0f) _verticalVelocity = groundedForce; + + bool wantsJump = _jump != null && _jump.WasPressedThisFrame(); + if (wantsJump && _grounded) + _verticalVelocity = Mathf.Sqrt(jumpHeight * -2f * gravity); + + _verticalVelocity += gravity * Time.deltaTime; + } + + private void Move() + { + Vector3 motion = _planarVelocity + Vector3.up * _verticalVelocity; + _controller.Move(motion * Time.deltaTime); + + if (_planarVelocity.sqrMagnitude > 0.05f) + { + Quaternion target = Quaternion.LookRotation(_planarVelocity.normalized, Vector3.up); + transform.rotation = Quaternion.Slerp(transform.rotation, target, rotationSpeed * Time.deltaTime); + } + } + + private void UpdateCamera() + { + if (_camera == null) + { + _camera = Camera.main; + if (_camera == null && createCameraIfMissing) + _camera = CreateFallbackCamera(); + if (_camera == null) return; + } + + Transform pivot = cameraPivot != null ? cameraPivot : transform; + Vector3 pivotPoint = pivot.position + Vector3.up * cameraHeight + pivot.right * cameraSideOffset; + Quaternion rotation = Quaternion.Euler(_pitch, _yaw, 0f); + Vector3 position = pivotPoint + rotation * new Vector3(0f, 0f, -cameraDistance); + _camera.transform.SetPositionAndRotation(position, rotation); + } + + /// + /// Builds a third-person camera at runtime so the prefab is playable even in + /// a scene that has no camera. Only used when not overridden by an existing Main Camera. + /// + private static Camera CreateFallbackCamera() + { + GameObject cameraObject = new GameObject("PlayerCamera"); + cameraObject.tag = "MainCamera"; + Camera camera = cameraObject.AddComponent(); + camera.fieldOfView = 60f; + camera.nearClipPlane = 0.1f; + camera.farClipPlane = 1000f; + cameraObject.AddComponent(); + return camera; + } + + private void OnDrawGizmosSelected() + { + Gizmos.color = Color.yellow; + Gizmos.DrawWireSphere(transform.position + Vector3.up * groundCheckOffset, groundCheckRadius); + }} diff --git a/Assets/_Game/Scripts/PlayerController.cs.meta b/Assets/_Game/Scripts/PlayerController.cs.meta new file mode 100644 index 0000000..cf5d688 --- /dev/null +++ b/Assets/_Game/Scripts/PlayerController.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: b6780c1c0b9d27c46a0bd43f0d2291f6 \ No newline at end of file