From a7548b443024413bf4a8417409b33205bac5bf80 Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期四, 23 十月 2025 15:53:25 +0800
Subject: [PATCH] 125 buff特效绑定节点偏移问题
---
Main/Component/UI/Effect/BattleEffectPlayer.cs | 28 ++++++++++++++++++++++++++++
1 files changed, 28 insertions(+), 0 deletions(-)
diff --git a/Main/Component/UI/Effect/BattleEffectPlayer.cs b/Main/Component/UI/Effect/BattleEffectPlayer.cs
index d740f15..3e3c0d2 100644
--- a/Main/Component/UI/Effect/BattleEffectPlayer.cs
+++ b/Main/Component/UI/Effect/BattleEffectPlayer.cs
@@ -30,6 +30,8 @@
}
}
+ private Bone followedBone;
+
public bool isBindBone = false;
public bool isRedCamp = true;
@@ -224,6 +226,31 @@
blocker.SetSortingOrder(finalSortingOrder);
+ }
+ }
+
+ public void FollowBoneXY()
+ {
+ if (followedBone == null || !isBindBone)
+ {
+ return;
+ }
+
+ Vector2 vector2 = Vector2.zero;
+
+ if (effectConfig.effectPos != null && effectConfig.effectPos.Length >= 2)
+ {
+ vector2 = new Vector2((isRedCamp ? 1f : -1f) * effectConfig.effectPos[0], effectConfig.effectPos[1]);
+ }
+
+ if (spineComp != null)
+ {
+ spineComp.transform.localPosition = new Vector3(followedBone.WorldX + vector2.x, followedBone.WorldY + vector2.y, 0);
+ }
+
+ if (effectTarget != null)
+ {
+ effectTarget.transform.localPosition = new Vector3(followedBone.WorldX + vector2.x, followedBone.WorldY + vector2.y, 0);
}
}
@@ -638,6 +665,7 @@
}
isBindBone = true;
+ followedBone = bone;
BoneFollower boneFollower = gameObject.AddMissingComponent<BoneFollower>();
boneFollower.boneName = v;
--
Gitblit v1.8.0