From 7143fd195e73b25dac2bded0bb41fac8769cfa2f Mon Sep 17 00:00:00 2001
From: client_Hale <339726288@qq.com>
Date: 星期四, 06 十二月 2018 18:04:47 +0800
Subject: [PATCH] 2589 【1.3.100】灵宠动作优化
---
Fight/GameActor/GAMgr.cs | 2 --
Fight/Actor/State/SMB/RunBase.cs | 10 ++++++++++
Core/NetworkPackage/DTCFile/ServerPack/H05_PlayerMove/DTC0501_tagObjMove.cs | 6 ++++--
3 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/Core/NetworkPackage/DTCFile/ServerPack/H05_PlayerMove/DTC0501_tagObjMove.cs b/Core/NetworkPackage/DTCFile/ServerPack/H05_PlayerMove/DTC0501_tagObjMove.cs
index 7e18a58..e63fe32 100644
--- a/Core/NetworkPackage/DTCFile/ServerPack/H05_PlayerMove/DTC0501_tagObjMove.cs
+++ b/Core/NetworkPackage/DTCFile/ServerPack/H05_PlayerMove/DTC0501_tagObjMove.cs
@@ -29,10 +29,12 @@
Vector3 _destPosition = new Vector3((vNetData.DestPosX - GA_Hero.MapOffset.x) * .5f, _actor.Pos.y, (vNetData.DestPosY - GA_Hero.MapOffset.z) * .5f);
-
if (_actor is GA_Pet)
{
- if (MathUtility.DistanceSqrtXZ(_destPosition, _actor.Pos) < 2f)
+ //float _distance = MathUtility.DistanceSqrtXZ(_destPosition, _actor.Pos);
+ //Debug.LogFormat("鏀跺埌瀹犵墿绉诲姩鍖�: {0} 褰撳墠鍧愭爣: {1}, 灏嗚绉诲姩鍒�: {2}, 褰撳墠璺濈: {3}", vNetData.ObjID, new Vector2((int)(_actor.Pos.x * 2), (int)(_actor.Pos.z * 2)),
+ // new Vector2(vNetData.DestPosX, vNetData.DestPosY), _distance);
+ if (MathUtility.DistanceSqrtXZ(_destPosition, _actor.Pos) < 0.2f)
{
return;
}
diff --git a/Fight/Actor/State/SMB/RunBase.cs b/Fight/Actor/State/SMB/RunBase.cs
index 3935efa..64468ca 100644
--- a/Fight/Actor/State/SMB/RunBase.cs
+++ b/Fight/Actor/State/SMB/RunBase.cs
@@ -13,6 +13,16 @@
{
base.OnUpdate(owner, animator, stateInfo, layerIndex);
+ if (owner is GA_Pet)
+ {
+ if (animator.IsInTransition(0)
+ && (animator.GetNextAnimatorStateInfo(0).shortNameHash == GAStaticDefine.State_IdleHash
+ || animator.GetNextAnimatorStateInfo(0).shortNameHash == GAStaticDefine.State_RunHash))
+ {
+ return;
+ }
+ }
+
if (owner.State != E_ActorState.AutoRun)
{
if (owner.destForward != Vector3.zero)
diff --git a/Fight/GameActor/GAMgr.cs b/Fight/GameActor/GAMgr.cs
index 0aa1f91..8ef7012 100644
--- a/Fight/GameActor/GAMgr.cs
+++ b/Fight/GameActor/GAMgr.cs
@@ -14,8 +14,6 @@
public Dictionary<int, string> s_NpcID2BundleName = new Dictionary<int, string>();
public Dictionary<int, string> s_NpcID2Assetname = new Dictionary<int, string>();
-
-
public event UnityAction<uint> OnGActorRequest;
public event UnityAction<uint> OnGActorServerDie;
--
Gitblit v1.8.0