Merge pull request 'fix move on ground.' (#80) from feature/HP_jump into develop

Reviewed-on: https://git.brew.monster/Unity/perfect-world-unity/pulls/80
This commit is contained in:
tungdv
2025-12-13 12:41:32 +00:00
5 changed files with 43 additions and 7 deletions
+24 -3
View File
@@ -290,6 +290,21 @@ namespace BrewMonster
//bool hasHit = CollideWithEnv_BoxCast(vStart, vDelta, vExt, mask,
// out RaycastHit hit, out float fFraction, out Vector3 hitNormal, out bool bStartSolid);
Vector3 posFoot = vStart - Vector3.up * vExt.y;
//if (Physics.BoxCast(vStart, vExt, (vStart + Vector3.down).normalized, out RaycastHit hit1, Quaternion.identity, vExt.y, mask))
//{
// if (hit1.point.y > posFoot.y)
// {
// Debug.LogError("hit.point.y > posFoot.y");
// posFoot.y = hit1.point.y;
// }
//}
if (Physics.Raycast(vStart, (vStart + Vector3.down).normalized, out RaycastHit hit1, vExt.y, mask))
{
if (hit1.point.y > posFoot.y)
{
posFoot.y = hit1.point.y;
}
}
bool bClear = !Physics.Raycast(posFoot, (posFoot + vDelta).normalized, out RaycastHit hit, fDeltaDist, mask);
nTry++;
if (bClear)
@@ -305,8 +320,6 @@ namespace BrewMonster
// if (CDRInfo.vTPNormal.y < CDRInfo.fSlopeThresh) CDRInfo.vTPNormal = Vector3.up;
// return;
//}
Debug.DrawLine(posFoot, hit.point, Color.green, 10f);
vStart = hit.point + Vector3.up * vExt.y;
vFinalPos = vStart;
//CDRInfo.fMoveDist += (fDeltaDist * fFraction);
@@ -319,7 +332,15 @@ namespace BrewMonster
//float skin = 0.01f;
posFoot = vStart - Vector3.up * vExt.y + Vector3.up * CDRInfo.fStepHeight;
Vector3 vStartUp = new Vector3(0f, CDRInfo.fStepHeight, 0f);
bPull = !Physics.Raycast(posFoot, (posFoot + vStartUp).normalized, out hit, CDRInfo.fStepHeight, mask);
//if (Physics.Raycast(vStart, (vStart + Vector3.down).normalized, out hit1, vExt.y, mask))
//{
// if (hit1.point.y > posFoot.y)
// {
// Debug.LogError("hit.point.y > posFoot.y");
// posFoot.y = hit1.point.y + CDRInfo.fStepHeight;
// }
//}
bPull = !Physics.Raycast(posFoot, (Vector3.up).normalized, out hit, CDRInfo.fStepHeight, mask);
if (bPull)
{
vStart += Vector3.up * CDRInfo.fStepHeight;
+2 -2
View File
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7d0c92bda31fb016ed4bbb1b3670ed7cce73d854e25ddac2abb3d36277a2e4a2
size 200515696
oid sha256:5f0e60c802cf01eacf4cb214f00e8b7e04dcae61d68d6ed1ce599f2ee0f09db9
size 200516379
+2 -1
View File
@@ -49,7 +49,8 @@ public partial class CECGameRun
// glb_ErrorOutput(ECERR_FAILEDTOCALL, "CECGameRun::Init", __LINE__);
// return false;
//}
m_InstTab.Add(161, new CECInstance());
if(!m_InstTab.ContainsKey(161))
m_InstTab.Add(161, new CECInstance());
AddressableManager.Instance.OnDispose += Dispose;
}
+14
View File
@@ -437,6 +437,7 @@ namespace BrewMonster
case int value when value == EC_MsgDef.MSG_HST_OWNEXTPROP: OnMsgHstExtProp(Msg); break;
case int value when value == EC_MsgDef.MSG_HST_TARGETISFAR: OnMsgHstTargetIsFar(Msg); break;
}
@@ -4770,6 +4771,19 @@ namespace BrewMonster
m_BasicProps.iResilience = pCmd.resilience;
m_BasicProps.iVigour = pCmd.vigour;
}
void OnMsgHstTargetIsFar( ECMSG Msg)
{
// TO DO: fix later
//if(CmdNormalAttack(true, m_pComboSkill != null, 0, -1) )
// AP_ActionEvent(AP_EVENT_MELEEOUTOFRANGE, 1);
if (CmdNormalAttack(true, false, 0, -1))
{
//AP_ActionEvent(AP_EVENT_MELEEOUTOFRANGE, 1);
}
}
}
public enum StateAnim
+1 -1
View File
@@ -12,7 +12,7 @@ TagManager:
- Water
- UI
- Terrain
- Bush
- Brush
-
-
-