修改Bug

This commit is contained in:
GL 2025-01-02 16:35:49 +08:00
parent 27b2f1b025
commit d198bb4790
2 changed files with 9 additions and 3 deletions

View File

@ -316,13 +316,13 @@ public class Attack : MonoBehaviour
if (attackCollider)
{
// 设置碰撞体的半径
attackCollider.radius = role.AttackRange;
attackCollider.radius = role.AttackRange-1;
// 计算缩放因子,使得图片的直径与碰撞体的直径匹配
characterClick.OrSizeX = role.AttackRange * 2f / characterClick.StartSizeX; // * 2f 因为 radius 是半径,图片的尺寸通常是直径
characterClick.OrSizeX = (role.AttackRange-1) * 2f / characterClick.StartSizeX; // * 2f 因为 radius 是半径,图片的尺寸通常是直径
characterClick.OrSizeY = characterClick.OrSizeX;
@ -346,6 +346,7 @@ public class Attack : MonoBehaviour
{
offSetX += 0.6f;
}
attackRangeSprite.transform.position = new Vector2(attackRangeSprite.transform.position.x - offSetX, attackRangeSprite.transform.position.y);
//characterClick.OrSizeY = 1;
Debug.Log("修改图片宽度");

View File

@ -88,9 +88,14 @@ public class Role : Fun
{
Hpfiil.fillAmount = hp / maxHp;
// 使用 DOTween 动画平滑过渡血条填充
DOTween.To(() => HpfiilYello.fillAmount, x => HpfiilYello.fillAmount = x, hp / maxHp, 0.8f) // 0.5f 为过渡时间
.SetEase(Ease.InOutQuad); // 使用缓动效果,使血条变化更加平滑
//if (UIContorl.instance.NowShowInfo!=null&&UIContorl.instance.NowShowInfo.Id == 1)
//{
// UIContorl.instance.NowShowInfo.UpDateShow("1", "Enemy_001", "0", "3", "1", "测试文档一", hp, maxHp);
//}
}
// 更新血量文本效果