From bd8918ffe04c38681eca6995d0d06b73c36769d4 Mon Sep 17 00:00:00 2001 From: BobSong <605277374@qq.com> Date: Sun, 29 Mar 2026 17:51:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8D=8F=E7=BA=BF=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Line/fishing line float set.prefab | 17 ++++++- .../View/Player/Mono/JointPinchController.cs | 44 +++++++++++++------ .../Runtime/Materials/Water Volume.mat | 6 +-- ProjectSettings/DynamicsManager.asset | 2 +- ProjectSettings/TagManager.asset | 10 ++--- 5 files changed, 54 insertions(+), 25 deletions(-) diff --git a/Assets/ResRaw/Prefabs/Line/fishing line float set.prefab b/Assets/ResRaw/Prefabs/Line/fishing line float set.prefab index bb6e0d965..1b7b99f47 100644 --- a/Assets/ResRaw/Prefabs/Line/fishing line float set.prefab +++ b/Assets/ResRaw/Prefabs/Line/fishing line float set.prefab @@ -77,6 +77,8 @@ MonoBehaviour: waterSampleStep: 2 waterInterpolate: 1 waterUpdateEvery: 1 + waterLiftStrength: 0.25 + keepStartAdjacentNodeFollow: 1 waterPostConstraintIterations: 2 renderSubdivisionsIdle: 6 renderSubdivisionsMoving: 2 @@ -209,7 +211,7 @@ GameObject: - component: {fileID: 135844594273256032} - component: {fileID: 1923684598771359451} - component: {fileID: 2475726686148443307} - m_Layer: 7 + m_Layer: 15 m_Name: Lure m_TagString: Untagged m_Icon: {fileID: 0} @@ -494,7 +496,7 @@ GameObject: - component: {fileID: 153691655494134957} - component: {fileID: 2717383850592950062} - component: {fileID: 6678694395924494533} - m_Layer: 16 + m_Layer: 15 m_Name: Float m_TagString: Untagged m_Icon: {fileID: 0} @@ -672,6 +674,9 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: Assembly-CSharp::BobberPresentationController fallbackWaterLevel: 0 + waterRenderer: {fileID: 0} + waterCollisionLayer: 1 + waterQueryObjectWidth: 0.5 waterProviderBehaviour: {fileID: 114112904742580403} enterWaterDepth: 0.002 exitWaterDepth: -0.01 @@ -699,10 +704,14 @@ MonoBehaviour: planarTiltThreshold: 0.3 planarDominanceMultiplier: 1.2 postureHysteresis: 0.04 + postureConfirmTime: 0.08 + postureSwitchCooldown: 0.1 tiltedAngle: 38 lyingAngle: 88 uprightMaxTiltAngle: 8 planarTiltFactor: 120 + planarDirectionDeadZone: 0.01 + planarDirectionLerpSpeed: 10 rotationLerpSpeed: 8 debugResetKey: 1 debugTapKey: 1 @@ -710,6 +719,8 @@ MonoBehaviour: debugLiftKey: 1 debugBlackDriftKey: 1 drawDebug: 1 + UseTestPosture: 0 + TestPosture: 0 --- !u!1 &1933124697579601 GameObject: m_ObjectHideFlags: 0 @@ -787,6 +798,8 @@ MonoBehaviour: waterSampleStep: 2 waterInterpolate: 1 waterUpdateEvery: 1 + waterLiftStrength: 0.25 + keepStartAdjacentNodeFollow: 1 waterPostConstraintIterations: 2 renderSubdivisionsIdle: 6 renderSubdivisionsMoving: 2 diff --git a/Assets/Scripts/Fishing/New/View/Player/Mono/JointPinchController.cs b/Assets/Scripts/Fishing/New/View/Player/Mono/JointPinchController.cs index 7ad07d2bb..4f3787118 100644 --- a/Assets/Scripts/Fishing/New/View/Player/Mono/JointPinchController.cs +++ b/Assets/Scripts/Fishing/New/View/Player/Mono/JointPinchController.cs @@ -1,3 +1,4 @@ +using System; using UnityEngine; namespace NBF @@ -14,8 +15,11 @@ namespace NBF private Rigidbody rb; + private float maxCatchupDuration = 0.5f; private Transform targetTransform; private float originalSpring; + private float pinchElapsedTime; + public bool isPinched { get; private set; } @@ -31,27 +35,37 @@ namespace NBF void FixedUpdate() { - if (isPinched && targetTransform != null) + if (isPinched && !moveToTargetDone && targetTransform != null) { - transform.position = - Vector3.MoveTowards(transform.position, targetTransform.position, Time.deltaTime * _speed); - if (!moveToTargetDone) + pinchElapsedTime += Time.fixedDeltaTime; + // transform.position = + // Vector3.MoveTowards(transform.position, targetTransform.position, Time.deltaTime * _speed); + rb.MovePosition(Vector3.MoveTowards(transform.position, targetTransform.position, + Time.deltaTime * _speed)); + if (Vector3.Distance(transform.position, targetTransform.position) < 0.1f || + pinchElapsedTime >= maxCatchupDuration) { - if (Vector3.Distance(transform.position, targetTransform.position) < 0.1f) - { - moveToTargetDone = true; - } - } - - if (moveToTargetDone) - { - transform.position = targetTransform.position; + moveToTargetDone = true; } } + + SyncPosition(); + } + + private void LateUpdate() + { + SyncPosition(); + } + + private void SyncPosition() + { + if (!isPinched) return; + if (!moveToTargetDone) return; + rb.MovePosition(targetTransform.position); } // 外部调用:开始捏住流程 - public void StartPinch(Transform fingerTransform, float speed = 3) + public void StartPinch(Transform fingerTransform, float speed = 3, float _maxCatchupDuration = 0.3f) { _speed = speed; Rigidbody fingerRb = fingerTransform.GetComponent(); @@ -61,6 +75,8 @@ namespace NBF return; } + maxCatchupDuration = _maxCatchupDuration; + pinchElapsedTime = 0f; isPinched = true; rb.useGravity = false; rb.isKinematic = true; diff --git a/Packages/com.waveharmonic.crest/Runtime/Materials/Water Volume.mat b/Packages/com.waveharmonic.crest/Runtime/Materials/Water Volume.mat index 1df47d091..8ec8d0d9c 100644 --- a/Packages/com.waveharmonic.crest/Runtime/Materials/Water Volume.mat +++ b/Packages/com.waveharmonic.crest/Runtime/Materials/Water Volume.mat @@ -56,7 +56,7 @@ Material: - _Crest_CausticsDepthOfField: 6 - _Crest_CausticsDistortionScale: 250 - _Crest_CausticsDistortionStrength: 0.16 - - _Crest_CausticsEnabled: 0 + - _Crest_CausticsEnabled: 1 - _Crest_CausticsFocalDepth: 2 - _Crest_CausticsMotionBlur: 1 - _Crest_CausticsScrollSpeed: 1 @@ -71,7 +71,7 @@ Material: - _Crest_ShadowsAffectsAmbientFactor: 0.5 - _Crest_SunBoost: 2 m_Colors: - - _Crest_AbsorptionColor: {r: 0, g: 0, b: 0, a: 0.1019608} - - _Crest_Scattering: {r: 0, g: 0, b: 0, a: 1} + - _Crest_AbsorptionColor: {r: 0.34162676, g: 0.6954546, b: 0.85, a: 0.1019608} + - _Crest_Scattering: {r: 0, g: 0.09803919, b: 0.19999996, a: 1} m_BuildTextureStacks: [] m_AllowLocking: 1 diff --git a/ProjectSettings/DynamicsManager.asset b/ProjectSettings/DynamicsManager.asset index 6b3f90f27..0ed003518 100644 --- a/ProjectSettings/DynamicsManager.asset +++ b/ProjectSettings/DynamicsManager.asset @@ -17,7 +17,7 @@ PhysicsManager: m_EnableAdaptiveForce: 0 m_ClothInterCollisionDistance: 0.1 m_ClothInterCollisionStiffness: 0.2 - m_LayerCollisionMatrix: efffffffefffffffefffffffefffffffc020bbffefffffffffffffffffffffffefffffffefffffffefffffffefffffffefffffffffffffffefffffffefffffffffffffffffffffffefffffffffffffffffffffffffffffffefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + m_LayerCollisionMatrix: efffffffefffffffefffffffefffffffc020bbffefffffffffffffffffffffffefffffffefffffffefffffffefffffffefffffffffffffffef7fffffef3ff3ffffffffffffffffffef7fffffff7fffffffffffffffffffffefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff m_SimulationMode: 0 m_AutoSyncTransforms: 0 m_ReuseCollisionCallbacks: 1 diff --git a/ProjectSettings/TagManager.asset b/ProjectSettings/TagManager.asset index e6060ad72..fa9c3cb92 100644 --- a/ProjectSettings/TagManager.asset +++ b/ProjectSettings/TagManager.asset @@ -33,13 +33,13 @@ TagManager: - - - WaterMask - - PW_VFX - - PW_Object_Small - - PW_Object_Medium - - PW_Object_Large + - + - + - + - - - Player - - Interactive + - Gear - - - Boat