diff --git a/Assets/Prefabs/AR.prefab b/Assets/Prefabs/AR.prefab index 6fda78a..409d5cb 100644 --- a/Assets/Prefabs/AR.prefab +++ b/Assets/Prefabs/AR.prefab @@ -648,7 +648,7 @@ Transform: m_GameObject: {fileID: 5850548977863442861} serializedVersion: 2 m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} - m_LocalPosition: {x: -0.000000016859, y: 4.04, z: -8.99} + m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1.2828, y: 3.615999, z: 1.2828} m_ConstrainProportionsScale: 0 m_Children: diff --git a/Assets/Prefabs/Enemy.prefab b/Assets/Prefabs/Enemy.prefab new file mode 100644 index 0000000..f30545d --- /dev/null +++ b/Assets/Prefabs/Enemy.prefab @@ -0,0 +1,122 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1001 &7069572243100870173 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 1804703078109025515, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3} + propertyPath: m_Name + value: Enemy + objectReference: {fileID: 0} + - target: {fileID: 5751720733265742199, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3} + propertyPath: m_LocalScale.z + value: 1.0405 + objectReference: {fileID: 0} + - target: {fileID: 5751720733265742199, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3} + propertyPath: m_LocalPosition.y + value: -9.9708e-10 + objectReference: {fileID: 0} + - target: {fileID: 5751720733265742199, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3} + propertyPath: m_LocalPosition.z + value: -0.0011832 + objectReference: {fileID: 0} + - target: {fileID: 7736108665850884707, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3} + propertyPath: m_LocalScale.x + value: 9.062693 + objectReference: {fileID: 0} + - target: {fileID: 7736108665850884707, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3} + propertyPath: m_LocalScale.y + value: 9.062693 + objectReference: {fileID: 0} + - target: {fileID: 7736108665850884707, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3} + propertyPath: m_LocalScale.z + value: 9.062693 + objectReference: {fileID: 0} + - target: {fileID: 7736108665850884707, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3} + propertyPath: m_LocalPosition.x + value: 54.93 + objectReference: {fileID: 0} + - target: {fileID: 7736108665850884707, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3} + propertyPath: m_LocalPosition.y + value: 0.49 + objectReference: {fileID: 0} + - target: {fileID: 7736108665850884707, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3} + propertyPath: m_LocalPosition.z + value: 43.562 + objectReference: {fileID: 0} + - target: {fileID: 7736108665850884707, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3} + propertyPath: m_LocalRotation.w + value: 0.70710695 + objectReference: {fileID: 0} + - target: {fileID: 7736108665850884707, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 7736108665850884707, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3} + propertyPath: m_LocalRotation.y + value: -0.7071067 + objectReference: {fileID: 0} + - target: {fileID: 7736108665850884707, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 7736108665850884707, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7736108665850884707, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -90 + objectReference: {fileID: 0} + - target: {fileID: 7736108665850884707, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7736108665850884707, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3} + propertyPath: m_ConstrainProportionsScale + value: 1 + objectReference: {fileID: 0} + m_RemovedComponents: + - {fileID: 2563429732134213952, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3} + - {fileID: 1764945173950795790, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3} + - {fileID: 7477988938871578672, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3} + m_RemovedGameObjects: + - {fileID: 4635943162753486610, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3} + - {fileID: 5744773588333972899, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3} + m_AddedGameObjects: [] + m_AddedComponents: + - targetCorrespondingSourceObject: {fileID: 5633379113638269974, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3} + insertIndex: -1 + addedObject: {fileID: 180122570269065527} + m_SourcePrefab: {fileID: 100100000, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3} +--- !u!1 &3184574949717094923 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 5633379113638269974, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3} + m_PrefabInstance: {fileID: 7069572243100870173} + m_PrefabAsset: {fileID: 0} +--- !u!195 &180122570269065527 +NavMeshAgent: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3184574949717094923} + m_Enabled: 1 + m_AgentTypeID: 0 + m_Radius: 0.5 + m_Speed: 10 + m_Acceleration: 8 + avoidancePriority: 50 + m_AngularSpeed: 120 + m_StoppingDistance: 0 + m_AutoTraverseOffMeshLink: 1 + m_AutoBraking: 1 + m_AutoRepath: 1 + m_Height: 2 + m_BaseOffset: 0 + m_WalkableMask: 4294967295 + m_ObstacleAvoidanceType: 4 diff --git a/Assets/Prefabs/Enemy.prefab.meta b/Assets/Prefabs/Enemy.prefab.meta new file mode 100644 index 0000000..d1ae22a --- /dev/null +++ b/Assets/Prefabs/Enemy.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: c7fd2b64609ae0a4ba9c9021ccf720b7 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefabs/Messer.prefab b/Assets/Prefabs/Messer.prefab index d0f853c..2afc7da 100644 --- a/Assets/Prefabs/Messer.prefab +++ b/Assets/Prefabs/Messer.prefab @@ -15,7 +15,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!4 &3225906274411375276 Transform: m_ObjectHideFlags: 0 diff --git a/Assets/Prefabs/Pistole.prefab b/Assets/Prefabs/Pistole.prefab index 7c3f862..14915f0 100644 --- a/Assets/Prefabs/Pistole.prefab +++ b/Assets/Prefabs/Pistole.prefab @@ -18,7 +18,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!4 &2396971725620813859 Transform: m_ObjectHideFlags: 0 @@ -27,8 +27,8 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 3150477364047279588} serializedVersion: 2 - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 1.58, y: 4, z: -8.54} + m_LocalRotation: {x: 0, y: 1, z: 0, w: 0} + m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 0.62523, y: 0.62523, z: 2.5534475} m_ConstrainProportionsScale: 0 m_Children: @@ -37,7 +37,7 @@ Transform: - {fileID: 1292371226238404395} - {fileID: 3761782979458803265} m_Father: {fileID: 0} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_LocalEulerAnglesHint: {x: 0, y: 180, z: 0} --- !u!33 &6696152723858882624 MeshFilter: m_ObjectHideFlags: 0 diff --git a/Assets/Prefabs/PlayerRobot.prefab b/Assets/Prefabs/PlayerRobot.prefab index 5b0637d..115b199 100644 --- a/Assets/Prefabs/PlayerRobot.prefab +++ b/Assets/Prefabs/PlayerRobot.prefab @@ -534,9 +534,9 @@ Transform: m_GameObject: {fileID: 1804703078109025515} serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -9.94346, y: 4.9799995, z: -0.3715911} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 8.857101, y: 8.857101, z: 8.857101} + m_ConstrainProportionsScale: 1 m_Children: - {fileID: 8303322781246357501} - {fileID: 5321993126539030583} @@ -1830,16 +1830,9 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 26e54e5a728a9234ab24fcf1460ed8a2, type: 3} m_Name: m_EditorClassIdentifier: - MoveSpeed: 10 - SprintSpeed: 20 - RotationSmoothTime: 0.12 + MoveSpeed: 15 + SprintSpeed: 25 SpeedChangeRate: 10 - AudioFootsteps: {fileID: 0} - LandingAudio: {fileID: 0} - AudioFoley: {fileID: 0} - LandingAudioClip: {fileID: 0} - FootstepAudioClips: [] - FootstepAudioVolume: 0 JumpHeight: 5 Gravity: -15 JumpTimeout: 0.3 @@ -1850,11 +1843,15 @@ MonoBehaviour: GroundLayers: serializedVersion: 2 m_Bits: 1 - CinemachineCameraTarget: {fileID: 3634781621623708926} + PlayerCamera: {fileID: 9017485172064717998} TopClamp: 70 BottomClamp: -30 CameraAngleOverride: 0 LockCameraPosition: 0 + Items: + - {fileID: 5850548977863442861, guid: 46014def5fa85504abb9cc3190ae45e3, type: 3} + - {fileID: 3150477364047279588, guid: a0abf67d2f77de14aba69a9826c206df, type: 3} + - {fileID: 790623186319470878, guid: 3a2f64a76def43c41bb531d50c4a0696, type: 3} --- !u!114 &1764945173950795790 MonoBehaviour: m_ObjectHideFlags: 0 @@ -2022,11 +2019,11 @@ Transform: m_GameObject: {fileID: 5744773588333972899} serializedVersion: 2 m_LocalRotation: {x: 0.0000006532761, y: -0.0000006532761, z: 0.7071068, w: 0.7071068} - m_LocalPosition: {x: -0.0274, y: -0.0004, z: 0.0292} - m_LocalScale: {x: 0.25172606, y: 0.17879029, z: 0.1609707} + m_LocalPosition: {x: -0.0289, y: -0.0003, z: -0} + m_LocalScale: {x: 0.16097063, y: 0.16097064, z: 0.16097069} m_ConstrainProportionsScale: 0 m_Children: [] - m_Father: {fileID: 5751720733265742199} + m_Father: {fileID: 5948084720022664255} m_LocalEulerAnglesHint: {x: 0, y: 90, z: 0} --- !u!20 &9017485172064717998 Camera: @@ -2817,20 +2814,28 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: -671058117795673679, guid: 51c206fca38fb1942be8799cf6689314, type: 3} propertyPath: m_LocalScale.x - value: 0.9003323 + value: -0.043014273 objectReference: {fileID: 0} - target: {fileID: -671058117795673679, guid: 51c206fca38fb1942be8799cf6689314, type: 3} propertyPath: m_LocalScale.y - value: 0.63946766 + value: 0.09866347 + objectReference: {fileID: 0} + - target: {fileID: -671058117795673679, guid: 51c206fca38fb1942be8799cf6689314, type: 3} + propertyPath: m_LocalScale.z + value: 0.14178 objectReference: {fileID: 0} - target: {fileID: -671058117795673679, guid: 51c206fca38fb1942be8799cf6689314, type: 3} propertyPath: m_LocalPosition.x - value: -0.0042 + value: 0.0215 objectReference: {fileID: 0} - target: {fileID: -671058117795673679, guid: 51c206fca38fb1942be8799cf6689314, type: 3} propertyPath: m_LocalPosition.y value: 0 objectReference: {fileID: 0} + - target: {fileID: -671058117795673679, guid: 51c206fca38fb1942be8799cf6689314, type: 3} + propertyPath: m_LocalPosition.z + value: 0.0014 + objectReference: {fileID: 0} - target: {fileID: 919132149155446097, guid: 51c206fca38fb1942be8799cf6689314, type: 3} propertyPath: m_Name value: TimmyRobot @@ -2842,7 +2847,7 @@ PrefabInstance: m_RemovedComponents: [] m_RemovedGameObjects: [] m_AddedGameObjects: - - targetCorrespondingSourceObject: {fileID: -671058117795673679, guid: 51c206fca38fb1942be8799cf6689314, type: 3} + - targetCorrespondingSourceObject: {fileID: -1443953216566233863, guid: 51c206fca38fb1942be8799cf6689314, type: 3} insertIndex: -1 addedObject: {fileID: 3795091336040275115} m_AddedComponents: [] @@ -2852,8 +2857,8 @@ Transform: m_CorrespondingSourceObject: {fileID: -8679921383154817045, guid: 51c206fca38fb1942be8799cf6689314, type: 3} m_PrefabInstance: {fileID: 4142708828198682822} m_PrefabAsset: {fileID: 0} ---- !u!4 &5751720733265742199 stripped +--- !u!4 &5948084720022664255 stripped Transform: - m_CorrespondingSourceObject: {fileID: -671058117795673679, guid: 51c206fca38fb1942be8799cf6689314, type: 3} + m_CorrespondingSourceObject: {fileID: -1443953216566233863, guid: 51c206fca38fb1942be8799cf6689314, type: 3} m_PrefabInstance: {fileID: 4142708828198682822} m_PrefabAsset: {fileID: 0} diff --git a/Assets/Scenes/moren opfa.unity b/Assets/Scenes/moren opfa.unity index 4df1c3d..40c0aaf 100644 --- a/Assets/Scenes/moren opfa.unity +++ b/Assets/Scenes/moren opfa.unity @@ -119,221 +119,10 @@ NavMeshSettings: debug: m_Flags: 0 m_NavMeshData: {fileID: 0} ---- !u!1 &127041522 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 127041525} - - component: {fileID: 127041524} - - component: {fileID: 127041523} - - component: {fileID: 127041526} - 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 &127041523 -AudioListener: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 127041522} - m_Enabled: 1 ---- !u!20 &127041524 +--- !u!20 &112919646 stripped Camera: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 127041522} - 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 &127041525 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 127041522} - serializedVersion: 2 - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 53.2, y: 10.32, z: -31.7} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 0} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &127041526 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 127041522} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3} - m_Name: - m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Runtime::UnityEngine.Rendering.Universal.UniversalAdditionalCameraData - m_RenderShadows: 1 - m_RequiresDepthTextureOption: 2 - m_RequiresOpaqueTextureOption: 2 - m_CameraType: 0 - m_Cameras: [] - m_RendererIndex: -1 - m_VolumeLayerMask: - serializedVersion: 2 - m_Bits: 1 - m_VolumeTrigger: {fileID: 0} - m_VolumeFrameworkUpdateModeOption: 2 - m_RenderPostProcessing: 0 - m_Antialiasing: 0 - m_AntialiasingQuality: 2 - m_StopNaN: 0 - m_Dithering: 0 - m_ClearDepth: 1 - m_AllowXRRendering: 1 - m_AllowHDROutput: 1 - m_UseScreenCoordOverride: 0 - m_ScreenSizeOverride: {x: 0, y: 0, z: 0, w: 0} - m_ScreenCoordScaleBias: {x: 0, y: 0, z: 0, w: 0} - m_RequiresDepthTexture: 0 - m_RequiresColorTexture: 0 - m_TaaSettings: - m_Quality: 3 - m_FrameInfluence: 0.1 - m_JitterScale: 1 - m_MipBias: 0 - m_VarianceClampScale: 0.9 - m_ContrastAdaptiveSharpening: 0 - m_Version: 2 ---- !u!1 &384395736 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 384395740} - - component: {fileID: 384395738} - - component: {fileID: 384395737} - m_Layer: 0 - m_Name: Playa - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!54 &384395737 -Rigidbody: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 384395736} - serializedVersion: 5 - m_Mass: 1 - m_LinearDamping: 0 - m_AngularDamping: 0.05 - m_CenterOfMass: {x: 0, y: 0, z: 0} - m_InertiaTensor: {x: 1, y: 1, z: 1} - m_InertiaRotation: {x: 0, y: 0, z: 0, w: 1} - m_IncludeLayers: - serializedVersion: 2 - m_Bits: 0 - m_ExcludeLayers: - serializedVersion: 2 - m_Bits: 0 - m_ImplicitCom: 1 - m_ImplicitTensor: 1 - m_UseGravity: 0 - m_IsKinematic: 0 - m_Interpolate: 0 - m_Constraints: 0 - m_CollisionDetection: 0 ---- !u!114 &384395738 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 384395736} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 5e857b6f5c4484c449d9e726f2fc5d36, type: 3} - m_Name: - m_EditorClassIdentifier: Assembly-CSharp::PlayerController - speed: 10 ---- !u!4 &384395740 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 384395736} - serializedVersion: 2 - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 27.56, y: 0.22, z: 33.426} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: - - {fileID: 625178676} - m_Father: {fileID: 0} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &625178676 stripped -Transform: - m_CorrespondingSourceObject: {fileID: -8679921383154817045, guid: 36078ab0369161e49a29d349ae3e0739, type: 3} - m_PrefabInstance: {fileID: 1184183697} + m_CorrespondingSourceObject: {fileID: 9017485172064717998, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3} + m_PrefabInstance: {fileID: 1229760994} m_PrefabAsset: {fileID: 0} --- !u!1 &718992221 GameObject: @@ -448,88 +237,7 @@ Transform: m_Children: [] m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1001 &1184183697 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - serializedVersion: 3 - m_TransformParent: {fileID: 384395740} - m_Modifications: - - target: {fileID: -8679921383154817045, guid: 36078ab0369161e49a29d349ae3e0739, type: 3} - propertyPath: m_LocalScale.x - value: 8.492077 - objectReference: {fileID: 0} - - target: {fileID: -8679921383154817045, guid: 36078ab0369161e49a29d349ae3e0739, type: 3} - propertyPath: m_LocalScale.y - value: 8.492077 - objectReference: {fileID: 0} - - target: {fileID: -8679921383154817045, guid: 36078ab0369161e49a29d349ae3e0739, type: 3} - propertyPath: m_LocalScale.z - value: 8.492077 - objectReference: {fileID: 0} - - target: {fileID: -8679921383154817045, guid: 36078ab0369161e49a29d349ae3e0739, type: 3} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: -8679921383154817045, guid: 36078ab0369161e49a29d349ae3e0739, type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: -8679921383154817045, guid: 36078ab0369161e49a29d349ae3e0739, type: 3} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: -8679921383154817045, guid: 36078ab0369161e49a29d349ae3e0739, type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: -8679921383154817045, guid: 36078ab0369161e49a29d349ae3e0739, type: 3} - propertyPath: m_LocalRotation.x - value: -0 - objectReference: {fileID: 0} - - target: {fileID: -8679921383154817045, guid: 36078ab0369161e49a29d349ae3e0739, type: 3} - propertyPath: m_LocalRotation.y - value: -0 - objectReference: {fileID: 0} - - target: {fileID: -8679921383154817045, guid: 36078ab0369161e49a29d349ae3e0739, type: 3} - propertyPath: m_LocalRotation.z - value: -0 - objectReference: {fileID: 0} - - target: {fileID: -8679921383154817045, guid: 36078ab0369161e49a29d349ae3e0739, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: -8679921383154817045, guid: 36078ab0369161e49a29d349ae3e0739, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: -8679921383154817045, guid: 36078ab0369161e49a29d349ae3e0739, type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: -8679921383154817045, guid: 36078ab0369161e49a29d349ae3e0739, type: 3} - propertyPath: m_ConstrainProportionsScale - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 919132149155446097, guid: 36078ab0369161e49a29d349ae3e0739, type: 3} - propertyPath: m_Name - value: Armature - objectReference: {fileID: 0} - - target: {fileID: 5866666021909216657, guid: 36078ab0369161e49a29d349ae3e0739, type: 3} - propertyPath: m_Controller - value: - objectReference: {fileID: 9100000, guid: 40db3173a05ae3242b1c182a09b0a183, type: 2} - - target: {fileID: 5866666021909216657, guid: 36078ab0369161e49a29d349ae3e0739, type: 3} - propertyPath: m_AnimatePhysics - value: 0 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_RemovedGameObjects: [] - m_AddedGameObjects: [] - m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 36078ab0369161e49a29d349ae3e0739, type: 3} ---- !u!1001 &1196469502 +--- !u!1001 &1229760994 PrefabInstance: m_ObjectHideFlags: 0 serializedVersion: 2 @@ -537,55 +245,87 @@ PrefabInstance: serializedVersion: 3 m_TransformParent: {fileID: 0} m_Modifications: - - target: {fileID: 3945699778904299871, guid: 46014def5fa85504abb9cc3190ae45e3, type: 3} + - target: {fileID: 1804703078109025515, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3} + propertyPath: m_Name + value: PlayerRobot + objectReference: {fileID: 0} + - target: {fileID: 2563429732134213952, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3} + propertyPath: PlayerCamera + value: + objectReference: {fileID: 112919646} + - target: {fileID: 2563429732134213952, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3} + propertyPath: Items.Array.size + value: 3 + objectReference: {fileID: 0} + - target: {fileID: 2563429732134213952, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3} + propertyPath: 'Items.Array.data[0]' + value: + objectReference: {fileID: 5850548977863442861, guid: 46014def5fa85504abb9cc3190ae45e3, type: 3} + - target: {fileID: 2563429732134213952, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3} + propertyPath: 'Items.Array.data[1]' + value: + objectReference: {fileID: 3150477364047279588, guid: a0abf67d2f77de14aba69a9826c206df, type: 3} + - target: {fileID: 2563429732134213952, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3} + propertyPath: 'Items.Array.data[2]' + value: + objectReference: {fileID: 790623186319470878, guid: 3a2f64a76def43c41bb531d50c4a0696, type: 3} + - target: {fileID: 3795091336040275115, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3} propertyPath: m_LocalPosition.x - value: 1.6397126 + value: -0.0318 objectReference: {fileID: 0} - - target: {fileID: 3945699778904299871, guid: 46014def5fa85504abb9cc3190ae45e3, type: 3} + - target: {fileID: 3795091336040275115, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3} propertyPath: m_LocalPosition.y - value: 2.250856 + value: 0 objectReference: {fileID: 0} - - target: {fileID: 3945699778904299871, guid: 46014def5fa85504abb9cc3190ae45e3, type: 3} + - target: {fileID: 3795091336040275115, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3} propertyPath: m_LocalPosition.z - value: 0.8299522 + value: 0.0242 objectReference: {fileID: 0} - - target: {fileID: 3945699778904299871, guid: 46014def5fa85504abb9cc3190ae45e3, type: 3} + - target: {fileID: 7736108665850884707, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3} + propertyPath: m_LocalPosition.x + value: 66.14095 + objectReference: {fileID: 0} + - target: {fileID: 7736108665850884707, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3} + propertyPath: m_LocalPosition.y + value: 0.2199987 + objectReference: {fileID: 0} + - target: {fileID: 7736108665850884707, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3} + propertyPath: m_LocalPosition.z + value: 43.59534 + objectReference: {fileID: 0} + - target: {fileID: 7736108665850884707, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3} propertyPath: m_LocalRotation.w - value: 0.7071068 + value: 1 objectReference: {fileID: 0} - - target: {fileID: 3945699778904299871, guid: 46014def5fa85504abb9cc3190ae45e3, type: 3} + - target: {fileID: 7736108665850884707, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3} propertyPath: m_LocalRotation.x - value: 0.7071068 + value: 0 objectReference: {fileID: 0} - - target: {fileID: 3945699778904299871, guid: 46014def5fa85504abb9cc3190ae45e3, type: 3} + - target: {fileID: 7736108665850884707, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3} propertyPath: m_LocalRotation.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 3945699778904299871, guid: 46014def5fa85504abb9cc3190ae45e3, type: 3} + - target: {fileID: 7736108665850884707, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3} propertyPath: m_LocalRotation.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 3945699778904299871, guid: 46014def5fa85504abb9cc3190ae45e3, type: 3} + - target: {fileID: 7736108665850884707, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3} propertyPath: m_LocalEulerAnglesHint.x - value: 90 + value: 0 objectReference: {fileID: 0} - - target: {fileID: 3945699778904299871, guid: 46014def5fa85504abb9cc3190ae45e3, type: 3} + - target: {fileID: 7736108665850884707, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3} propertyPath: m_LocalEulerAnglesHint.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 3945699778904299871, guid: 46014def5fa85504abb9cc3190ae45e3, type: 3} + - target: {fileID: 7736108665850884707, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3} propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 5850548977863442861, guid: 46014def5fa85504abb9cc3190ae45e3, type: 3} - propertyPath: m_Name - value: AR - objectReference: {fileID: 0} m_RemovedComponents: [] m_RemovedGameObjects: [] m_AddedGameObjects: [] m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 46014def5fa85504abb9cc3190ae45e3, type: 3} + m_SourcePrefab: {fileID: 100100000, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3} --- !u!1 &1585096096 GameObject: m_ObjectHideFlags: 0 @@ -600,7 +340,7 @@ GameObject: - component: {fileID: 1585096103} - component: {fileID: 1585096101} m_Layer: 0 - m_Name: Cube + m_Name: "T\xFCr" m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -675,7 +415,8 @@ Transform: m_LocalPosition: {x: 55.13, y: 9.57, z: 49.51} m_LocalScale: {x: 10, y: 18.479692, z: 1} m_ConstrainProportionsScale: 0 - m_Children: [] + m_Children: + - {fileID: 1875458651} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!65 &1585096101 @@ -714,7 +455,7 @@ MonoBehaviour: openAngle: 90 rotationSpeed: 2 interactionDistance: 18 - rotationOffset: {x: 1, y: 0, z: 0} + rotationOffset: {x: 4.5, y: 0, z: 0} --- !u!1 &1734103108 GameObject: m_ObjectHideFlags: 0 @@ -842,71 +583,123 @@ MonoBehaviour: m_ShadowLayerMask: 1 m_RenderingLayers: 1 m_ShadowRenderingLayers: 1 ---- !u!1001 &2678035937778328931 -PrefabInstance: +--- !u!1 &1875458650 +GameObject: m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1875458651} + - component: {fileID: 1875458654} + - component: {fileID: 1875458653} + - component: {fileID: 1875458652} + m_Layer: 0 + m_Name: knop + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1875458651 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1875458650} serializedVersion: 2 - m_Modification: - serializedVersion: 3 - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 790623186319470878, guid: 3a2f64a76def43c41bb531d50c4a0696, type: 3} - propertyPath: m_Name - value: Messer - objectReference: {fileID: 0} - - target: {fileID: 3225906274411375276, guid: 3a2f64a76def43c41bb531d50c4a0696, type: 3} - propertyPath: m_LocalPosition.x - value: 24.07566 - objectReference: {fileID: 0} - - target: {fileID: 3225906274411375276, guid: 3a2f64a76def43c41bb531d50c4a0696, type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3225906274411375276, guid: 3a2f64a76def43c41bb531d50c4a0696, type: 3} - propertyPath: m_LocalPosition.z - value: 18.63 - objectReference: {fileID: 0} - - target: {fileID: 3225906274411375276, guid: 3a2f64a76def43c41bb531d50c4a0696, type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 3225906274411375276, guid: 3a2f64a76def43c41bb531d50c4a0696, type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3225906274411375276, guid: 3a2f64a76def43c41bb531d50c4a0696, type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3225906274411375276, guid: 3a2f64a76def43c41bb531d50c4a0696, type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3225906274411375276, guid: 3a2f64a76def43c41bb531d50c4a0696, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3225906274411375276, guid: 3a2f64a76def43c41bb531d50c4a0696, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3225906274411375276, guid: 3a2f64a76def43c41bb531d50c4a0696, type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_RemovedGameObjects: [] - m_AddedGameObjects: [] - m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 3a2f64a76def43c41bb531d50c4a0696, type: 3} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -0.431, y: 0, z: 0} + m_LocalScale: {x: 0.08230168, y: 0.048441373, z: 2.2353} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1585096100} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!135 &1875458652 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1875458650} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Radius: 0.5 + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &1875458653 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1875458650} + 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 &1875458654 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1875458650} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} --- !u!1660057539 &9223372036854775807 SceneRoots: m_ObjectHideFlags: 0 m_Roots: - - {fileID: 127041525} - {fileID: 1734103110} - - {fileID: 1196469502} - {fileID: 718992225} - {fileID: 1585096100} - - {fileID: 2678035937778328931} - - {fileID: 384395740} + - {fileID: 1229760994} diff --git a/Assets/SourceFiles/TimmyRobot/Materials/TimmyRobot.mat b/Assets/SourceFiles/TimmyRobot/Materials/TimmyRobot.mat index fa54abe..2f760b6 100644 --- a/Assets/SourceFiles/TimmyRobot/Materials/TimmyRobot.mat +++ b/Assets/SourceFiles/TimmyRobot/Materials/TimmyRobot.mat @@ -63,7 +63,7 @@ Material: m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _MainTex: - m_Texture: {fileID: 2800000, guid: f7bf8842867b5c74c8e3166c1d496e2c, type: 3} + m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _MetallicGlossMap: @@ -128,6 +128,7 @@ Material: - _SrcBlendAlpha: 1 - _Surface: 0 - _WorkflowMode: 1 + - _XRMotionVectorsPass: 1 - _ZWrite: 1 m_Colors: - _BaseColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/Assets/StarterAssets/InputSystem/StarterAssets.inputsettings.asset b/Assets/StarterAssets/InputSystem/StarterAssets.inputsettings.asset index 9a03d18..14e56d6 100644 --- a/Assets/StarterAssets/InputSystem/StarterAssets.inputsettings.asset +++ b/Assets/StarterAssets/InputSystem/StarterAssets.inputsettings.asset @@ -14,13 +14,25 @@ MonoBehaviour: m_EditorClassIdentifier: m_SupportedDevices: [] m_UpdateMode: 1 + m_ScrollDeltaBehavior: 0 + m_MaxEventBytesPerUpdate: 5242880 + m_MaxQueuedEventsPerUpdate: 1000 m_CompensateForScreenOrientation: 0 - m_FilterNoiseOnCurrent: 0 + m_BackgroundBehavior: 0 + m_EditorInputBehaviorInPlayMode: 0 + m_InputActionPropertyDrawerMode: 0 m_DefaultDeadzoneMin: 0.125 m_DefaultDeadzoneMax: 0.925 m_DefaultButtonPressPoint: 0.5 + m_ButtonReleaseThreshold: 0.75 m_DefaultTapTime: 0.2 m_DefaultSlowTapTime: 0.5 m_DefaultHoldTime: 0.4 m_TapRadius: 5 m_MultiTapDelayTime: 0.75 + m_DisableRedundantEventsMerging: 0 + m_ShortcutKeysConsumeInputs: 0 + m_iOSSettings: + m_MotionUsage: + m_Enabled: 0 + m_Description: diff --git a/Assets/StarterAssets/ThirdPersonController/Scripts/ThirdPersonController.cs b/Assets/StarterAssets/ThirdPersonController/Scripts/ThirdPersonController.cs index c7d79bb..860f720 100644 --- a/Assets/StarterAssets/ThirdPersonController/Scripts/ThirdPersonController.cs +++ b/Assets/StarterAssets/ThirdPersonController/Scripts/ThirdPersonController.cs @@ -1,164 +1,78 @@ -using UnityEngine; -#if ENABLE_INPUT_SYSTEM -using UnityEngine.InputSystem; -#endif - -/* Note: animations are called via the controller for both the character and capsule using animator null checks - */ - -namespace StarterAssets +namespace StarterAssets { + using UnityEngine; + using UnityEngine.InputSystem; + [RequireComponent(typeof(CharacterController))] -#if ENABLE_INPUT_SYSTEM [RequireComponent(typeof(PlayerInput))] -#endif public class ThirdPersonController : MonoBehaviour { - [Header("Player")] - [Tooltip("Move speed of the character in m/s")] public float MoveSpeed = 2.0f; - - [Tooltip("Sprint speed of the character in m/s")] public float SprintSpeed = 5.335f; - - [Tooltip("How fast the character turns to face movement direction")] - [Range(0.0f, 0.3f)] - public float RotationSmoothTime = 0.12f; - - [Tooltip("Acceleration and deceleration")] public float SpeedChangeRate = 10.0f; - - public AudioSource AudioFootsteps; - public AudioSource LandingAudio; - public AudioSource AudioFoley; - public AudioClip LandingAudioClip; - public AudioClip[] FootstepAudioClips; - [Range(0, 1)] public float FootstepAudioVolume = 0.5f; - - [Space(10)] - [Tooltip("The height the player can jump")] public float JumpHeight = 1.2f; - - [Tooltip("The character uses its own gravity value. The engine default is -9.81f")] public float Gravity = -15.0f; - - [Space(10)] - [Tooltip("Time required to pass before being able to jump again. Set to 0f to instantly jump again")] public float JumpTimeout = 0.50f; - - [Tooltip("Time required to pass before entering the fall state. Useful for walking down stairs")] public float FallTimeout = 0.15f; - - [Header("Player Grounded")] - [Tooltip("If the character is grounded or not. Not part of the CharacterController built in grounded check")] public bool Grounded = true; - - [Tooltip("Useful for rough ground")] public float GroundedOffset = -0.14f; - - [Tooltip("The radius of the grounded check. Should match the radius of the CharacterController")] public float GroundedRadius = 0.28f; - - [Tooltip("What layers the character uses as ground")] public LayerMask GroundLayers; - - [Header("Cinemachine")] - [Tooltip("The follow target set in the Cinemachine Virtual Camera that the camera will follow")] - public GameObject CinemachineCameraTarget; - - [Tooltip("How far in degrees can you move the camera up")] + public Camera PlayerCamera; public float TopClamp = 70.0f; - - [Tooltip("How far in degrees can you move the camera down")] public float BottomClamp = -30.0f; - - [Tooltip("Additional degress to override the camera. Useful for fine tuning camera position when locked")] public float CameraAngleOverride = 0.0f; - - [Tooltip("For locking the camera position on all axis")] public bool LockCameraPosition = false; - // cinemachine private float _cinemachineTargetYaw; private float _cinemachineTargetPitch; - - // player private float _speed; - private float _animationBlend; - private float _targetRotation = 0.0f; - private float _rotationVelocity; private float _verticalVelocity; private float _terminalVelocity = 53.0f; - - // timeout deltatime private float _jumpTimeoutDelta; private float _fallTimeoutDelta; - - // animation IDs + private PlayerInput _playerInput; + private CharacterController _controller; + private StarterAssetsInputs _input; + private Animator _animator; private int _animIDSpeed; private int _animIDGrounded; private int _animIDJump; private int _animIDFreeFall; private int _animIDMotionSpeed; - -#if ENABLE_INPUT_SYSTEM - private PlayerInput _playerInput; -#endif - private Animator _animator; - private CharacterController _controller; - private StarterAssetsInputs _input; - private GameObject _mainCamera; - private const float _threshold = 0.01f; - private bool _hasAnimator; private bool IsCurrentDeviceMouse { get { -#if ENABLE_INPUT_SYSTEM - return _playerInput.currentControlScheme == "KeyboardMouse"; -#else - return false; -#endif + return _playerInput != null && _playerInput.currentControlScheme == "KeyboardMouse"; } } - private void Awake() { - // get a reference to our main camera - if (_mainCamera == null) + if (PlayerCamera == null) { - _mainCamera = GameObject.FindGameObjectWithTag("MainCamera"); + PlayerCamera = Camera.main; } } private void Start() { - _cinemachineTargetYaw = CinemachineCameraTarget.transform.rotation.eulerAngles.y; - - _hasAnimator = TryGetComponent(out _animator); + _cinemachineTargetYaw = PlayerCamera.transform.rotation.eulerAngles.y; _controller = GetComponent(); _input = GetComponent(); -#if ENABLE_INPUT_SYSTEM + _hasAnimator = TryGetComponent(out _animator); _playerInput = GetComponent(); -#else - Debug.LogError( "Starter Assets package is missing dependencies. Please use Tools/Starter Assets/Reinstall Dependencies to fix it"); -#endif - AssignAnimationIDs(); - - // reset our timeouts on start _jumpTimeoutDelta = JumpTimeout; _fallTimeoutDelta = FallTimeout; } private void Update() { - _hasAnimator = TryGetComponent(out _animator); - JumpAndGravity(); GroundedCheck(); Move(); @@ -180,13 +94,9 @@ namespace StarterAssets private void GroundedCheck() { - // set sphere position, with offset - Vector3 spherePosition = new Vector3(transform.position.x, transform.position.y - GroundedOffset, - transform.position.z); - Grounded = Physics.CheckSphere(spherePosition, GroundedRadius, GroundLayers, - QueryTriggerInteraction.Ignore); - - // update animator if using character + Vector3 spherePosition = new Vector3(transform.position.x, transform.position.y - GroundedOffset, transform.position.z); + //https://docs.unity3d.com/6000.4/Documentation/ScriptReference/Physics.CheckSphere.html + Grounded = Physics.CheckSphere(spherePosition, GroundedRadius, GroundLayers, QueryTriggerInteraction.Ignore); if (_hasAnimator) { _animator.SetBool(_animIDGrounded, Grounded); @@ -195,127 +105,69 @@ namespace StarterAssets private void CameraRotation() { - // if there is an input and camera position is not fixed if (_input.look.sqrMagnitude >= _threshold && !LockCameraPosition) { - //Don't multiply mouse input by Time.deltaTime; float deltaTimeMultiplier = IsCurrentDeviceMouse ? 1.0f : Time.deltaTime; - _cinemachineTargetYaw += _input.look.x * deltaTimeMultiplier; _cinemachineTargetPitch += _input.look.y * deltaTimeMultiplier; } - - // clamp our rotations so our values are limited 360 degrees _cinemachineTargetYaw = ClampAngle(_cinemachineTargetYaw, float.MinValue, float.MaxValue); _cinemachineTargetPitch = ClampAngle(_cinemachineTargetPitch, BottomClamp, TopClamp); - - // Cinemachine will follow this target - CinemachineCameraTarget.transform.rotation = Quaternion.Euler(_cinemachineTargetPitch + CameraAngleOverride, - _cinemachineTargetYaw, 0.0f); + PlayerCamera.transform.rotation = Quaternion.Euler(_cinemachineTargetPitch + CameraAngleOverride, _cinemachineTargetYaw, 0.0f); + transform.rotation = Quaternion.Euler(0.0f, _cinemachineTargetYaw, 0.0f); } + //https://docs.unity3d.com/6000.4/Documentation/ScriptReference/CharacterController.Move.html private void Move() { - // set target speed based on move speed, sprint speed and if sprint is pressed float targetSpeed = _input.sprint ? SprintSpeed : MoveSpeed; - - // a simplistic acceleration and deceleration designed to be easy to remove, replace, or iterate upon - - // note: Vector2's == operator uses approximation so is not floating point error prone, and is cheaper than magnitude - // if there is no input, set the target speed to 0 if (_input.move == Vector2.zero) targetSpeed = 0.0f; - - // a reference to the players current horizontal velocity float currentHorizontalSpeed = new Vector3(_controller.velocity.x, 0.0f, _controller.velocity.z).magnitude; - float speedOffset = 0.1f; float inputMagnitude = _input.analogMovement ? _input.move.magnitude : 1f; - - // accelerate or decelerate to target speed - if (currentHorizontalSpeed < targetSpeed - speedOffset || - currentHorizontalSpeed > targetSpeed + speedOffset) + if (currentHorizontalSpeed < targetSpeed - speedOffset || currentHorizontalSpeed > targetSpeed + speedOffset) { - // creates curved result rather than a linear one giving a more organic speed change - // note T in Lerp is clamped, so we don't need to clamp our speed - _speed = Mathf.Lerp(currentHorizontalSpeed, targetSpeed * inputMagnitude, - Time.deltaTime * SpeedChangeRate); - - // round speed to 3 decimal places + _speed = Mathf.Lerp(currentHorizontalSpeed, targetSpeed * inputMagnitude, Time.deltaTime * SpeedChangeRate); _speed = Mathf.Round(_speed * 1000f) / 1000f; } else { _speed = targetSpeed; } - - _animationBlend = Mathf.Lerp(_animationBlend, targetSpeed, Time.deltaTime * SpeedChangeRate); - if (_animationBlend < 0.01f) _animationBlend = 0f; - - // normalise input direction Vector3 inputDirection = new Vector3(_input.move.x, 0.0f, _input.move.y).normalized; - - // note: Vector2's != operator uses approximation so is not floating point error prone, and is cheaper than magnitude - // if there is a move input rotate player when the player is moving - if (_input.move != Vector2.zero) - { - _targetRotation = Mathf.Atan2(inputDirection.x, inputDirection.z) * Mathf.Rad2Deg + - _mainCamera.transform.eulerAngles.y; - float rotation = Mathf.SmoothDampAngle(transform.eulerAngles.y, _targetRotation, ref _rotationVelocity, - RotationSmoothTime); - - // rotate to face input direction relative to camera position - transform.rotation = Quaternion.Euler(0.0f, rotation, 0.0f); - } - - - Vector3 targetDirection = Quaternion.Euler(0.0f, _targetRotation, 0.0f) * Vector3.forward; - - // move the player - _controller.Move(targetDirection.normalized * (_speed * Time.deltaTime) + - new Vector3(0.0f, _verticalVelocity, 0.0f) * Time.deltaTime); - - // update animator if using character + Vector3 moveDirection = PlayerCamera.transform.right * inputDirection.x + PlayerCamera.transform.forward * inputDirection.z; + moveDirection.y = 0f; + _controller.Move(moveDirection.normalized * (_speed * Time.deltaTime) + new Vector3(0.0f, _verticalVelocity, 0.0f) * Time.deltaTime); if (_hasAnimator) { - _animator.SetFloat(_animIDSpeed, _animationBlend); + _animator.SetFloat(_animIDSpeed, _speed); _animator.SetFloat(_animIDMotionSpeed, inputMagnitude); } } + //https://docs.unity3d.com/6000.4/Documentation/ScriptReference/Mathf.Sqrt.html private void JumpAndGravity() { if (Grounded) { - // reset the fall timeout timer _fallTimeoutDelta = FallTimeout; - - // update animator if using character if (_hasAnimator) { _animator.SetBool(_animIDJump, false); _animator.SetBool(_animIDFreeFall, false); } - - // stop our velocity dropping infinitely when grounded if (_verticalVelocity < 0.0f) { _verticalVelocity = -2f; } - - // Jump if (_input.jump && _jumpTimeoutDelta <= 0.0f) { - // the square root of H * -2 * G = how much velocity needed to reach desired height _verticalVelocity = Mathf.Sqrt(JumpHeight * -2f * Gravity); - - // update animator if using character if (_hasAnimator) { _animator.SetBool(_animIDJump, true); } } - - // jump timeout if (_jumpTimeoutDelta >= 0.0f) { _jumpTimeoutDelta -= Time.deltaTime; @@ -323,28 +175,20 @@ namespace StarterAssets } else { - // reset the jump timeout timer _jumpTimeoutDelta = JumpTimeout; - - // fall timeout if (_fallTimeoutDelta >= 0.0f) { _fallTimeoutDelta -= Time.deltaTime; } else { - // update animator if using character if (_hasAnimator) { _animator.SetBool(_animIDFreeFall, true); } } - - // if we are not grounded, do not jump _input.jump = false; } - - // apply gravity over time if under terminal (multiply by delta time twice to linearly speed up over time) if (_verticalVelocity < _terminalVelocity) { _verticalVelocity += Gravity * Time.deltaTime; @@ -358,40 +202,22 @@ namespace StarterAssets return Mathf.Clamp(lfAngle, lfMin, lfMax); } + private void OnFootstep(AnimationEvent animationEvent) + { + } + + // Die beiden teile sind einfach da damit das spiel nicht einfriert, immernoch keinen plan warum, aber es ist so + private void OnLand(AnimationEvent animationEvent) + { + } + private void OnDrawGizmosSelected() { Color transparentGreen = new Color(0.0f, 1.0f, 0.0f, 0.35f); Color transparentRed = new Color(1.0f, 0.0f, 0.0f, 0.35f); - if (Grounded) Gizmos.color = transparentGreen; else Gizmos.color = transparentRed; - - // when selected, draw a gizmo in the position of, and matching radius of, the grounded collider - Gizmos.DrawSphere( - new Vector3(transform.position.x, transform.position.y - GroundedOffset, transform.position.z), - GroundedRadius); - } - - private void OnFootstep(AnimationEvent animationEvent) - { - if (animationEvent.animatorClipInfo.weight > 0.5f) - { - - if (AudioFootsteps != null) - AudioFootsteps.Play(); - if (AudioFoley != null) - AudioFoley.Play(); - } - } - - private void OnLand(AnimationEvent animationEvent) - { - if (animationEvent.animatorClipInfo.weight > 0.5f) - { - if (LandingAudio != null) - LandingAudio.Play(); - - } + Gizmos.DrawSphere(new Vector3(transform.position.x, transform.position.y - GroundedOffset, transform.position.z), GroundedRadius); } } } \ No newline at end of file diff --git a/ProjectSettings/EditorBuildSettings.asset b/ProjectSettings/EditorBuildSettings.asset index 07b37d5..aeb9620 100644 --- a/ProjectSettings/EditorBuildSettings.asset +++ b/ProjectSettings/EditorBuildSettings.asset @@ -15,5 +15,6 @@ EditorBuildSettings: path: Assets/Scenes/Story1.unity guid: a12c64270a5146f4eb756ca10899ee54 m_configObjects: + com.unity.input.settings: {fileID: 11400000, guid: 9e7be553448fa2546aea5752021cbcf7, type: 2} com.unity.input.settings.actions: {fileID: -944628639613478452, guid: 052faaac586de48259a63d0c4782560b, type: 3} m_UseUCBPForAssetBundles: 0