diff --git a/BlueWater/Assets/01.Scenes/02.Main.unity b/BlueWater/Assets/01.Scenes/02.Main.unity index d8e5c2149..c2a3e6708 100644 --- a/BlueWater/Assets/01.Scenes/02.Main.unity +++ b/BlueWater/Assets/01.Scenes/02.Main.unity @@ -617,216 +617,6 @@ PrefabInstance: m_AddedGameObjects: [] m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: c8c901c119dd09f4d9976a4d49bbd8f9, type: 3} ---- !u!1 &503805554 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 503805558} - - component: {fileID: 503805557} - - component: {fileID: 503805556} - - component: {fileID: 503805555} - m_Layer: 0 - m_Name: Cube (1) - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!65 &503805555 -BoxCollider: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 503805554} - 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_Size: {x: 1, y: 1, z: 1} - m_Center: {x: 0, y: 0, z: 0} ---- !u!23 &503805556 -MeshRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 503805554} - 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_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_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 - m_AdditionalVertexStreams: {fileID: 0} ---- !u!33 &503805557 -MeshFilter: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 503805554} - m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} ---- !u!4 &503805558 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 503805554} - serializedVersion: 2 - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 17.54, y: 0.64, z: 10.33} - 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!1 &546777058 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 546777062} - - component: {fileID: 546777061} - - component: {fileID: 546777060} - - component: {fileID: 546777059} - m_Layer: 0 - m_Name: Cube (2) - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!65 &546777059 -BoxCollider: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 546777058} - 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_Size: {x: 1, y: 1, z: 1} - m_Center: {x: 0, y: 0, z: 0} ---- !u!23 &546777060 -MeshRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 546777058} - 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_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_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 - m_AdditionalVertexStreams: {fileID: 0} ---- !u!33 &546777061 -MeshFilter: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 546777058} - m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} ---- !u!4 &546777062 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 546777058} - serializedVersion: 2 - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 16.03, y: 0.64, z: -2.76} - m_LocalScale: {x: 1, y: 1, z: 5.0621} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 0} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &608298000 GameObject: m_ObjectHideFlags: 0 @@ -1001,9 +791,9 @@ Camera: y: 0 width: 1 height: 1 - near clip plane: 0.3 + near clip plane: 0.1 far clip plane: 1000 - field of view: 50 + field of view: 60 orthographic: 0 orthographic size: 5 m_Depth: -1 @@ -1029,8 +819,8 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 776161953} serializedVersion: 2 - m_LocalRotation: {x: 0.18875057, y: 0.6814494, z: -0.18875054, w: 0.6814494} - m_LocalPosition: {x: -9.999999, y: 5.42, z: 0.0000011920929} + m_LocalRotation: {x: 0.27551305, y: 0, z: 0, w: 0.96129733} + m_LocalPosition: {x: 2, y: 6.15, z: -10} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] @@ -1096,10 +886,10 @@ MonoBehaviour: m_ShowCameraFrustum: 1 m_IgnoreTimeScale: 0 m_WorldUpOverride: {fileID: 0} - m_UpdateMethod: 2 + m_UpdateMethod: 1 m_BlendUpdateMethod: 1 m_DefaultBlend: - m_Style: 1 + m_Style: 0 m_Time: 2 m_CustomCurve: serializedVersion: 2 @@ -1131,7 +921,8 @@ GameObject: - component: {fileID: 1040971782} - component: {fileID: 1040971785} - component: {fileID: 1040971784} - - component: {fileID: 1040971783} + - component: {fileID: 1040971787} + - component: {fileID: 1040971786} m_Layer: 0 m_Name: cm m_TagString: Untagged @@ -1154,28 +945,6 @@ Transform: m_Children: [] m_Father: {fileID: 1437521087} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &1040971783 -MonoBehaviour: - m_ObjectHideFlags: 3 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1040971781} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: fa7155796051b734daa718462081dc5f, type: 3} - m_Name: - m_EditorClassIdentifier: - m_BindingMode: 1 - m_FollowOffset: {x: 0, y: 6, z: -10} - m_XDamping: 1 - m_YDamping: 1 - m_ZDamping: 1 - m_AngularDampingMode: 0 - m_PitchDamping: 0 - m_YawDamping: 0 - m_RollDamping: 0 - m_AngularDamping: 0 --- !u!114 &1040971784 MonoBehaviour: m_ObjectHideFlags: 3 @@ -1188,9 +957,9 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: f4044717213e31446939f7bd49c896ea, type: 3} m_Name: m_EditorClassIdentifier: - m_TrackedObjectOffset: {x: 0, y: 0, z: 0} - m_LookaheadTime: 0 - m_LookaheadSmoothing: 0 + m_TrackedObjectOffset: {x: 0, y: 0.36, z: 0.2} + m_LookaheadTime: 0.4 + m_LookaheadSmoothing: 6.3 m_LookaheadIgnoreY: 0 m_HorizontalDamping: 0.5 m_VerticalDamping: 0.5 @@ -1215,6 +984,77 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: ac0b09e7857660247b1477e93731de29, type: 3} m_Name: m_EditorClassIdentifier: +--- !u!114 &1040971786 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1040971781} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 68bb026fafb42b14791938953eaace77, type: 3} + m_Name: + m_EditorClassIdentifier: + m_NoiseProfile: {fileID: 11400000, guid: a3dacaec0287d7444b4bd276816e1666, type: 2} + m_PivotOffset: {x: 0, y: 0, z: 0} + m_AmplitudeGain: 1 + m_FrequencyGain: 1 + mNoiseOffsets: {x: 0, y: 0, z: 0} +--- !u!114 &1040971787 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1040971781} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9384ab8608cdc3d479fe89cd51eed48f, type: 3} + m_Name: + m_EditorClassIdentifier: + m_BindingMode: 1 + m_FollowOffset: {x: 0, y: 6.73, z: -10} + m_XDamping: 1 + m_YDamping: 1 + m_ZDamping: 1 + m_AngularDampingMode: 0 + m_PitchDamping: 0 + m_YawDamping: 3 + m_RollDamping: 0 + m_AngularDamping: 0 + m_Heading: + m_Definition: 2 + m_VelocityFilterStrength: 4 + m_Bias: 0 + m_RecenterToTargetHeading: + m_enabled: 1 + m_WaitTime: 1 + m_RecenteringTime: 2 + m_LegacyHeadingDefinition: -1 + m_LegacyVelocityFilterStrength: -1 + m_XAxis: + Value: 0 + m_SpeedMode: 0 + m_MaxSpeed: 0 + m_AccelTime: 0.5 + m_DecelTime: 0.5 + m_InputAxisName: Mouse X + m_InputAxisValue: 0 + m_InvertInput: 1 + m_MinValue: -180 + m_MaxValue: 180 + m_Wrap: 1 + m_Recentering: + m_enabled: 0 + m_WaitTime: 1 + m_RecenteringTime: 2 + m_LegacyHeadingDefinition: -1 + m_LegacyVelocityFilterStrength: -1 + m_LegacyRadius: 3.4028235e+38 + m_LegacyHeightOffset: 3.4028235e+38 + m_LegacyHeadingBias: 3.4028235e+38 + m_HeadingIsSlave: 0 --- !u!114 &1052583427 stripped MonoBehaviour: m_CorrespondingSourceObject: {fileID: 8113378936488292401, guid: 19e7a279b411e8a4aa8396dbda0558e2, @@ -1495,14 +1335,14 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1181634877} serializedVersion: 2 - m_LocalRotation: {x: 0, y: 0.7071068, z: 0, w: 0.7071068} - m_LocalPosition: {x: 0, y: -0.58, z: 0} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 2, y: -0.58, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: - {fileID: 1437521087} m_Father: {fileID: 0} - m_LocalEulerAnglesHint: {x: 0, y: 90, z: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!65 &1181634884 BoxCollider: m_ObjectHideFlags: 0 @@ -1536,7 +1376,9 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 176cfac66084d4bfb9b4c9f11c4b137f, type: 3} m_Name: m_EditorClassIdentifier: - speed: 1 + maxSpeed: 5 + acceleration: 2 + deceleration: 2 turnSpeed: 1 --- !u!114 &1181634886 MonoBehaviour: @@ -1819,8 +1661,8 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1437521086} serializedVersion: 2 - m_LocalRotation: {x: 0.2669336, y: -0, z: 0.000000014901159, w: 0.96371496} - m_LocalPosition: {x: -0.0000002384187, y: 6, z: -10} + m_LocalRotation: {x: 0.27551305, y: -0, z: -0, w: 0.96129733} + m_LocalPosition: {x: 0, y: 6.73, z: -10} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: @@ -1848,9 +1690,9 @@ MonoBehaviour: m_LookAt: {fileID: 1181634882} m_Follow: {fileID: 1181634882} m_Lens: - FieldOfView: 50 + FieldOfView: 60 OrthographicSize: 5 - NearClipPlane: 0.3 + NearClipPlane: 0.1 FarClipPlane: 1000 Dutch: 0 ModeOverride: 0 @@ -7137,7 +6979,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: e94b9d97c53ad44e28abbecc69e7d339, type: 3} m_Name: m_EditorClassIdentifier: - waveLength: 2 + waveLength: 5 amplitude: 0.5 speed: 1 direction: {x: 1, y: 0} @@ -7472,111 +7314,6 @@ PrefabInstance: m_AddedGameObjects: [] m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: c7d7cec49ffdaf24ca922735dac9c4f0, type: 3} ---- !u!1 &2102660101 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 2102660105} - - component: {fileID: 2102660104} - - component: {fileID: 2102660103} - - component: {fileID: 2102660102} - m_Layer: 0 - m_Name: Cube - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!65 &2102660102 -BoxCollider: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2102660101} - 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_Size: {x: 1, y: 1, z: 1} - m_Center: {x: 0, y: 0, z: 0} ---- !u!23 &2102660103 -MeshRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2102660101} - 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_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_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 - m_AdditionalVertexStreams: {fileID: 0} ---- !u!33 &2102660104 -MeshFilter: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2102660101} - m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} ---- !u!4 &2102660105 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2102660101} - serializedVersion: 2 - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0.64, z: 10.89} - 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!1 &2105062287 GameObject: m_ObjectHideFlags: 0 @@ -9959,6 +9696,7 @@ GameObject: - component: {fileID: 9084056684754139757} - component: {fileID: 9165224470745537916} - component: {fileID: 9165224471417270392} + - component: {fileID: 9185617008684929772} m_Layer: 16 m_Name: CameraDriver m_TagString: MainCamera @@ -10235,6 +9973,7 @@ GameObject: - component: {fileID: 6904333119263826113} - component: {fileID: 9165224469877011777} - component: {fileID: 9165224471417270395} + - component: {fileID: 9184688513633096454} m_Layer: 16 m_Name: CameraDrag m_TagString: MainCamera @@ -12230,6 +11969,50 @@ Camera: m_OcclusionCulling: 1 m_StereoConvergence: 10 m_StereoSeparation: 0.022 +--- !u!114 &9184688513633096454 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9166880846495778299} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3} + m_Name: + m_EditorClassIdentifier: + 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_Version: 2 + m_TaaSettings: + quality: 3 + frameInfluence: 0.1 + jitterScale: 1 + mipBias: 0 + varianceClampScale: 0.9 + contrastAdaptiveSharpening: 0 --- !u!20 &9185617008684929771 Camera: m_ObjectHideFlags: 0 @@ -12281,6 +12064,50 @@ Camera: m_OcclusionCulling: 1 m_StereoConvergence: 10 m_StereoSeparation: 0.022 +--- !u!114 &9185617008684929772 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9166160304447514585} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3} + m_Name: + m_EditorClassIdentifier: + 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_Version: 2 + m_TaaSettings: + quality: 3 + frameInfluence: 0.1 + jitterScale: 1 + mipBias: 0 + varianceClampScale: 0.9 + contrastAdaptiveSharpening: 0 --- !u!54 &9219936609854736305 Rigidbody: m_ObjectHideFlags: 0 @@ -12327,6 +12154,3 @@ SceneRoots: - {fileID: 1341654437} - {fileID: 1560348101} - {fileID: 1181634882} - - {fileID: 2102660105} - - {fileID: 503805558} - - {fileID: 546777062} diff --git a/BlueWater/Assets/02.Scripts/WaterAndShip/Gerstner wave/Floater.cs b/BlueWater/Assets/02.Scripts/WaterAndShip/Gerstner wave/Floater.cs index ee3629de1..3deb14c3b 100644 --- a/BlueWater/Assets/02.Scripts/WaterAndShip/Gerstner wave/Floater.cs +++ b/BlueWater/Assets/02.Scripts/WaterAndShip/Gerstner wave/Floater.cs @@ -13,24 +13,32 @@ public class Floater : MonoBehaviour rb = GetComponent(); } - public void Update() + void Update() { float waveNumber = 2.0f * Mathf.PI / waveGenerator.waveLength; float phaseConstant = waveGenerator.speed * waveNumber; - Vector3 position = rb.position; - float dotProduct = Vector2.Dot(new Vector2(position.x, position.z), waveGenerator.direction); + + // Convert the boat's world position to the wave's local position + Vector3 localPosition = waveGenerator.transform.InverseTransformPoint(rb.position); + float dotProduct = Vector2.Dot(new Vector2(localPosition.x, localPosition.z), waveGenerator.direction); + float wavePhase = waveNumber * dotProduct + phaseConstant * Time.time; // Calculate the new height - float newY = waveGenerator.amplitude * Mathf.Sin(wavePhase) + boatOffset; // added offset here - position.y = newY; + float newY = waveGenerator.amplitude * Mathf.Sin(wavePhase) + boatOffset; + localPosition.y = newY; - rb.MovePosition(position); + // Convert the position back to world coordinates + rb.MovePosition(waveGenerator.transform.TransformPoint(localPosition)); - // get wave's normal - Mesh mesh = waveGenerator.GetComponent().mesh; - Vector3 normal = mesh.normals[0]; + // Calculate the wave's normal at the boat's position + Vector3 normal = new Vector3( + -waveGenerator.amplitude * waveNumber * waveGenerator.direction.x * Mathf.Cos(wavePhase), + 1.0f, + -waveGenerator.amplitude * waveNumber * waveGenerator.direction.y * Mathf.Cos(wavePhase) + ).normalized; + // Rotate the boat to align with the wave's normal Quaternion targetRotation = Quaternion.FromToRotation(transform.up, normal) * transform.rotation; rb.MoveRotation(Quaternion.Slerp(transform.rotation, targetRotation, Time.deltaTime * waveGenerator.speed)); } diff --git a/BlueWater/Assets/02.Scripts/WaterAndShip/Gerstner wave/GerstnerWave.cs b/BlueWater/Assets/02.Scripts/WaterAndShip/Gerstner wave/GerstnerWave.cs index 47fe716a0..751c432fb 100644 --- a/BlueWater/Assets/02.Scripts/WaterAndShip/Gerstner wave/GerstnerWave.cs +++ b/BlueWater/Assets/02.Scripts/WaterAndShip/Gerstner wave/GerstnerWave.cs @@ -9,10 +9,11 @@ public class GerstnerWave : MonoBehaviour public float speed = 1f; public Vector2 direction = new Vector2(1.0f, 0.0f); - public void Update() + void Update() { Mesh mesh = GetComponent().mesh; Vector3[] vertices = mesh.vertices; + Vector3[] normals = mesh.normals; float waveNumber = 2.0f * Mathf.PI / waveLength; float phaseConstant = speed * waveNumber; @@ -24,9 +25,32 @@ public class GerstnerWave : MonoBehaviour float wavePhase = waveNumber * dotProduct + phaseConstant * Time.time; vertex.y = amplitude * Mathf.Sin(wavePhase); vertices[i] = vertex; + + // Calculate the normal at the vertex + float cosPhase = Mathf.Cos(wavePhase); + float dx = -waveNumber * amplitude * direction.x * cosPhase; + float dz = -waveNumber * amplitude * direction.y * cosPhase; + normals[i] = new Vector3(dx, 1.0f, dz).normalized; } mesh.vertices = vertices; - mesh.RecalculateNormals(); + mesh.normals = normals; + } + + public Vector3 GetWaveNormal(Vector3 position) + { + float waveNumber = 2.0f * Mathf.PI / waveLength; + float phaseConstant = speed * waveNumber; + float dotProduct = Vector2.Dot(new Vector2(position.x + transform.position.x, position.z + transform.position.z), direction); + float wavePhase = waveNumber * dotProduct + phaseConstant * Time.time; + + float cosPhase = Mathf.Cos(wavePhase); + + // We differentiate the wave function to get the slope at the current point + float dx = -waveNumber * amplitude * direction.x * cosPhase; + float dz = -waveNumber * amplitude * direction.y * cosPhase; + + Vector3 normal = new Vector3(dx, 1.0f, dz).normalized; + return normal; } } \ No newline at end of file diff --git a/BlueWater/Assets/02.Scripts/WaterAndShip/Player.cs b/BlueWater/Assets/02.Scripts/WaterAndShip/Player.cs index a967bddb5..ba199ebe7 100644 --- a/BlueWater/Assets/02.Scripts/WaterAndShip/Player.cs +++ b/BlueWater/Assets/02.Scripts/WaterAndShip/Player.cs @@ -5,7 +5,9 @@ namespace _02.Scripts.WaterAndShip { public class Player : MonoBehaviour { - public float speed = 10f; + public float maxSpeed = 10f; + public float acceleration = 2f; + public float deceleration = 2f; public float turnSpeed = 10f; private Rigidbody rb; private Vector2 movementInput; @@ -22,10 +24,14 @@ namespace _02.Scripts.WaterAndShip void FixedUpdate() { - Vector3 movement = new Vector3(movementInput.x, 0.0f, movementInput.y); - - // Move the boat - rb.AddForce(movement * speed * Time.fixedDeltaTime, ForceMode.VelocityChange); + // Calculate the desired velocity + Vector3 desiredVelocity = transform.forward * movementInput.y * maxSpeed; + + // If moving forward, use acceleration. Otherwise, use deceleration. + float speedChange = (movementInput.y != 0 ? acceleration : deceleration) * Time.fixedDeltaTime; + + // Adjust the current velocity towards the desired velocity + rb.velocity = Vector3.MoveTowards(rb.velocity, desiredVelocity, speedChange); // Rotate the boat float turn = movementInput.x; @@ -33,4 +39,4 @@ namespace _02.Scripts.WaterAndShip rb.MoveRotation(rb.rotation * turnRotation); } } -} +} \ No newline at end of file