yyl
2025-10-31 39001a600fcae2bcf27c225df8752d75fb92fef4
Main/System/Battle/SkillEffect/BulletCurve/BulletCurve.cs
@@ -12,21 +12,27 @@
    protected RectTransform target;
    protected Action<int, List<HB427_tagSCUseSkill.tagSCUseSkillHurt>> onHit;
    protected Vector2 bulletOffset = Vector2.zero;
    protected bool finished = false;
    protected float duration = 0f;
    protected float elapsed = 0f;
    protected int mBulletIndex;
    protected List<HB427_tagSCUseSkill.tagSCUseSkillHurt> hurts = new List<HB427_tagSCUseSkill.tagSCUseSkillHurt>();
    public BulletCurve(BattleObject caster, SkillConfig skillConfig, BattleEffectPlayer bulletEffect, RectTransform target, HB427_tagSCUseSkill tagUseSkillAttack, Action<int, List<HB427_tagSCUseSkill.tagSCUseSkillHurt>> onHit)
    public BulletCurve(BattleObject caster, SkillConfig skillConfig, BattleEffectPlayer bulletEffect, RectTransform target,
        List<HB427_tagSCUseSkill.tagSCUseSkillHurt> hurtList, int bulletIndex, Action<int, List<HB427_tagSCUseSkill.tagSCUseSkillHurt>> onHit)
    {
        this.caster = caster;
        this.skillConfig = skillConfig;
        this.bulletEffect = bulletEffect;
        this.target = target;
        this.onHit = onHit;
        this.bulletTrans = bulletEffect.transform as RectTransform;
        this.hurts = tagUseSkillAttack.HurtList.ToList();
        this.bulletTrans = bulletEffect.rectTrans;
        this.hurts = hurtList;
        this.mBulletIndex = bulletIndex;
        // 设置bulletTrans坐标为caster.heroRectTrans的世界坐标转换到bulletTrans父节点下的本地坐标
        if (bulletTrans != null && caster.heroRectTrans != null)
@@ -39,6 +45,11 @@
                null,
                out localPoint);
            bulletTrans.anchoredPosition = localPoint;
        }
        if (bulletEffect.effectConfig.effectPos != null && bulletEffect.effectConfig.effectPos.Length >= 2)
        {
            bulletOffset = new Vector2(bulletEffect.effectConfig.effectPos[0], bulletEffect.effectConfig.effectPos[1]);
        }
    }
@@ -69,7 +80,7 @@
    protected virtual void ReachTarget()
    {
        finished = true;
        onHit?.Invoke(0, hurts);
        onHit?.Invoke(mBulletIndex, hurts);
        caster.battleField.battleEffectMgr.RemoveEffect(skillConfig.BulletEffectId, bulletEffect);
    }