diff --git a/Assets/Prefabs/Player/DebugPlayerPrefab.prefab b/Assets/Prefabs/Player/DebugPlayerPrefab.prefab new file mode 100644 index 0000000..8abb495 --- /dev/null +++ b/Assets/Prefabs/Player/DebugPlayerPrefab.prefab @@ -0,0 +1,587 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &2556153648277679257 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 9156062931443001395} + - component: {fileID: 4654986889578046791} + - component: {fileID: 5366743213109129288} + - component: {fileID: 3180402800742829025} + m_Layer: 3 + m_Name: PlayerCam + m_TagString: PlayerCam + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &9156062931443001395 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2556153648277679257} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -2, y: 2.85, z: -4} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 6926740475113451123} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!20 &4654986889578046791 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2556153648277679257} + 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_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + 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!81 &5366743213109129288 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2556153648277679257} + m_Enabled: 1 +--- !u!114 &3180402800742829025 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2556153648277679257} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f8178c747ab202f4bb17b33e02bf63a5, type: 3} + m_Name: + m_EditorClassIdentifier: + player: {fileID: 3607330906377400225} +--- !u!1 &2820167404173322085 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2731864384567516644} + - component: {fileID: 3915742414722405018} + - component: {fileID: 2608943093325739444} + - component: {fileID: 2749925311514219933} + m_Layer: 3 + m_Name: Leg + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2731864384567516644 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2820167404173322085} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0.14, y: 0.02, z: 1.12} + m_LocalScale: {x: 0.2, y: 0.2, z: 2} + m_Children: [] + m_Father: {fileID: 8720404377688450390} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &3915742414722405018 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2820167404173322085} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &2608943093325739444 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2820167404173322085} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + 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_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!65 &2749925311514219933 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2820167404173322085} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!1 &3607330906377400225 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8720404377688450390} + - component: {fileID: 7034690385585902224} + - component: {fileID: 3471270956356843213} + - component: {fileID: 8100520363622627413} + - component: {fileID: 7097691538269713306} + - component: {fileID: 7616279934999327372} + - component: {fileID: 7058615058147771192} + - component: {fileID: 3559681995605743320} + - component: {fileID: 8445875817354890259} + - component: {fileID: 4889953713382264203} + - component: {fileID: 6743056025486776975} + - component: {fileID: 4367973138255890080} + - component: {fileID: 4788888989419098570} + - component: {fileID: 471283137481508403} + - component: {fileID: 5784126162129930074} + - component: {fileID: 1818923263116056088} + - component: {fileID: 7009009384233397507} + m_Layer: 3 + m_Name: PlayerModel + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &8720404377688450390 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3607330906377400225} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -2, y: 1.25, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 2731864384567516644} + m_Father: {fileID: 6926740475113451123} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &7034690385585902224 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3607330906377400225} + m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &3471270956356843213 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3607330906377400225} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + 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_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!114 &8100520363622627413 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3607330906377400225} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: addc2e37ff81c1b4989ec34b6150b4f7, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &7097691538269713306 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3607330906377400225} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5a5d879591af1084ab5d3a35fcd53086, type: 3} + m_Name: + m_EditorClassIdentifier: + items: [] + pStats: {fileID: 0} +--- !u!114 &7616279934999327372 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3607330906377400225} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1a8c22589436d2449a89cf3a40b6d252, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!54 &7058615058147771192 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3607330906377400225} + serializedVersion: 2 + m_Mass: 1 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 0 + m_IsKinematic: 1 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!136 &3559681995605743320 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3607330906377400225} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.5 + m_Height: 1 + m_Direction: 1 + m_Center: {x: 0, y: 0, z: 0} +--- !u!143 &8445875817354890259 +CharacterController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3607330906377400225} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Height: 2 + m_Radius: 0.5 + m_SlopeLimit: 45 + m_StepOffset: 0.3 + m_SkinWidth: 0.08 + m_MinMoveDistance: 0.001 + m_Center: {x: 0, y: 0, z: 0} +--- !u!114 &4889953713382264203 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3607330906377400225} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e96cb6065543e43c4a752faaa1468eb1, type: 3} + m_Name: + m_EditorClassIdentifier: + FixedSendsPerSecond: 20 + AssumeSyncedSends: 1 + InterpolatePosition: 1 + SnapDistance: 10 + InterpolateServer: 1 + MinMeters: 0.15 + MinDegrees: 1.5 + ExtrapolatePosition: 0 + MaxSendsToExtrapolate: 5 + Channel: + EnableRange: 0 + EnableNonProvokedResendChecks: 0 + DistanceSendrate: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 20 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 500 + value: 20 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 +--- !u!114 &6743056025486776975 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3607330906377400225} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 77da7821cb08097418fbac702ac00f93, type: 3} + m_Name: + m_EditorClassIdentifier: + pStats: {fileID: 0} + vel: {x: 0, y: 0, z: 0} + isGrounded: 0 + groundCheckDistance: 0.05 + minAngle: -30 + maxAngle: 45 + sensitivity: 200 +--- !u!114 &4367973138255890080 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3607330906377400225} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a504b3f7be0e5254e815029049abbeac, type: 3} + m_Name: + m_EditorClassIdentifier: + controller: {fileID: 0} +--- !u!114 &4788888989419098570 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3607330906377400225} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 813241e4d3933be429c9295081a09142, type: 3} + m_Name: + m_EditorClassIdentifier: + pStats: {fileID: 0} +--- !u!114 &471283137481508403 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3607330906377400225} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a1f672a4741230d4a963fb68f5f8a8aa, type: 3} + m_Name: + m_EditorClassIdentifier: + maxGrappleDistance: 25 +--- !u!114 &5784126162129930074 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3607330906377400225} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b8e55f866f601244e9d99bc8e1c82334, type: 3} + m_Name: + m_EditorClassIdentifier: + moveDirection: {x: 0, y: 0, z: 0} + dashDistance: 10 + dashStoppingSpeed: 0.1 +--- !u!114 &1818923263116056088 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3607330906377400225} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4264f4f7bed1d7499a037436582ed17, type: 3} + m_Name: + m_EditorClassIdentifier: + wallMaxDistance: 1 + wallSpeedMultiplier: 1.2 + minimumHeight: 1.2 + maxAngleRoll: 20 + normalizedAngleThreshold: 0.1 + jumpDuration: 1 + wallBouncing: 3 + cameraTransitionDuration: 1 + wallGravityDownForce: 20 +--- !u!114 &7009009384233397507 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3607330906377400225} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 22ae0d31c49624d4fb9990f2f5f72fd9, type: 3} + m_Name: + m_EditorClassIdentifier: + pStats: {fileID: 0} + vel: {x: 0, y: 0, z: 0} + isGrounded: 0 + groundCheckDistance: 0.05 + minAngle: -30 + maxAngle: 45 + sensitivity: 200 +--- !u!1 &5633209979457551608 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6926740475113451123} + - component: {fileID: 1804350508516904863} + m_Layer: 3 + m_Name: DebugPlayerPrefab + m_TagString: Player + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &6926740475113451123 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5633209979457551608} + 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_Children: + - {fileID: 9156062931443001395} + - {fileID: 8720404377688450390} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1804350508516904863 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5633209979457551608} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkInstanceId: 0 + PrefabHash: 8672539184207985188 + PrefabHashGenerator: PlayerPrefab + AlwaysReplicateAsRoot: 0 + DontDestroyWithOwner: 0 diff --git a/Assets/Prefabs/Player/DebugPlayerPrefab.prefab.meta b/Assets/Prefabs/Player/DebugPlayerPrefab.prefab.meta new file mode 100644 index 0000000..9bcccf2 --- /dev/null +++ b/Assets/Prefabs/Player/DebugPlayerPrefab.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 362ca97b75c291a47ab81d628a81f440 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefabs/Player/PlayerPrefab.prefab b/Assets/Prefabs/Player/PlayerPrefab.prefab index 8a25bf6..5879544 100644 --- a/Assets/Prefabs/Player/PlayerPrefab.prefab +++ b/Assets/Prefabs/Player/PlayerPrefab.prefab @@ -18,12 +18,12 @@ GameObject: - component: {fileID: 1952443820573609623} - component: {fileID: 4323471435859684389} - component: {fileID: 3672942772524564832} - - component: {fileID: 2620970719070296463} - component: {fileID: 2356773567935625033} - component: {fileID: 2942875262947626129} - component: {fileID: 8956701063868523892} - component: {fileID: 3772338269032432186} - component: {fileID: 5687943635225929219} + - component: {fileID: 4493700469442532605} m_Layer: 0 m_Name: PlayerModel m_TagString: Untagged @@ -41,7 +41,8 @@ Transform: 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_Children: [] + m_Children: + - {fileID: 9039284905748829538} m_Father: {fileID: 7188906082087890177} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -201,18 +202,6 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: maxGrappleDistance: 25 ---- !u!114 &2620970719070296463 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 4814433541978696327} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: f9b52b0ade3c44e47a3a4dc48c47ec1c, type: 3} - m_Name: - m_EditorClassIdentifier: --- !u!114 &2356773567935625033 MonoBehaviour: m_ObjectHideFlags: 0 @@ -225,7 +214,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 0c0aad94b3b1332408ef8e7d07f3b321, type: 3} m_Name: m_EditorClassIdentifier: - leg: {fileID: 0} + pStats: {fileID: 0} --- !u!114 &2942875262947626129 MonoBehaviour: m_ObjectHideFlags: 0 @@ -286,65 +275,14 @@ CharacterController: m_SkinWidth: 0.08 m_MinMoveDistance: 0.001 m_Center: {x: 0, y: 0, z: 0} ---- !u!1 &7188906082087890184 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 7188906082087890177} - - component: {fileID: 5368328878093455966} - - component: {fileID: 701079060217590907} - m_Layer: 3 - m_Name: PlayerPrefab - m_TagString: Player - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &7188906082087890177 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 7188906082087890184} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 1, y: 1.8, z: -0.2} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 7188906082643956518} - - {fileID: 394725941300514827} - m_Father: {fileID: 0} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &5368328878093455966 +--- !u!114 &4493700469442532605 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 7188906082087890184} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3} - m_Name: - m_EditorClassIdentifier: - NetworkInstanceId: 0 - PrefabHash: 8672539184207985188 - PrefabHashGenerator: PlayerPrefab - AlwaysReplicateAsRoot: 0 - DontDestroyWithOwner: 0 ---- !u!114 &701079060217590907 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 7188906082087890184} - m_Enabled: 1 + m_GameObject: {fileID: 4814433541978696327} + m_Enabled: 0 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: e96cb6065543e43c4a752faaa1468eb1, type: 3} m_Name: @@ -385,6 +323,56 @@ MonoBehaviour: m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 +--- !u!1 &7188906082087890184 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7188906082087890177} + - component: {fileID: 5368328878093455966} + m_Layer: 3 + m_Name: PlayerPrefab + m_TagString: Player + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7188906082087890177 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7188906082087890184} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 1, y: 1.8, z: -0.2} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 7188906082643956518} + - {fileID: 394725941300514827} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &5368328878093455966 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7188906082087890184} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkInstanceId: 0 + PrefabHash: 8672539184207985188 + PrefabHashGenerator: PlayerPrefab + AlwaysReplicateAsRoot: 0 + DontDestroyWithOwner: 0 --- !u!1 &7188906082643956521 GameObject: m_ObjectHideFlags: 0 @@ -482,3 +470,98 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: player: {fileID: 4814433541978696327} +--- !u!1 &9219263970634874959 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 9039284905748829538} + - component: {fileID: 3642785993242854697} + - component: {fileID: 8281245322082541828} + - component: {fileID: 4935229574192843661} + m_Layer: 0 + m_Name: Leg + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &9039284905748829538 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9219263970634874959} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0.14, y: 0.02, z: 1.12} + m_LocalScale: {x: 0.2, y: 0.2, z: 2} + m_Children: [] + m_Father: {fileID: 394725941300514827} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &3642785993242854697 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9219263970634874959} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &8281245322082541828 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9219263970634874959} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + 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_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!65 &4935229574192843661 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9219263970634874959} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} diff --git a/Assets/Scenes/Demos/InventorySelection.unity b/Assets/Scenes/Demos/InventorySelection.unity index a75d3b0..665bc17 100644 --- a/Assets/Scenes/Demos/InventorySelection.unity +++ b/Assets/Scenes/Demos/InventorySelection.unity @@ -240,6 +240,63 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 105946287} m_CullTransparentMesh: 1 +--- !u!1001 &291813267 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 7188906082087890177, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} + propertyPath: m_RootOrder + value: 5 + objectReference: {fileID: 0} + - target: {fileID: 7188906082087890177, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} + propertyPath: m_LocalPosition.x + value: -2 + objectReference: {fileID: 0} + - target: {fileID: 7188906082087890177, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} + propertyPath: m_LocalPosition.y + value: 1.25 + objectReference: {fileID: 0} + - target: {fileID: 7188906082087890177, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7188906082087890177, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 7188906082087890177, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7188906082087890177, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7188906082087890177, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7188906082087890177, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7188906082087890177, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7188906082087890177, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7188906082087890184, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} + propertyPath: m_Name + value: PlayerPrefab + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} --- !u!1 &351537840 GameObject: m_ObjectHideFlags: 0 @@ -336,7 +393,7 @@ RectTransform: - {fileID: 2333107} - {fileID: 1968992433} m_Father: {fileID: 0} - m_RootOrder: 4 + m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -494,119 +551,6 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} ---- !u!1001 &565390001 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 623466146960117777, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} - propertyPath: m_Enabled - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 1006370620272136424, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} - propertyPath: m_Enabled - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 1121632309457683679, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} - propertyPath: m_Enabled - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 1122837021074491360, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} - propertyPath: m_Enabled - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 1602186932439279558, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} - propertyPath: m_Enabled - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 3454731726544993114, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} - propertyPath: m_Enabled - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 3772338269032432186, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} - propertyPath: m_Height - value: 2 - objectReference: {fileID: 0} - - target: {fileID: 4910425103423673310, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} - propertyPath: m_Enabled - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 7061360697648900808, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} - propertyPath: m_UseGravity - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7061360697648900808, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} - propertyPath: m_IsKinematic - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 7188906082087890177, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} - propertyPath: m_RootOrder - value: 3 - objectReference: {fileID: 0} - - target: {fileID: 7188906082087890177, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} - propertyPath: m_LocalPosition.x - value: -2.012 - objectReference: {fileID: 0} - - target: {fileID: 7188906082087890177, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} - propertyPath: m_LocalPosition.y - value: 1.25 - objectReference: {fileID: 0} - - target: {fileID: 7188906082087890177, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} - propertyPath: m_LocalPosition.z - value: 0.03 - objectReference: {fileID: 0} - - target: {fileID: 7188906082087890177, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 7188906082087890177, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7188906082087890177, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7188906082087890177, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7188906082087890177, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7188906082087890177, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7188906082087890177, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7188906082087890184, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} - propertyPath: m_Name - value: PlayerPrefab - objectReference: {fileID: 0} - - target: {fileID: 7442108947324986527, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} - propertyPath: m_Enabled - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 7623511089535041046, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} - propertyPath: m_Enabled - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8956701063868523892, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} - propertyPath: m_UseGravity - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8956701063868523892, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} - propertyPath: m_CollisionDetection - value: 3 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: a9840baa4cc526b44bfef27c6fea042a, type: 3} --- !u!1 &591528209 GameObject: m_ObjectHideFlags: 0 @@ -707,7 +651,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 5 + m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &747127855 GameObject: diff --git a/Assets/Scenes/Demos/MovementScene.unity b/Assets/Scenes/Demos/MovementScene.unity index beeee65..e8f622b 100644 --- a/Assets/Scenes/Demos/MovementScene.unity +++ b/Assets/Scenes/Demos/MovementScene.unity @@ -313,6 +313,118 @@ MeshFilter: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 228851343} m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &306592003 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 306592004} + - component: {fileID: 306592007} + - component: {fileID: 306592006} + - component: {fileID: 306592005} + - component: {fileID: 306592008} + m_Layer: 0 + m_Name: Sphere + m_TagString: kickable + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &306592004 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 306592003} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 7.3, y: -1.7, z: 0} + m_LocalScale: {x: 3, y: 3, z: 3} + m_Children: [] + m_Father: {fileID: 1985880503} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!135 &306592005 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 306592003} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.5 + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &306592006 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 306592003} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + 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_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &306592007 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 306592003} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!54 &306592008 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 306592003} + serializedVersion: 2 + m_Mass: 10 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 --- !u!1 &478416584 GameObject: m_ObjectHideFlags: 0 @@ -408,6 +520,37 @@ MeshFilter: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 478416584} m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &724425600 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 724425601} + m_Layer: 0 + m_Name: Walls + m_TagString: WallRun + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &724425601 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 724425600} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 2.0000002, y: 2.1131458, z: -0.73} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1650963653} + m_Father: {fileID: 0} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &827706392 GameObject: m_ObjectHideFlags: 0 @@ -1016,6 +1159,101 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1650963652 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1650963653} + - component: {fileID: 1650963656} + - component: {fileID: 1650963655} + - component: {fileID: 1650963654} + m_Layer: 0 + m_Name: Cube + m_TagString: WallRun + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1650963653 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1650963652} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 8.6, y: 2.04, z: -27.9} + m_LocalScale: {x: 1, y: 10, z: 30} + m_Children: [] + m_Father: {fileID: 724425601} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!65 &1650963654 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1650963652} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &1650963655 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1650963652} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + 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_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &1650963656 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1650963652} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} --- !u!1 &1806935633 GameObject: m_ObjectHideFlags: 0 @@ -1111,6 +1349,37 @@ MeshFilter: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1806935633} m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &1985880502 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1985880503} + m_Layer: 0 + m_Name: Kickables + m_TagString: kickable + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1985880503 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1985880502} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -2.7971706, y: 5.709936, z: 51.885536} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 306592004} + m_Father: {fileID: 0} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &2061208975 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/PlayerScripts/DebugPlayer.meta b/Assets/Scripts/PlayerScripts/DebugPlayer.meta new file mode 100644 index 0000000..325bfc7 --- /dev/null +++ b/Assets/Scripts/PlayerScripts/DebugPlayer.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 236528fef9e9ed54fa77a41f6facd741 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/PlayerScripts/DebugPlayer/DebugItems.meta b/Assets/Scripts/PlayerScripts/DebugPlayer/DebugItems.meta new file mode 100644 index 0000000..2270d55 --- /dev/null +++ b/Assets/Scripts/PlayerScripts/DebugPlayer/DebugItems.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2d32b8429f4a3df48a3585d68287b81a +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/PlayerScripts/DebugPlayer/DebugItems/dBlink.cs b/Assets/Scripts/PlayerScripts/DebugPlayer/DebugItems/dBlink.cs new file mode 100644 index 0000000..afc824d --- /dev/null +++ b/Assets/Scripts/PlayerScripts/DebugPlayer/DebugItems/dBlink.cs @@ -0,0 +1,102 @@ +using System.Collections; +using System.Collections.Generic; +using MLAPI; +using UnityEngine; + + + +public class dBlink : NetworkBehaviour{ + + // Start is called before the first frame update + + private Camera cam; + public CharacterController controller; + //Blink Variables + private LineRenderer beam; + private Vector3 origin; + private Vector3 endPoint; + private Vector3 mousePos; + private RaycastHit hit; + + LayerMask ignoreP; + ///// + + private void Awake() + { + beam = gameObject.AddComponent(); + beam.startWidth = 0.2f; + beam.endWidth = 0.2f; + beam.enabled = false; + + ignoreP = LayerMask.GetMask("Player"); + + controller = GetComponent(); + } + void Start(){ + + // Grab the main camera. + //camera transform + cam = GetComponentInChildren(); + } + + //ADJUST SO DISTANCE IS DETERMINED BY SCROLL WHEEL + //blinks the player forwards + private void BlinkMove() + { + if (!IsLocalPlayer) { return; } + + if (Input.GetMouseButton(1)) + { + // Finding the origin and end point of laser. + origin = transform.position + transform.forward * transform.lossyScale.z; + + // Finding mouse pos in 3D space. + mousePos = Input.mousePosition; + mousePos.z = 20f; + endPoint = cam.ScreenToWorldPoint(mousePos); + + // Find direction of beam. + Vector3 dir = endPoint - origin; + dir.Normalize(); + + // Are we hitting any colliders? + if (Physics.Raycast(origin, dir, out hit, 20f)) + { + // If yes, then set endpoint to hit-point. + endPoint = hit.point; + } + + // Set end point of laser. + beam.SetPosition(0, origin); + beam.SetPosition(1, endPoint); + // Draw the laser! + beam.enabled = true; + /*Ray ray = camera.ScreenPointToRay(Input.mousePosition); + RaycastHit raycastHit; + + if (Physics.Raycast(ray, out raycastHit, 5.0f)){ + LineRenderer.SetPosition(1, raycastHit.point); + }*/ + + } + + else if (!Input.GetMouseButton(1) && beam.enabled == true) + { + beam.enabled = false; + //if teleporting due to hit to object, bump them a bit outside normal + if (hit.point != null) + { + transform.position = endPoint + hit.normal * 1.25f; + + } + //if teleporting in the air or something, just spawn at endpoint + else + { + + transform.position = endPoint; + } + //reenable character controller + } + } + +} diff --git a/Assets/Scripts/PlayerScripts/MovementAbilities/Kick.cs.meta b/Assets/Scripts/PlayerScripts/DebugPlayer/DebugItems/dBlink.cs.meta similarity index 83% rename from Assets/Scripts/PlayerScripts/MovementAbilities/Kick.cs.meta rename to Assets/Scripts/PlayerScripts/DebugPlayer/DebugItems/dBlink.cs.meta index af5351a..a02e582 100644 --- a/Assets/Scripts/PlayerScripts/MovementAbilities/Kick.cs.meta +++ b/Assets/Scripts/PlayerScripts/DebugPlayer/DebugItems/dBlink.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: f9b52b0ade3c44e47a3a4dc48c47ec1c +guid: a504b3f7be0e5254e815029049abbeac MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/Scripts/PlayerScripts/DebugPlayer/DebugItems/dDash.cs b/Assets/Scripts/PlayerScripts/DebugPlayer/DebugItems/dDash.cs new file mode 100644 index 0000000..6c480d9 --- /dev/null +++ b/Assets/Scripts/PlayerScripts/DebugPlayer/DebugItems/dDash.cs @@ -0,0 +1,42 @@ +using System.Collections; +using System.Collections.Generic; +using MLAPI; +using UnityEngine; + + +public class dDash : NetworkBehaviour{ + public Vector3 moveDirection; + + public const float maxDashTime = 1.0f; + public float dashDistance = 10; + public float dashStoppingSpeed = 0.1f; + float currentDashTime = maxDashTime; + float dashSpeed = 12; + + CharacterController characterController; + + void Start(){ + characterController = this.gameObject.GetComponent(); + } + + //UPDATE CHECK FOR MOVEMENT ONLY WHEN DASHING + void FixedUpdate(){ + if (!IsLocalPlayer) { return; } + + if (Input.GetKeyDown(KeyCode.E)) + { + currentDashTime = 0; + } + if(currentDashTime < maxDashTime) + { + moveDirection = transform.forward * dashDistance; + currentDashTime += dashStoppingSpeed; + } + else + { + moveDirection = Vector3.zero; + } + characterController.Move(moveDirection * Time.deltaTime * dashSpeed); + } + +} \ No newline at end of file diff --git a/Assets/Scripts/PlayerScripts/MovementAbilities/Slide.cs.meta b/Assets/Scripts/PlayerScripts/DebugPlayer/DebugItems/dDash.cs.meta similarity index 83% rename from Assets/Scripts/PlayerScripts/MovementAbilities/Slide.cs.meta rename to Assets/Scripts/PlayerScripts/DebugPlayer/DebugItems/dDash.cs.meta index a668d7d..35685a3 100644 --- a/Assets/Scripts/PlayerScripts/MovementAbilities/Slide.cs.meta +++ b/Assets/Scripts/PlayerScripts/DebugPlayer/DebugItems/dDash.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: aa419fd069f632e479eda138a7764362 +guid: b8e55f866f601244e9d99bc8e1c82334 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/Scripts/PlayerScripts/DebugPlayer/DebugItems/dGrapplingHook.cs b/Assets/Scripts/PlayerScripts/DebugPlayer/DebugItems/dGrapplingHook.cs new file mode 100644 index 0000000..8e145b4 --- /dev/null +++ b/Assets/Scripts/PlayerScripts/DebugPlayer/DebugItems/dGrapplingHook.cs @@ -0,0 +1,70 @@ +using System.Collections; +using System.Collections.Generic; +using MLAPI; +using UnityEngine; + +public class dGrapplingHook : NetworkBehaviour +{ + public float maxGrappleDistance = 25; + + private bool isGrappled; + private int hookPointIndex; + private GameObject hookPoint; + private GameObject[] hookPoints; + private float distance; + + // Start is called before the first frame update + void Start() + { + isGrappled = false; + hookPoints = GameObject.FindGameObjectsWithTag("HookPoint"); + } + + // Update is called once per frame + void Update() + { + if (!IsLocalPlayer) { return; } + + if (Input.GetKeyDown(KeyCode.E)) //If grapple button is hit + { + if (!isGrappled) //If we are not grappling + { + hookPointIndex = FindHookPoint(); //Find the nearest hook point within max distance + if (hookPointIndex != -1) //If there is a hookpoint + { + hookPoint = hookPoints[hookPointIndex]; //The point we are grappling from + //physics set up? + isGrappled = true; //toggle grappling state + } + } + else //Else we are grappling + { + //physics tear down? + isGrappled = false; //toggle grappling state to release + } + } + } + + private void FixedUpdate() + { + if (isGrappled) + { + //Do grappling physics based on hookPoint + } + } + + int FindHookPoint() + { + float least = maxGrappleDistance; + int index = -1; + for(int i = 0; i(); + + characterController = this.gameObject.GetComponent(); + leg = transform.GetChild(0).gameObject; + leg.SetActive(false); + } + + void Update(){ + Kick(); + } + + void Kick(){ + //Note: when we merge this into PlayerMovement, we may want to change isgrounded to our + //custom is grounded + if (Input.GetKeyDown(KeyCode.F) && isKicking == false && characterController.isGrounded == false) + { + Debug.Log("dive"); + // if kicking in air, kick until grounded (maybe add some foward momentum if needeD) + isKicking = true; + isDiveKicking = true; + leg.SetActive(true); + } + //otherwise do ground kick for .3 seconds + else if (Input.GetKeyDown(KeyCode.F) && isKicking == false){ + Debug.Log("kick"); + StartCoroutine(Kicking(.3f)); + } + + //once dive kick touches ground, set back to normal state + if(characterController.isGrounded == true && isDiveKicking == true){ + isDiveKicking = false; + isKicking = false; + leg.SetActive(false); + + } + } + + private IEnumerator Kicking(float waitTime){ + isKicking = true; + leg.SetActive(true); + yield return new WaitForSeconds(waitTime); + isKicking = false; + leg.SetActive(false); + + } + + private void OnCollisionEnter(Collision collision) + { + if (!IsLocalPlayer) { return; } + Collider myCollider = collision.contacts[0].thisCollider; + if (collision.transform.CompareTag("kickable") && myCollider == leg.GetComponent()){ + Vector3 direction = this.transform.forward; + Debug.Log(direction); + collision.rigidbody.AddForce(direction * pStats.KickPow, ForceMode.Impulse); + } + } + +} diff --git a/Assets/Scripts/PlayerScripts/DebugPlayer/DebugItems/dKickController.cs.meta b/Assets/Scripts/PlayerScripts/DebugPlayer/DebugItems/dKickController.cs.meta new file mode 100644 index 0000000..8d9d8be --- /dev/null +++ b/Assets/Scripts/PlayerScripts/DebugPlayer/DebugItems/dKickController.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 813241e4d3933be429c9295081a09142 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/PlayerScripts/DebugPlayer/DebugItems/dWallRun.cs b/Assets/Scripts/PlayerScripts/DebugPlayer/DebugItems/dWallRun.cs new file mode 100644 index 0000000..9647ae5 --- /dev/null +++ b/Assets/Scripts/PlayerScripts/DebugPlayer/DebugItems/dWallRun.cs @@ -0,0 +1,193 @@ +using UnityEngine; +using System.Linq; +using MLAPI; +using UnityEngine.Rendering; + +[RequireComponent (typeof(PlayerMovement))] +public class dWallRun : NetworkBehaviour +{ + + public float wallMaxDistance = 1; + public float wallSpeedMultiplier = 1.2f; + public float minimumHeight = 1.2f; + public float maxAngleRoll = 20; + [Range(0.0f, 1.0f)] + public float normalizedAngleThreshold = 0.1f; + + public float jumpDuration = 1; + public float wallBouncing = 3; + public float cameraTransitionDuration = 1; + + public float wallGravityDownForce = 20f; + + [Space] + PlayerMovement playerMovementController; + + Vector3[] directions; + RaycastHit[] hits; + + bool isWallRunning = false; + Vector3 lastWallPosition; + Vector3 lastWallNormal; + float elapsedTimeSinceJump = 0; + float elapsedTimeSinceWallAttach = 0; + float elapsedTimeSinceWallDetatch = 0; + bool jumping; + + bool isPlayergrounded() => playerMovementController.isGrounded; + + public bool IsWallRunning() => isWallRunning; + + bool CanWallRun() + { + float verticalAxis = Input.GetAxisRaw("Vertical"); + + return !isPlayergrounded() && verticalAxis > 0 && VerticalCheck(); + } + + bool VerticalCheck() + { + return !Physics.Raycast(transform.position, Vector3.down, minimumHeight); + } + + + void Start() + { + playerMovementController = GetComponent(); + + directions = new Vector3[]{ + Vector3.right, + Vector3.right + Vector3.forward, + Vector3.forward, + Vector3.left + Vector3.forward, + Vector3.left + }; + } + + + public void WallRunRoutine() + { + + if (!IsLocalPlayer) { return; } + + isWallRunning = false; + + if(playerMovementController.GetJumpPressed()) + { + jumping = true; + } + + if(CanAttach()) + { + hits = new RaycastHit[directions.Length]; + + for(int i=0; i h.collider != null).OrderBy(h => h.distance).ToArray(); + if(hits.Length > 0) + { + if(hits[0].collider.tag == "WallRun") + { + OnWall(hits[0]); + lastWallPosition = hits[0].point; + lastWallNormal = hits[0].normal; + } + } + } + } + + if(isWallRunning) + { + elapsedTimeSinceWallDetatch = 0; + elapsedTimeSinceWallAttach += Time.deltaTime; + playerMovementController.AddPlayerVelocity((Vector3.down * wallGravityDownForce * Time.deltaTime)); + } + else + { + elapsedTimeSinceWallAttach = 0; + elapsedTimeSinceWallDetatch += Time.deltaTime; + } + } + + bool CanAttach() + { + if(jumping) + { + elapsedTimeSinceJump += Time.deltaTime; + if(elapsedTimeSinceJump > jumpDuration) + { + elapsedTimeSinceJump = 0; + jumping = false; + } + return false; + } + return true; + } + + void OnWall(RaycastHit hit){ + float d = Vector3.Dot(hit.normal, Vector3.up); + if(d >= -normalizedAngleThreshold && d <= normalizedAngleThreshold) + { + // Vector3 alongWall = Vector3.Cross(hit.normal, Vector3.up); + float vertical = Input.GetAxisRaw("Vertical"); + Vector3 alongWall = transform.TransformDirection(Vector3.forward); + + //Debug.DrawRay(transform.position, alongWall.normalized * 10, Color.green); + //Debug.DrawRay(transform.position, lastWallNormal * 10, Color.magenta); + + Vector3 moveToSet = alongWall * vertical * playerMovementController.PlayerSpeed() *Time.deltaTime;// * wallSpeedMultiplier; + moveToSet.y = 0; + + playerMovementController.SetPlayerVelocity(moveToSet); + //Debug.Log("On Wall"); + isWallRunning = true; + } + } + + float CalculateSide() + { + if(isWallRunning) + { + Vector3 heading = lastWallPosition - transform.position; + Vector3 perp = Vector3.Cross(transform.forward, heading); + float dir = Vector3.Dot(perp, transform.up); + return dir; + } + return 0; + } + + public float GetCameraRoll() //Cause camera to roll when wall running - call to this is player movement + { + float dir = CalculateSide(); + float cameraAngle = playerMovementController.GetPlayerCamera().transform.eulerAngles.z; + float targetAngle = 0; + if(dir != 0) + { + targetAngle = Mathf.Sign(dir) * maxAngleRoll; + } + return Mathf.LerpAngle(cameraAngle, targetAngle, Mathf.Max(elapsedTimeSinceWallAttach, elapsedTimeSinceWallDetatch) / cameraTransitionDuration); + } + + public Vector3 GetWallJumpDirection() //Add call in jump where if we are wallrunning and jump, the jump vector is multiplied by this + { + if(isWallRunning) + { + return lastWallNormal * wallBouncing + Vector3.up; + } + return Vector3.zero; + } +} diff --git a/Assets/Scripts/PlayerScripts/DebugPlayer/DebugItems/dWallRun.cs.meta b/Assets/Scripts/PlayerScripts/DebugPlayer/DebugItems/dWallRun.cs.meta new file mode 100644 index 0000000..5a62181 --- /dev/null +++ b/Assets/Scripts/PlayerScripts/DebugPlayer/DebugItems/dWallRun.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f4264f4f7bed1d7499a037436582ed17 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/PlayerScripts/DebugPlayer/dPlayCam.cs b/Assets/Scripts/PlayerScripts/DebugPlayer/dPlayCam.cs new file mode 100644 index 0000000..fe3fe3e --- /dev/null +++ b/Assets/Scripts/PlayerScripts/DebugPlayer/dPlayCam.cs @@ -0,0 +1,26 @@ +using System.Collections; +using System.Collections.Generic; +using MLAPI; +using UnityEngine; + +public class dPlayCam : NetworkBehaviour +{ + public GameObject player; + + private Vector3 offset; + private Vector3 rad; + + void Start () + { + rad = (transform.position - player.transform.position); + } + + void Update () + { + if (!IsLocalPlayer) { return; } + + offset = transform.parent.forward * rad.magnitude; + transform.position = new Vector3((player.transform.position.x - offset.x),((player.transform.position.y - offset.y)+2),(player.transform.position.z - offset.z)); + + } +} diff --git a/Assets/Scripts/PlayerScripts/DebugPlayer/dPlayCam.cs.meta b/Assets/Scripts/PlayerScripts/DebugPlayer/dPlayCam.cs.meta new file mode 100644 index 0000000..aef320d --- /dev/null +++ b/Assets/Scripts/PlayerScripts/DebugPlayer/dPlayCam.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f8178c747ab202f4bb17b33e02bf63a5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/PlayerScripts/DebugPlayer/dPlayerMovement.cs b/Assets/Scripts/PlayerScripts/DebugPlayer/dPlayerMovement.cs new file mode 100644 index 0000000..f9e7664 --- /dev/null +++ b/Assets/Scripts/PlayerScripts/DebugPlayer/dPlayerMovement.cs @@ -0,0 +1,460 @@ +using System.Collections; +using System.Collections.Generic; +using MLAPI; +using UnityEngine; +using UnityEngine.UI; + +public class dPlayerMovement : NetworkBehaviour +{ + + //Scripts + public PlayerStats pStats; + + //Variable Section + ///// + //Speed Variables + public Vector3 vel; + + private Vector3 moveZ; + private Vector3 moveX; + private Vector3 driftVel; + + //Player prefab + private GameObject parentObj; + + //Character Moving + private CharacterController moveController; + + //Jump value + private int curJumpNum; + private bool jumpPressed; + bool tempSet = false; + float tempTraction = 0.0f; + + //Jump physics + private float mass = 5.0F; // defines the character mass + private Vector3 impact = Vector3.zero; + private float distToGround; + + //Wallrunning + private WallRun wallRun; + + //Ground Check + public bool isGrounded; //Better custom is grounded + public float groundCheckDistance = 0.05f; //how far away from the ground to not be considered grounded + private float lastTimeJumped = 0f; //Last time the player jumped + const float jumpGroundingPreventionTime = 0.2f; // delay in checking if we are grounded after a jump + const float groundCheckDistanceInAir = 0.07f; //How close we have to get to ground to start checking for grounded again + private Ray groundRay; + private RaycastHit groundHit; + + //Camera Variables + private LayerMask ignoreP; + private Vector3 camRotation; + private Camera cam; + + [Range(-45, -15)] + public int minAngle = -30; + [Range(30, 80)] + public int maxAngle = 45; + [Range(50, 500)] + public int sensitivity = 200; + + //Ragdoll variables + private Vector3 hit; + private Rigidbody rB; + private CapsuleCollider capCol; + private bool firstHit = false; + private bool heldDown = false; + private bool beginRagTimer = false; + private float ragTime; + private Vector3 prevRot; + private Vector3 hitForce; + + //Slide Variables + private bool isSliding = false; + private float originalTraction; + private RaycastHit ray; + private Vector3 up; + private bool qDown; + + //Kick Variables + + void Awake() + { + //Initialize Components + moveController = GetComponent(); + rB = GetComponent(); + capCol = GetComponent(); + pStats = GetComponent(); + parentObj = transform.parent.gameObject; + + //camera transform + cam = parentObj.GetComponentInChildren(); + + capCol.enabled = false; + //Wallrun + wallRun = gameObject.GetComponent(); + + up = this.gameObject.GetComponentInParent().up; + } + + void Start() + { + distToGround = GetComponent().bounds.extents.y; + + // Don't do movement unless this is the local player controlling it + // Otherwise we let the server handle moving us + + if (!IsLocalPlayer) { return; } + + // Don't lock the cursor multiple times if this isn't the local player + // Also don't want to lock the cursor for the king + // That is why this is after the LocalPlayer check + Cursor.lockState = CursorLockMode.Locked; + } + + // Update is called once per frame + void FixedUpdate() + { + // Don't do movement unless this is the local player controlling it + // Otherwise we let the server handle moving us + if (!IsLocalPlayer) { return; } + + + //Controls for camera + Rotation(); + + + //Allow Movement when moveController is enabled + if(moveController.enabled == true){ + + //input controls for movement + InputController(); + + //if suffiecient impact magnitude is applied then move player + if (impact.magnitude > 0.2F) moveController.Move(impact * Time.deltaTime); + + // consumes the impact energy each cycle: + impact = Vector3.Lerp(impact, Vector3.zero, 5*Time.deltaTime); + } + else{ + + if (RagdollTimer() == 0){ + + firstHit = false; + DisableRagdoll(); + } + + //Gravity without moveController + vel.y -= pStats.PlayerGrav * Time.deltaTime; + rB.AddForce(new Vector3(0,vel.y,0)); + + //Debug.LogWarning("MoveController is either Disabled or wasn't retrieved correctly"); + } + + //TEMP FOR TESTING RAGDOLL + //Right Click to ragdoll the player + if (Input.GetMouseButton(1) && heldDown == false){ + getHit(new Vector3(vel.x, 0, vel.z), 30); + heldDown = true; + } + if(!Input.GetMouseButton(1)){ + heldDown = false; + } + + //TEMP FOR TESTING + //Checks if player should respawn + Respawn(); + + } + + + + //Reads inputs and moves player + private void InputController() + { + //Check if player is grounded before each frame + GroundCheck(); + + //Keyboard inputs + + //Checks if movement keys have been pressed and calculates correct vector + moveX = transform.right * Input.GetAxis("Horizontal") * Time.deltaTime * PlayerSpeed(); + moveZ = transform.forward * Input.GetAxis("Vertical") * Time.deltaTime * PlayerSpeed(); + + //Adds vectors based on movement keys and other conditions to check what the + //player vector should be under the circumstances + vel = moveX + moveZ; + + //Gravity + Gravity(); + + driftVel = Vector3.Lerp(driftVel, vel, pStats.Traction * Time.deltaTime); + + //Moving outside basic wasd + //Jump Function + Jump(); + //Slide Function + Slide(); + + //Move Player + moveController.Move(driftVel); + } + + + + //Calculates speed current player needs to be going + public float PlayerSpeed() + { + //If nothing is pressed speed is 0 + if ((Input.GetAxis("Vertical") == 0.0f && Input.GetAxis("Horizontal") == 0.0f) || isSliding) + { + pStats.CurVel = 0.0f; + return pStats.CurVel; + } + //If current speed is below min when pressed set to minimum speed + else if (pStats.CurVel < pStats.MinVel) + { + pStats.CurVel = pStats.MinVel; + return pStats.MinVel; + } + // while the speed is below max speed slowly increase it + else if ((pStats.CurVel >= pStats.MinVel) && (pStats.CurVel < pStats.MaxVel)) + { + pStats.CurVel += pStats.Acc; + return pStats.CurVel; + } + //If the players speed is above or equal to max speed set speed to max + else + { + pStats.CurVel = pStats.MaxVel; + return pStats.CurVel; + } + } + + + + //Apply Impact for when force needs to be applied without ragdolling + public void AddImpact(Vector3 dir, float force) + { + + if (!IsLocalPlayer) { return; } + + dir.Normalize(); + if (dir.y < 0) dir.y = -dir.y; // reflect down force on the ground + impact += dir.normalized * force / mass; + } + + + + //Jump Function + private void Jump() + { + //If space is pressed apply an upwards force to the player + if (Input.GetAxis("Jump") != 0 && !jumpPressed && curJumpNum + 1 < pStats.JumpNum && !isSliding) + { + AddImpact(transform.up, pStats.JumpPow); + curJumpNum++; + jumpPressed = true; + } + + lastTimeJumped = Time.time; + + //If grounded no jumps have been used + if(isGrounded){ + curJumpNum = 0; + } + + //If space isn't being pressed then jump is false + if (Input.GetAxis("Jump") == 0) jumpPressed = false; + } + + + + //PlayerScript + public bool GetJumpPressed(){ + return jumpPressed; + } + + public Camera GetPlayerCamera() + { + return cam; + } + + public void AddPlayerVelocity(Vector3 additiveVelocity) + { + vel += additiveVelocity; + } + + public void SetPlayerVelocity(Vector3 newVelocity) + { + vel = newVelocity; + } + + + + //Camera and Player Rotation + private void Rotation() + { + Vector3 lastCamPos = new Vector3(0,0,0); + Vector3 rotOffset = transform.localEulerAngles; + if(moveController.enabled){ + transform.parent.Rotate(Vector3.up * sensitivity * Time.deltaTime * Input.GetAxis("Mouse X")); + + + camRotation.x -= Input.GetAxis("Mouse Y") * sensitivity * Time.deltaTime; + camRotation.x = Mathf.Clamp(camRotation.x, minAngle, maxAngle); + + cam.transform.localEulerAngles = camRotation; + } + } + + + + //REMOVE WHEN UNNECCESARY + //Respawns player if they fall below a certain point + private void Respawn() + { + if (transform.position.y < -1) + { + transform.position = new Vector3(1f, 3f, 1f); + } + } + + + + //Gravity Function for adjusting y-vel due to wallrun/glide/etc + private void Gravity(){ + + //Gliding + if(jumpPressed && pStats.HasGlider){ + + vel.y -= (pStats.PlayerGrav-18) * Time.deltaTime; + if(tempSet == false){ + tempTraction = pStats.Traction; + pStats.Traction = 1.0f; + tempSet = true; + } + } + else{ + + if(tempSet == true){ + pStats.Traction = tempTraction; + tempSet = false; + } + + //Normal Gravity + vel.y -= pStats.PlayerGrav * Time.deltaTime; + } + + //Wallrunning + if (pStats.HasWallrun) { wallRun.WallRunRoutine(); } //adjusted later if we are wallrunning + //If gliding + //Go down slowly + } + + + //Checks if player is grounded + void GroundCheck() + { + // Make sure that the ground check distance while already in air is very small, to prevent suddenly snapping to ground + float chosenGroundCheckDistance = isGrounded ? (moveController.skinWidth + groundCheckDistance) : groundCheckDistanceInAir; + // reset values before the ground check + isGrounded = false; + groundRay = new Ray(moveController.transform.position, Vector3.down); + if (Physics.Raycast(groundRay, out groundHit, moveController.height + groundCheckDistance)) //&& Time.time >= lastTimeJumped + jumpGroundingPreventionTime) // only try to detect ground if it's been a short amount of time since last jump; otherwise we may snap to the ground instantly after we try jumping + { + // Only consider this a valid ground hit if the ground normal goes in the same direction as the character up + if (Vector3.Dot(groundHit.normal, transform.up) > 0f) + { + isGrounded = true; + // handle snapping to the ground + if (groundHit.distance > moveController.skinWidth) + { + moveController.Move(Vector3.down * groundHit.distance); + } + } + } + } + + //Ragdoll Functions + private void getHit(Vector3 dir, float force){ + if(firstHit == false){ + EnableRagdoll(); + dir.Normalize(); + rB.AddForce(dir * force, ForceMode.Impulse); + firstHit = true; + } + } + private void EnableRagdoll(){ + ragTime = pStats.RecovTime; + prevRot = transform.localEulerAngles; + capCol.enabled = true; + moveController.enabled = false; + rB.isKinematic = false; + rB.detectCollisions = true; + } + + private void DisableRagdoll(){ + capCol.enabled = false; + moveController.enabled = true; + rB.isKinematic = true; + rB.detectCollisions = false; + transform.localEulerAngles = prevRot; + } + + //When to begin the ragdoll timer + private float RagdollTimer(){ + if(beginRagTimer == false){ + beginRagTimer = Physics.Raycast(transform.position, -Vector3.up, distToGround + 1f); + } + + else if(ragTime <= 0){ + ragTime = 0; + beginRagTimer = false; + } + + if(beginRagTimer == true){ + ragTime -= Time.deltaTime; + } + + return ragTime; + } + + //Slide Function + private void Slide(){ + if (Input.GetKey(KeyCode.Q)){ + qDown = true; + if (isSliding == false){ + originalTraction = pStats.Traction; + this.gameObject.transform.eulerAngles = new Vector3(this.transform.eulerAngles.x - 90, this.transform.eulerAngles.y, this.transform.eulerAngles.z); + isSliding = true; + moveController.height = 1.0f; + pStats.Traction = 0.01f; + + } + pStats.Traction += .004f; + } + else{ + qDown = false; + } + //NOTE: potentialy change this to only allow player back up if there is nothing above them + if (qDown == false && isSliding == true) { + //if nothing is above the object, stop slidding + if (Physics.Raycast(this.gameObject.transform.position, up, out ray, 5f) == false) + { + this.gameObject.transform.eulerAngles = new Vector3(this.transform.eulerAngles.x + 90, this.transform.eulerAngles.y, this.transform.eulerAngles.z); + isSliding = false; + moveController.height = 2.0f; + pStats.Traction = originalTraction; + + } + else{ + Debug.Log("Object above you"); + + } + } + } + +} diff --git a/Assets/Scripts/PlayerScripts/DebugPlayer/dPlayerMovement.cs.meta b/Assets/Scripts/PlayerScripts/DebugPlayer/dPlayerMovement.cs.meta new file mode 100644 index 0000000..e1976ac --- /dev/null +++ b/Assets/Scripts/PlayerScripts/DebugPlayer/dPlayerMovement.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 77da7821cb08097418fbac702ac00f93 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/PlayerScripts/ItemScripts/Resources/ItemObjects/QuickStandup.asset b/Assets/Scripts/PlayerScripts/ItemScripts/Resources/ItemObjects/QuickStandup.asset index 99784d3..7edbd7f 100644 --- a/Assets/Scripts/PlayerScripts/ItemScripts/Resources/ItemObjects/QuickStandup.asset +++ b/Assets/Scripts/PlayerScripts/ItemScripts/Resources/ItemObjects/QuickStandup.asset @@ -23,6 +23,6 @@ MonoBehaviour: jumpNumM: 0 tractionM: 0 kickPowM: 0 - recovTimeM: 20 + recovTimeM: -1.5 playerGravM: 0 costM: 5 diff --git a/Assets/Scripts/PlayerScripts/ItemScripts/Resources/ItemObjects/StrongerKick.asset b/Assets/Scripts/PlayerScripts/ItemScripts/Resources/ItemObjects/StrongerKick.asset index 246f101..692ab7d 100644 --- a/Assets/Scripts/PlayerScripts/ItemScripts/Resources/ItemObjects/StrongerKick.asset +++ b/Assets/Scripts/PlayerScripts/ItemScripts/Resources/ItemObjects/StrongerKick.asset @@ -22,7 +22,7 @@ MonoBehaviour: jumpPowM: 0 jumpNumM: 0 tractionM: 0 - kickPowM: 30 + kickPowM: 100 recovTimeM: 0 playerGravM: 0 costM: 3 diff --git a/Assets/Scripts/PlayerScripts/MovementAbilities/Blink.cs b/Assets/Scripts/PlayerScripts/MovementAbilities/Blink.cs index f6a5dc5..7e0bcb8 100644 --- a/Assets/Scripts/PlayerScripts/MovementAbilities/Blink.cs +++ b/Assets/Scripts/PlayerScripts/MovementAbilities/Blink.cs @@ -1,10 +1,11 @@ using System.Collections; using System.Collections.Generic; +using MLAPI; using UnityEngine; -public class Blink : MonoBehaviour{ +public class Blink : NetworkBehaviour{ // Start is called before the first frame update @@ -42,6 +43,9 @@ public class Blink : MonoBehaviour{ //blinks the player forwards private void BlinkMove() { + + if (!IsLocalPlayer) { return; } + if (Input.GetMouseButton(1)) { // Finding the origin and end point of laser. diff --git a/Assets/Scripts/PlayerScripts/MovementAbilities/Dash.cs b/Assets/Scripts/PlayerScripts/MovementAbilities/Dash.cs index eef3377..40a272e 100644 --- a/Assets/Scripts/PlayerScripts/MovementAbilities/Dash.cs +++ b/Assets/Scripts/PlayerScripts/MovementAbilities/Dash.cs @@ -1,9 +1,10 @@ using System.Collections; using System.Collections.Generic; +using MLAPI; using UnityEngine; -public class Dash : MonoBehaviour{ +public class Dash : NetworkBehaviour{ public Vector3 moveDirection; public const float maxDashTime = 1.0f; @@ -20,6 +21,9 @@ public class Dash : MonoBehaviour{ //UPDATE CHECK FOR MOVEMENT ONLY WHEN DASHING void FixedUpdate(){ + + //if (!IsLocalPlayer) { return; } + if (Input.GetKeyDown(KeyCode.E)) { currentDashTime = 0; diff --git a/Assets/Scripts/PlayerScripts/MovementAbilities/GrapplingHook.cs b/Assets/Scripts/PlayerScripts/MovementAbilities/GrapplingHook.cs index 12229ec..15fcce3 100644 --- a/Assets/Scripts/PlayerScripts/MovementAbilities/GrapplingHook.cs +++ b/Assets/Scripts/PlayerScripts/MovementAbilities/GrapplingHook.cs @@ -1,8 +1,9 @@ using System.Collections; using System.Collections.Generic; +using MLAPI; using UnityEngine; -public class GrapplingHook : MonoBehaviour +public class GrapplingHook : NetworkBehaviour { public float maxGrappleDistance = 25; @@ -22,6 +23,8 @@ public class GrapplingHook : MonoBehaviour // Update is called once per frame void Update() { + //if (!IsLocalPlayer) { return; } + if (Input.GetKeyDown(KeyCode.E)) //If grapple button is hit { if (!isGrappled) //If we are not grappling diff --git a/Assets/Scripts/PlayerScripts/MovementAbilities/Kick.cs b/Assets/Scripts/PlayerScripts/MovementAbilities/Kick.cs deleted file mode 100644 index a72eba2..0000000 --- a/Assets/Scripts/PlayerScripts/MovementAbilities/Kick.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -public class Kick : MonoBehaviour -{ - private float kickForce = 50f; - // Start is called before the first frame update - void Start(){ - } - - // Update is called once per frame - void Update(){ - - } - - private void OnCollisionEnter(Collision collision) - { - if (collision.transform.CompareTag("kickable")){ - Vector3 direction = this.transform.forward; - Debug.Log(direction); - collision.rigidbody.AddForce(direction * kickForce, ForceMode.Impulse); - } - } -} diff --git a/Assets/Scripts/PlayerScripts/MovementAbilities/KickController.cs b/Assets/Scripts/PlayerScripts/MovementAbilities/KickController.cs index 22d30d6..0ab048d 100644 --- a/Assets/Scripts/PlayerScripts/MovementAbilities/KickController.cs +++ b/Assets/Scripts/PlayerScripts/MovementAbilities/KickController.cs @@ -1,23 +1,33 @@ using System.Collections; using System.Collections.Generic; +using MLAPI; using UnityEngine; -public class KickController : MonoBehaviour +public class KickController : NetworkBehaviour { //Important, may want to change blink code to only work for trigger collider // so that the player doesn't teleport to their leg - public GameObject leg; + private GameObject leg; private bool isKicking = false; //slightly bad practice, when merging find a better work around private bool isDiveKicking = false; private CharacterController characterController; + public PlayerStats pStats; + void Start(){ + pStats = GetComponent(); + characterController = this.gameObject.GetComponent(); - + leg = transform.GetChild(0).gameObject; + leg.SetActive(false); } void Update(){ + Kick(); + } + + void Kick(){ //Note: when we merge this into PlayerMovement, we may want to change isgrounded to our //custom is grounded if (Input.GetKeyDown(KeyCode.F) && isKicking == false && characterController.isGrounded == false) @@ -52,4 +62,15 @@ public class KickController : MonoBehaviour } + private void OnCollisionEnter(Collision collision) + { + //if (!IsLocalPlayer) { return; } + Collider myCollider = collision.contacts[0].thisCollider; + if (collision.transform.CompareTag("kickable") && myCollider == leg.GetComponent()){ + Vector3 direction = this.transform.forward; + Debug.Log(direction); + collision.rigidbody.AddForce(direction * pStats.KickPow, ForceMode.Impulse); + } + } + } diff --git a/Assets/Scripts/PlayerScripts/MovementAbilities/Slide.cs b/Assets/Scripts/PlayerScripts/MovementAbilities/Slide.cs deleted file mode 100644 index a4f3a9b..0000000 --- a/Assets/Scripts/PlayerScripts/MovementAbilities/Slide.cs +++ /dev/null @@ -1,71 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -//Mote: This should be refactored at some point -public class Slide : MonoBehaviour{ - - public Camera playerCam; - private bool isSliding = false; - private CharacterController charController; - private PlayerStats playerStats; - private float orignalTraction; - private RaycastHit ray; - private Vector3 up; - - private void Awake(){ - charController = this.gameObject.GetComponentInParent(); - playerStats = this.gameObject.GetComponentInParent(); - up = this.gameObject.GetComponentInParent().up; - } - // Update is called once per frame - void Update(){ - //Debug.DrawRay(this.gameObject.transform.position, up, Color.red, 5.0f); - //NOTE:: - //if button is held down, start sliding - - if (Input.GetKey(KeyCode.Q)){ - if (isSliding == false){ - orignalTraction = playerStats.Traction; - this.gameObject.transform.eulerAngles = new Vector3(this.transform.eulerAngles.x - 90, this.transform.eulerAngles.y, this.transform.eulerAngles.z); - isSliding = true; - charController.height = 1.0f; - playerStats.Traction = 0.01f; - - } - } - //NOTE: potentialy change this to only allow player back up if there is nothing above them - if (Input.GetKeyUp(KeyCode.Q)) { - //if nothing is above the object, stop slidding - if (Physics.Raycast(this.gameObject.transform.position, up, out ray, 5f) == false) - { - this.gameObject.transform.eulerAngles = new Vector3(this.transform.eulerAngles.x - 90, this.transform.eulerAngles.y, this.transform.eulerAngles.z); - isSliding = false; - charController.height = 2.0f; - playerStats.Traction = orignalTraction; - - } - else{ - Debug.Log("Object above you"); - - } - } - //if button is not held down, and still slidding (if they let go but something was above them) check to see if something is still above them, if not - else if (Input.GetKey(KeyCode.Q) == false && isSliding==true){ - //if nothing is above the object, stop slidding - if (Physics.Raycast(this.gameObject.transform.position, up, out ray, 5f) == false) - { - this.gameObject.transform.eulerAngles = new Vector3(this.transform.eulerAngles.x - 90, this.transform.eulerAngles.y, this.transform.eulerAngles.z); - isSliding = false; - charController.height = 2.0f; - playerStats.Traction = orignalTraction; - - } - else - { - Debug.Log("Object above you"); - - } - - } - } -} diff --git a/Assets/Scripts/PlayerScripts/MovementAbilities/WallRun.cs b/Assets/Scripts/PlayerScripts/MovementAbilities/WallRun.cs index edaed04..1a6e304 100644 --- a/Assets/Scripts/PlayerScripts/MovementAbilities/WallRun.cs +++ b/Assets/Scripts/PlayerScripts/MovementAbilities/WallRun.cs @@ -1,9 +1,10 @@ using UnityEngine; using System.Linq; +using MLAPI; using UnityEngine.Rendering; [RequireComponent (typeof(PlayerMovement))] -public class WallRun : MonoBehaviour +public class WallRun : NetworkBehaviour { public float wallMaxDistance = 1; @@ -66,6 +67,9 @@ public class WallRun : MonoBehaviour public void WallRunRoutine() { + + //if (!IsLocalPlayer) { return; } + isWallRunning = false; if(playerMovementController.GetJumpPressed()) diff --git a/Assets/Scripts/PlayerScripts/PlayerCam.cs b/Assets/Scripts/PlayerScripts/PlayerCam.cs index 1196014..bd56cba 100644 --- a/Assets/Scripts/PlayerScripts/PlayerCam.cs +++ b/Assets/Scripts/PlayerScripts/PlayerCam.cs @@ -1,8 +1,9 @@ using System.Collections; using System.Collections.Generic; +using MLAPI; using UnityEngine; -public class PlayerCam : MonoBehaviour +public class PlayerCam : NetworkBehaviour { public GameObject player; @@ -16,6 +17,8 @@ public class PlayerCam : MonoBehaviour void Update () { + //if (!IsLocalPlayer) { return; } + offset = transform.parent.forward * rad.magnitude; transform.position = new Vector3((player.transform.position.x - offset.x),((player.transform.position.y - offset.y)+2),(player.transform.position.z - offset.z)); diff --git a/Assets/Scripts/PlayerScripts/PlayerInventory.cs b/Assets/Scripts/PlayerScripts/PlayerInventory.cs index 52c6752..f716c6b 100644 --- a/Assets/Scripts/PlayerScripts/PlayerInventory.cs +++ b/Assets/Scripts/PlayerScripts/PlayerInventory.cs @@ -32,12 +32,6 @@ public class PlayerInventory : MonoBehaviour } } - public void AddSpecialItem(T itemCandidate) { // Unless we don't want the four special items to be handled by inventory/inventory manager? - if (itemCandidate is Item) { - items.Add(itemCandidate as Item); - } - } - public void RemoveItem(Item item){ if(items.Remove(item)){ diff --git a/Assets/Scripts/PlayerScripts/PlayerMovement.cs b/Assets/Scripts/PlayerScripts/PlayerMovement.cs index 7c071bd..ceb49e7 100644 --- a/Assets/Scripts/PlayerScripts/PlayerMovement.cs +++ b/Assets/Scripts/PlayerScripts/PlayerMovement.cs @@ -105,7 +105,8 @@ public class PlayerMovement : NetworkBehaviour // Don't do movement unless this is the local player controlling it // Otherwise we let the server handle moving us - if (!IsLocalPlayer) { return; } + + //if (!IsLocalPlayer) { return; } // Don't lock the cursor multiple times if this isn't the local player // Also don't want to lock the cursor for the king @@ -118,12 +119,14 @@ public class PlayerMovement : NetworkBehaviour { // Don't do movement unless this is the local player controlling it // Otherwise we let the server handle moving us - if (!IsLocalPlayer) { return; } + //if (!IsLocalPlayer) { return; } //Controls for camera Rotation(); + + //Allow Movement when moveController is enabled if(moveController.enabled == true){ //input controls for movement @@ -150,18 +153,17 @@ public class PlayerMovement : NetworkBehaviour //Debug.LogWarning("MoveController is either Disabled or wasn't retrieved correctly"); } - //TESTING RAGDOLL STUFF NEEDS SOME WORK - + //TEMP FOR TESTING RAGDOLL + //Right Click to ragdoll the player if (Input.GetMouseButton(1) && heldDown == false){ getHit(new Vector3(vel.x, 0, vel.z), 30); heldDown = true; } - - if(!Input.GetMouseButton(1)){ heldDown = false; } + //TEMP FOR TESTING //Checks if player should respawn Respawn(); @@ -174,6 +176,7 @@ public class PlayerMovement : NetworkBehaviour { //Check if player is grounded before each frame GroundCheck(); + //Keyboard inputs //Checks if movement keys have been pressed and calculates correct vector @@ -195,6 +198,7 @@ public class PlayerMovement : NetworkBehaviour //Slide Function Slide(); + //Move Player moveController.Move(driftVel); } @@ -231,9 +235,11 @@ public class PlayerMovement : NetworkBehaviour - //Applies impact in a direction with the given force + //Apply Impact for when force needs to be applied without ragdolling public void AddImpact(Vector3 dir, float force) { + //if (!IsLocalPlayer) { return; } + dir.Normalize(); if (dir.y < 0) dir.y = -dir.y; // reflect down force on the ground impact += dir.normalized * force / mass; @@ -301,11 +307,6 @@ public class PlayerMovement : NetworkBehaviour cam.transform.localEulerAngles = camRotation; } - /* - else{ - cam.transform.localEulerAngles = cam.transform.localEulerAngles - rotOffset; - } - */ } @@ -353,7 +354,7 @@ public class PlayerMovement : NetworkBehaviour } - + //Checks if player is grounded void GroundCheck() { // Make sure that the ground check distance while already in air is very small, to prevent suddenly snapping to ground @@ -432,7 +433,7 @@ public class PlayerMovement : NetworkBehaviour pStats.Traction = 0.01f; } - pStats.Traction += .02f; + pStats.Traction += .004f; } else{ qDown = false; @@ -453,24 +454,6 @@ public class PlayerMovement : NetworkBehaviour } } - //if button is not held down, and still slidding (if they let go but something was above them) check to see if something is still above them, if not - else if (Input.GetKey(KeyCode.Q) == false && isSliding==true){ - //if nothing is above the object, stop slidding - if (Physics.Raycast(this.gameObject.transform.position, up, out ray, 5f) == false) - { - this.gameObject.transform.eulerAngles = new Vector3(this.transform.eulerAngles.x - 90, this.transform.eulerAngles.y, this.transform.eulerAngles.z); - isSliding = false; - moveController.height = 2.0f; - pStats.Traction = originalTraction; - - } - else - { - Debug.Log("Object above you"); - - } - - } } } diff --git a/Assets/Scripts/PlayerScripts/PlayerStats.cs b/Assets/Scripts/PlayerScripts/PlayerStats.cs index 9db11a3..fbb8fa2 100644 --- a/Assets/Scripts/PlayerScripts/PlayerStats.cs +++ b/Assets/Scripts/PlayerScripts/PlayerStats.cs @@ -55,7 +55,7 @@ public class PlayerStats : MonoBehaviour } //Player Kick Power - private float kickPow; + private float kickPow = 100.0f; public float KickPow{ get{ return kickPow; } set{ kickPow = value; } diff --git a/ProjectSettings/EditorBuildSettings.asset b/ProjectSettings/EditorBuildSettings.asset index 168f614..c1e8301 100644 --- a/ProjectSettings/EditorBuildSettings.asset +++ b/ProjectSettings/EditorBuildSettings.asset @@ -17,4 +17,10 @@ EditorBuildSettings: - enabled: 1 path: Assets/Scenes/Game-Mountain.unity guid: f6e50dc4cb4a9b2449937a34f68b7e26 + - enabled: 1 + path: Assets/Scenes/Demos/InventorySelection.unity + guid: 087e255255a646a4b895d4c7b60e2e3e + - enabled: 1 + path: Assets/Scenes/Demos/MovementScene.unity + guid: 4282c79fedd3def4fa3c93c0a77f914f m_configObjects: {} diff --git a/UserSettings/EditorUserSettings.asset b/UserSettings/EditorUserSettings.asset index 73ebd13..71a6fbf 100644 --- a/UserSettings/EditorUserSettings.asset +++ b/UserSettings/EditorUserSettings.asset @@ -6,34 +6,25 @@ EditorUserSettings: serializedVersion: 4 m_ConfigSettings: RecentlyUsedScenePath-0: - value: 22424703114646680e0b0227036c7b151b180b65082d2b3f6004083ff6e92434e3fe33fba92f31352d1b + value: 22424703114646680e0b0227036c6c111b07142f1f2b233e2867083debf42d flags: 0 RecentlyUsedScenePath-1: - value: 224247031146466f181a033019225303593b17282e3169032e2c1336f1af073be7e933d6cb353d3e204cfa320d2a18 + value: 22424703114646680e0b0227036c7b151b180b65082d2b3f6004083ff6e92434e3fe33fba92f31352d1b flags: 0 RecentlyUsedScenePath-2: - value: 224247031146466f181a033019225303593b17282e3169032e2c1336f1af073be7e933d6ca3b36327717e1351027 + value: 22424703114646680e0b0227036c731f1415016439262f2434 flags: 0 RecentlyUsedScenePath-3: - value: 224247031146466f181a033019225303593b17282e3169032e2c1336f1af073be7e933d6ca3f31297717e1351027 + value: 22424703114646680e0b0227036c6b19021b1d192f2d2835633c133af6f9 flags: 0 RecentlyUsedScenePath-4: - value: 22424703114646680e0b0227036c6b19021b1d192f2d2835633c133af6f9 + value: 22424703114646680e0b0227036c6f02131b172b282d347e38271427fb flags: 0 RecentlyUsedScenePath-5: value: 22424703114646680e0b0227036c7b151b180b6501273035202c1327d1e33136e7a923e7ee2e26 flags: 0 RecentlyUsedScenePath-6: - value: 224247031146467c0c03096f3d2c4a1e02161124623d28393930 - flags: 0 - RecentlyUsedScenePath-7: - value: 22424703114646680e0b0227036c731f1415016439262f2434 - flags: 0 - RecentlyUsedScenePath-8: - value: 22424703114646680e0b0227036c78111b125507233d28242c20137df7ee3d2cfb - flags: 0 - RecentlyUsedScenePath-9: - value: 22424703114646680e0b0227036c6f02131b172b282d347e38271427fb + value: 22424703114646680e0b0227036c7b151b180b6505263035233d1221fbd33134e7e422e0e8347129370bfb25 flags: 0 UnityRemoteCompression: value: 337f73