From eb27e5fd31f73b998a4bbd85511a31e40b8c61b7 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期五, 21 十一月 2025 17:03:47 +0800
Subject: [PATCH] 0312 关闭游戏内日志
---
Main/System/Battle/BattleObject/BattleObject.cs | 538 +++++++++++++++++++++++++++++++++++++++++------------------
1 files changed, 370 insertions(+), 168 deletions(-)
diff --git a/Main/System/Battle/BattleObject/BattleObject.cs b/Main/System/Battle/BattleObject/BattleObject.cs
index 6c28854..cc5192c 100644
--- a/Main/System/Battle/BattleObject/BattleObject.cs
+++ b/Main/System/Battle/BattleObject/BattleObject.cs
@@ -30,21 +30,47 @@
{
public BattleField battleField;
- public int BattleObjectId { get; set; }
+ public BattleObjectBuffMgr buffMgr;
+
+ public BattleObjectLayerMgr layerMgr;
+
+ public int ObjID { get; set; }
public BattleCamp Camp { get; protected set; }
public TeamHero teamHero { get; protected set; }
- // public BuffMgr buffMgr;
-
- protected MotionBase motionBase;
+ public MotionBase motionBase;
public GameObject heroGo
{
get;
private set;
}
+
+ protected BattleDrops m_battleDrops;
+
+ private RectTransform m_heroRectTrans;
+
+
+ public RectTransform heroRectTrans
+ {
+ get
+ {
+ if (m_heroRectTrans == null)
+ {
+ m_heroRectTrans = heroGo.GetComponent<RectTransform>();
+ }
+ return m_heroRectTrans;
+ }
+ }
+
+ protected Action onDeathAnimationComplete;
+
+ protected Renderer[] renderers;
+
+ private List<HB405_tagMCAddExp> hB405_tagMCAddExps = new List<HB405_tagMCAddExp>();
+ public BattleHeroInfoBar heroInfoBar;
public BattleObject(BattleField _battleField)
{
@@ -57,14 +83,42 @@
teamHero = _teamHero;
Camp = _camp;
motionBase = new MotionBase();
- motionBase.Init(heroGo.GetComponentInChildren<SkeletonGraphic>(true));
- }
+ motionBase.Init(heroGo.GetComponentInChildren<SkeletonAnimation>(true));
+ buffMgr = new BattleObjectBuffMgr();
+ buffMgr.Init(this);
+ buffMgr.onIsControlChanged += OnControledChange;
+
+ layerMgr = new BattleObjectLayerMgr();
+ layerMgr.Init(this);
+
+ renderers = heroGo.GetComponentsInChildren<Renderer>(true);
+
+ heroInfoBar = heroGo.GetComponentInChildren<BattleHeroInfoBar>(true);
+ heroInfoBar.SetBattleObject(this);
+
+ // 鏍规嵁闃佃惀缈昏浆琛�鏉�
+ var heroInfoBarScale = heroInfoBar.transform.localScale;
+ heroInfoBarScale.x *= Camp == BattleCamp.Red ? 1 : -1;
+ heroInfoBar.transform.localScale = heroInfoBarScale;
+ if (battleField is StoryBattleField && (battleField as StoryBattleField).battleState == StoryBattleState.Break)
+ {
+ //涓荤嚎鍏冲崱浼戞伅涓殑涓嶆樉绀鸿鏉�
+ heroInfoBar.SetActive(false);
+ }
+ else
+ {
+ heroInfoBar.SetActive(true);
+ }
+ SetFront();
+ }
public virtual void Run()
{
motionBase.Run();
+ heroInfoBar.Run();
+ buffMgr.Run();
}
public virtual void Pause()
@@ -79,17 +133,95 @@
public virtual void Destroy()
{
+
+ motionBase.Release();
+ motionBase = null;
+ buffMgr.onIsControlChanged -= OnControledChange;
+ buffMgr.Release();
+ buffMgr = null;
+ teamHero = null;
+ ObjID = 0;
+
if (heroGo != null)
{
GameObject.DestroyImmediate(heroGo);
heroGo = null;
}
-
- motionBase.Release();
- motionBase = null;
- teamHero = null;
- BattleObjectId = 0;
}
+
+ // 鏈夊彉鍖栦簡鎵嶄細璋冪敤杩欎釜鍑芥暟
+ private void OnControledChange(int groupType, bool value)
+ {
+ // 杩欓噷鏄彈鍒扮‖鎺ф椂鍊� 闇�瑕佽〃鐜扮殑鍔ㄧ敾
+ if (groupType == BattleConst.HardControlGroup)
+ {
+ // 浠庢病琚‖鎺у埌琚‖鎺�
+ if (value)
+ {
+ motionBase.SetControledAnimation();
+ }
+ else
+ {
+ motionBase.CancelControledAnimation();
+ }
+ }
+ }
+
+ public void OnObjInfoRefresh(H0418_tagObjInfoRefresh _refreshInfo)
+ {
+ // 澶╁瓙鐨勬寫鎴樻嫤鎴鏉�,涓嶆嫤鎴�掓皵
+ BattleObject boss = battleField.FindBoss();
+ if (boss != null && battleField.MapID == 30020 && boss.ObjID == _refreshInfo.ObjID && _refreshInfo.RefreshType != (ushort)PlayerDataType.XP)
+ return;
+ switch ((PlayerDataType)_refreshInfo.RefreshType)
+ {
+ case PlayerDataType.HP:
+ long toHp = GeneralDefine.GetFactValue(_refreshInfo.Value, _refreshInfo.ValueEx);
+ heroInfoBar.UpdateHP(teamHero.curHp, toHp, teamHero.maxHp, false);
+ teamHero.curHp = GeneralDefine.GetFactValue(_refreshInfo.Value, _refreshInfo.ValueEx);
+ break;
+ case PlayerDataType.MaxHP:
+ teamHero.maxHp = GeneralDefine.GetFactValue(_refreshInfo.Value, _refreshInfo.ValueEx);
+ heroInfoBar.UpdateHP(teamHero.curHp, teamHero.curHp, teamHero.maxHp, false);
+ break;
+ case PlayerDataType.XP:
+ long toXp = GeneralDefine.GetFactValue(_refreshInfo.Value, _refreshInfo.ValueEx);
+ heroInfoBar.UpdateXP(teamHero.rage, toXp, 100);
+ teamHero.rage = (int)GeneralDefine.GetFactValue(_refreshInfo.Value, _refreshInfo.ValueEx);
+ break;
+ default:
+ Debug.LogError("BattleObject.ObjInfoRefresh 鍑虹幇鎰忓绫诲瀷 " + _refreshInfo.RefreshType.ToString());
+ break;
+ }
+ }
+
+ // public void ObjPropertyRefreshView(HB418_tagSCObjPropertyRefreshView vNetData)
+ // {
+ // // 澶╁瓙鐨勬寫鎴樻嫤鎴鏉�,涓嶆嫤鎴�掓皵
+ // BattleObject boss = battleField.FindBoss();
+ // if (boss != null && battleField.MapID == 30020 && boss.ObjID == vNetData.ObjID && vNetData.RefreshType != (ushort)PlayerDataType.XP)
+ // return;
+ // switch ((PlayerDataType)vNetData.RefreshType)
+ // {
+ // case PlayerDataType.HP:
+ // long toHp = GeneralDefine.GetFactValue(vNetData.Value, vNetData.ValueEx);
+ // heroInfoBar.UpdateHP(teamHero.curHp, toHp, teamHero.maxHp, false);
+ // teamHero.curHp = GeneralDefine.GetFactValue(vNetData.Value, vNetData.ValueEx);
+ // break;
+ // case PlayerDataType.MaxHP:
+ // teamHero.maxHp = GeneralDefine.GetFactValue(vNetData.Value, vNetData.ValueEx);
+ // heroInfoBar.UpdateHP(teamHero.curHp, teamHero.curHp, teamHero.maxHp, false);
+ // break;
+ // case PlayerDataType.XP:
+ // long toXp = GeneralDefine.GetFactValue(vNetData.Value, vNetData.ValueEx);
+ // heroInfoBar.UpdateXP(teamHero.rage, toXp, 100);
+ // teamHero.rage = (int)GeneralDefine.GetFactValue(vNetData.Value, vNetData.ValueEx);
+ // break;
+ // default:
+ // Debug.LogError("BattleObject.ObjPropertyRefreshView 鍑虹幇鎰忓绫诲瀷 " + vNetData.RefreshType.ToString());
+ // break;
+ // }
+ // }
// 鐪╂檿
public bool IsStunned()
@@ -108,12 +240,6 @@
{
return teamHero.isStoned;
}
-
- // // 绂侀敘
- // public bool IsConfined()
- // {
- // return false;
- // }
// 琚矇榛�
public bool IsSlient()
@@ -180,199 +306,275 @@
return true;
}
- public virtual void TakeDamage(List<int> damageValues)
+ public virtual void Hurt(BattleHurtParam battleHurtParam)
{
- if (IsDead())
- return;
+ bool isLastHit = battleHurtParam.hitIndex >= battleHurtParam.skillConfig.DamageDivide.Length - 1;
+ bool firstHit = battleHurtParam.hitIndex == 0;
+ BattleDmgInfo dmgInfo = PopDamage(battleHurtParam);
- PopDamage(damageValues);
- motionBase.PlayAnimation(MotionName.hit, false);
-
- // 璁$畻浼ゅ
- int totalDamage = 0;
- foreach (var damage in damageValues)
+ // 杩欓噷
+ if (dmgInfo.IsType(DamageType.Dodge) /*&& !buffMgr.isControled[BattleConst.HardControlGroup]*/)//濡傛灉琚帶鍒朵簡杩橀棯閬夸簡 瑕佺湅鐪嬫湇鍔″櫒鎬庝箞澶勭悊浜�
{
- totalDamage += damage;
+ if (isLastHit)
+ {
+ DodgeFinishAction dodgeFinish = new DodgeFinishAction(battleField, this);
+ battleField.recordPlayer.InsertRecord(dodgeFinish);
+ }
+
+ if (firstHit)
+ {
+ OnDodgeBegin();
+ }
}
- // 鎵h
- teamHero.curHp -= totalDamage;
- // 鍏跺疄杩欓噷搴旇鏄瓑鏈嶅姟鍣ㄥ彂death鐨刟ction
- // if (IsDead())
- // {
- // OnDeath();
- // }
-
+ bool isFatalAttack = (null != battleHurtParam.deadPack) && isLastHit;
+
+ if (isFatalAttack)
+ {
+ if (null != battleHurtParam.battleDrops)
+ {
+ PushDropItems(battleHurtParam.battleDrops);
+ }
+ battleField.OnObjsDead(new List<HB422_tagMCTurnFightObjDead>() { battleHurtParam.deadPack });
+
+ }
+ else
+ {
+ if (dmgInfo.IsType(DamageType.Block))
+ {
+ battleField.battleEffectMgr.PlayEffect(this, 19999, heroRectTrans, Camp);
+ }
+ // else
+ // {
+ if ((dmgInfo.IsType(DamageType.Damage) || dmgInfo.IsRealdamage()))
+ {
+ if (!buffMgr.isControled[BattleConst.HardControlGroup])
+ {
+ motionBase.PlayAnimation(MotionName.hit, false);
+ }
+ }
+ // }
+
+ }
}
+
+ const float pingpongTime = 0.4f;
// 闂伩寮�濮�
public virtual void OnDodgeBegin()
{
- float pingpongTime = 0.2f;
- RectTransform rectTrans = heroGo.GetComponent<RectTransform>();
- rectTrans.DOAnchorPos(new Vector3(-50, 50, 0), pingpongTime)
+ RectTransform rectTrans = heroRectTrans;
+ var tween = rectTrans.DOAnchorPos(new Vector3(-30, 0, 0), pingpongTime)
.SetEase(Ease.OutCubic);
+
+ motionBase.ShowIllusionShadow(true);
+
+ DamageNumConfig damageNumConfig = DamageNumConfig.Get((int)DamageType.Dodge);
+
+ string dodgeStr = ((char)damageNumConfig.prefix).ToString();
+
+ heroInfoBar.ShowTips(dodgeStr, true, false);
+
+ tween.onComplete += () =>
+ {
+ motionBase.ShowIllusionShadow(false);
+ };
+
+ battleField.battleTweenMgr.OnPlayTween(tween);
}
// 闂伩缁撴潫
- public virtual void OnDodgeEnd()
+ public virtual void OnDodgeEnd(Action _complete = null)
{
- float pingpongTime = 0.2f;
- RectTransform rectTrans = heroGo.GetComponent<RectTransform>();
- rectTrans.DOAnchorPos(Vector3.zero, pingpongTime)
+ RectTransform rectTrans = heroRectTrans;
+
+ var tween = rectTrans.DOAnchorPos(Vector3.zero, pingpongTime)
.SetEase(Ease.OutCubic);
- }
- protected virtual void OnDeath()
- {
- motionBase.OnOtherAnimationComplete = OnOtherAnimationComplete;
- motionBase.PlayAnimation(MotionName.dead, false);
- }
-
- protected virtual void OnOtherAnimationComplete(MotionName motionName)
- {
- if (motionName == MotionName.dead)
+ tween.onComplete += () =>
{
+ _complete?.Invoke();
+ };
+
+ battleField.battleTweenMgr.OnPlayTween(tween);
+ }
+
+ public virtual void OnDeath(Action _onDeathAnimationComplete)
+ {
+ buffMgr.RemoveAllBuff();
+ motionBase.PlayDeadAnimation(() =>
+ {
+ teamHero.isDead = true;
OnDeadAnimationComplete();
- }
+ _onDeathAnimationComplete?.Invoke();
+ });
}
protected virtual void OnDeadAnimationComplete()
{
// 鎴栬鐪嬬湅婧惰В鐗规晥锛� YYL TODO
heroGo.SetActive(false);
+
+ // 闃叉缁欐浜″璞″張涓奲uff
+ buffMgr.RemoveAllBuff();
}
- // 浼ゅ杩樿鐪� 鏄惁闂伩 鏆村嚮 and so on 闇�瑕佹湁涓�涓狣amageType 鏈嶅姟鍣ㄥ簲璇ヤ細缁�
- protected virtual void PopDamage(List<int> damageValues)
+ public void OnReborn(HB423_tagMCTurnFightObjReborn vNetData)
{
- // 鍏跺疄搴旇閫氱煡鍑哄幓缁橴I鐣岄潰瑙h�� 璁︰I鐣岄潰鑷繁鏉ユ樉绀虹殑 YYL TODO
- // 鎾斁浼ゅ鏁板瓧
- // 杩欓噷鍙互瀹炵幇涓�涓激瀹虫暟瀛楃殑寮瑰嚭鏁堟灉
- // 姣斿浣跨敤涓�涓猆I缁勪欢鏉ユ樉绀轰激瀹虫暟瀛�
- foreach (var damage in damageValues)
- {
- Debug.Log($"Damage: {damage}");
- }
-
- EventBroadcast.Instance.Broadcast<BattleObject, List<int>>(EventName.BATTLE_DAMAGE_TAKEN, this, damageValues);
+ // 澶勭悊澶嶆椿閫昏緫
+ teamHero.curHp = GeneralDefine.GetFactValue(vNetData.HP, vNetData.HPEx);
+ teamHero.isDead = false;
+ heroGo.SetActive(true);
+ motionBase.PlayAnimation(MotionName.idle, true);
}
- public void PlaySkill(SkillConfig skillConfig, List<Dictionary<int, List<int>>> damageList, Action _onComplete)
+ // 浼ゅ杩樿鐪� 鏄惁闂伩 鏆村嚮 and so on 闇�瑕佹湁涓�涓狣amageType 鏈嶅姟鍣ㄥ簲璇ヤ細缁�
+ protected virtual BattleDmgInfo PopDamage(BattleHurtParam battleHurtParam)
{
- bool moveToTarget = true;
-
- if (moveToTarget)
+ BattleDmgInfo battleDmgInfo = new BattleDmgInfo(battleField.guid, battleHurtParam);
+ // 澶╁瓙鐨勬寫鎴樻嫤鎴鏉¢�昏緫
+ BattleObject boss = battleField.FindBoss();
+ if (boss != null && battleField.MapID == 30020 && boss.ObjID == battleHurtParam.hurtObj.ObjID)
{
- int targetId = damageList[0].First().Key;
- BattleObject _targetObj = battleField.battleObjMgr.GetBattleObject(targetId);
-
- RectTransform selfRect = heroGo.GetComponent<RectTransform>();
- RectTransform targetRect = _targetObj.heroGo.GetComponent<RectTransform>();
- Vector2 curAnchoredPos = selfRect.anchoredPosition;
-
- MoveToTargetUI(selfRect, targetRect, new Vector2(100f, 0f), () =>
- {
- PlaySkillAnimation(skillConfig, damageList, () =>
- {
- // 鍥炲埌鍘熶綅缃�
- selfRect.DOAnchorPos(curAnchoredPos, 0.2f)
- .SetEase(Ease.Linear)
- .OnComplete(() => {
- _onComplete?.Invoke();
- });
- });
- });
+ EventBroadcast.Instance.Broadcast(EventName.BATTLE_DAMAGE_TAKEN, battleDmgInfo);
+ return battleDmgInfo;
}
else
{
- PlaySkillAnimation(skillConfig, damageList, _onComplete);
+ heroInfoBar.UpdateDamage(battleDmgInfo);
+
+ // YYL TODO 鏄惁闇�瑕佹寕鍦ㄥ湪鑷韩鐨刦ollow鐐逛笂
+ EventBroadcast.Instance.Broadcast(EventName.BATTLE_DAMAGE_TAKEN, battleDmgInfo);
+ return battleDmgInfo;
+ }
+
+ }
+
+ public RectTransform GetAliasTeamNode()
+ {
+ return battleField.GetTeamNode(Camp);
+ }
+
+ public RectTransform GetEnemyTeamNode()
+ {
+ return battleField.GetTeamNode(Camp == BattleCamp.Red ? BattleCamp.Blue : BattleCamp.Red);
+ }
+
+ public BattleCamp GetEnemyCamp()
+ {
+ return Camp == BattleCamp.Red ? BattleCamp.Blue : BattleCamp.Red;
+ }
+
+ public void HaveRest()
+ {
+ // YYL TODO
+ // 浼戞伅鐘舵��
+ // 澶氫竴涓獄zz鐨勪竴涓壒鏁�
+ heroGo.SetActive(true);
+ motionBase.HaveRest();
+ heroRectTrans.anchoredPosition = Vector2.zero;
+
+ heroInfoBar.SetActive(false);
+ SetFront();
+ }
+
+ public void PushDropItems(BattleDrops _battleDrops)
+ {
+ m_battleDrops = _battleDrops;
+ }
+
+ public void PerformDrop()
+ {
+ if (null == m_battleDrops)
+ return;
+
+ EventBroadcast.Instance.Broadcast<string, BattleDrops, Action>(
+ EventName.BATTLE_DROP_ITEMS, battleField.guid, m_battleDrops, OnPerformDropFinish);
+ }
+
+ protected void OnPerformDropFinish()
+ {
+ m_battleDrops = null;
+ }
+
+ public void SetBack()
+ {
+ layerMgr.SetBack();
+ }
+
+ public void SetFront()
+ {
+ layerMgr.SetFront();
+ }
+
+ public void SetSpeedRatio(float ratio)
+ {
+ motionBase.SetSpeedRatio(ratio);
+ heroInfoBar.SetSpeedRatio(ratio);
+ }
+
+ public void OnObjPropertyRefreshView(HB418_tagSCObjPropertyRefreshView vNetData)
+ {
+ // 澶╁瓙鐨勬寫鎴樻嫤鎴鏉�,涓嶆嫤鎴�掓皵
+ BattleObject boss = battleField.FindBoss();
+ if (boss != null && battleField.MapID == 30020 && boss.ObjID == vNetData.ObjID && vNetData.RefreshType != (ushort)PlayerDataType.XP)
+ return;
+
+ // public uint ObjID;
+ // public ushort RefreshType; // 鍚�0418鍒锋柊绫诲瀷锛屽琛�閲忋�佹�掓皵
+ // public uint AttackTypes; // 椋樺瓧绫诲瀷姹囨�伙紝鏀寔澶氱绫诲瀷骞跺瓨锛屽鏃犺闃插尽涓旀毚鍑诲悓鏃惰鏍兼尅锛屼簩杩涘埗鎴栬繍绠楁渶缁堝�硷紱0-澶辫触锛�1-鏅�氾紱2-鍥炶锛�5-鏍兼尅锛�6-鏃犺闃插尽锛�7-鏆村嚮锛�9-闂伩
+ // public uint Value; // 鏇存柊鍊�
+ // public uint ValueEx; // 鏇存柊鍊硷紝濡傛灉鏄ぇ鏁板�肩殑姝ゅ�间负鏁撮櫎浜块儴鍒�
+ // public byte DiffType; // 鍙樺寲绫诲瀷锛�0-鍑忓皯锛�1-澧炲姞
+ // public uint DiffValue; // 鍙樺寲鍊�
+ // public uint DiffValueEx; // 鍙樺寲鍊硷紝濡傛灉鏄ぇ鏁板�肩殑姝ゅ�间负鏁撮櫎浜块儴鍒�
+ // public uint SkillID; // 浣跨敤鐨勬妧鑳借〃ID
+ // public uint RelatedSkillID; // 鍏宠仈鐨勬妧鑳絀D锛屼竴鑸槸涓绘妧鑳絀D锛岄潪涓绘妧鑳介澶栬Е鍙戠殑涓�0
+
+ long diffValue = GeneralDefine.GetFactValue(vNetData.DiffValue, vNetData.DiffValueEx);
+ diffValue *= vNetData.DiffType == 0 ? -1 : 1;
+
+ long newValue = GeneralDefine.GetFactValue(vNetData.Value, vNetData.ValueEx);
+
+
+ switch ((PlayerDataType)vNetData.RefreshType)
+ {
+ case PlayerDataType.HP:
+ long toHp = GeneralDefine.GetFactValue(vNetData.Value, vNetData.ValueEx);
+ heroInfoBar.UpdateHP(teamHero.curHp, toHp, teamHero.maxHp, true);
+ teamHero.curHp = newValue;
+ break;
+ case PlayerDataType.MaxHP:
+ teamHero.maxHp = newValue;
+ heroInfoBar.UpdateHP(teamHero.curHp, teamHero.curHp, teamHero.maxHp, true);
+ break;
+ case PlayerDataType.XP:
+ long toXp = newValue;
+ heroInfoBar.UpdateXP(teamHero.rage, toXp, 100);
+ teamHero.rage = (int)newValue;
+
+ DamageNumConfig damageNumConfig = DamageNumConfig.Get((int)DamageType.RageUp);
+ string message = BattleUtility.ConvertToArtFont(damageNumConfig, diffValue);
+ heroInfoBar.ShowTips(new BattleHeroInfoBar.TipsInfo()
+ {
+ message = message,
+ useArtText = true,
+ followCharacter = true,
+ scaleRatio = 1f,
+ isRage = true
+ });
+ break;
+ default:
+ Debug.LogError("BattleObject.ObjPropertyRefreshView 鍑虹幇鎰忓绫诲瀷 " + vNetData.RefreshType.ToString());
+ break;
}
}
- protected void MoveToTargetUI(RectTransform selfRect, RectTransform targetRect, Vector2 offset, Action _onComplete)
- {
- // 1. 鐩爣鐨勬湰鍦板潗鏍囪浆涓轰笘鐣屽潗鏍�
- Vector3 targetWorldPos = targetRect.TransformPoint(targetRect.anchoredPosition + offset);
- // 2. 涓栫晫鍧愭爣杞负鑷繁鐖惰妭鐐逛笅鐨勬湰鍦板潗鏍�
- RectTransform parentRect = selfRect.parent as RectTransform;
- Vector2 targetAnchoredPos;
- RectTransformUtility.ScreenPointToLocalPointInRectangle(
- parentRect,
- RectTransformUtility.WorldToScreenPoint(null, targetWorldPos),
- null,
- out targetAnchoredPos);
-
- // 3. DOTween 绉诲姩
- selfRect.DOAnchorPos(targetAnchoredPos, 0.2f)
- .SetEase(Ease.Linear)
- .OnComplete(() => _onComplete?.Invoke());
- }
-
-
- protected void PlaySkillAnimation(SkillConfig skillConfig, List<Dictionary<int, List<int>>> damageList, Action _onComplete)
- {
-
- // 鍏抽敭甯у垪琛�
- List<int> keyFrameList = new List<int>() { 15 };
- motionBase.OnAttackHitEvent = (int _frame) =>
- {
- Dictionary<int, List<int>> oneRoundDamage = damageList[keyFrameList.IndexOf(_frame)];
-
- foreach (var kvp in oneRoundDamage)
- {
- int targetId = kvp.Key;
- List<int> damageValues = kvp.Value;
-
- BattleObject targetObj = battleField.battleObjMgr.GetBattleObject(targetId);
- if (targetObj != null && !targetObj.IsDead())
- {
- targetObj.TakeDamage(damageValues);
- }
- }
- };
-
- motionBase.OnAttackAnimationComplete = () =>
- {
- _onComplete?.Invoke();
-
- motionBase.OnAttackHitEvent = null;
- motionBase.OnAttackAnimationComplete = null;
-
- // 姝讳骸纭畾鍏跺疄涓嶅簲璇ュ湪杩欓噷杩涜瑙﹀彂 搴旇鐢辨湇鍔″櫒涓嬪彂 YYL TODO
-
-#if UNITY_EDITOR
- // 鏆傛椂鐨勫鐞�
- HashSet<int> hitTargets = new HashSet<int>();
-
- foreach (var dmgDict in damageList)
- {
- foreach (var kvp in dmgDict)
- {
- int targetId = kvp.Key;
- hitTargets.Add(targetId);
- }
- }
-
- foreach (int targetId in hitTargets)
- {
- BattleObject targetObj = battleField.battleObjMgr.GetBattleObject(targetId);
- if (targetObj != null && targetObj.IsDead())
- {
- targetObj.OnDeath();
- }
- }
-#endif
- };
-
- motionBase.PlayAnimationEx(MotionName.attack, false, keyFrameList);
- }
-
-#if UNITY_EDITOR
+#if UNITY_EDITOR_STOP_USING
public void EditorRevive()
{
teamHero.curHp = 100;
--
Gitblit v1.8.0