yyl
2025-08-08 3bc28c54e82721b7858eaa3507f0f65a4041736d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System;
using System.Collections.Generic;
using UnityEngine;
 
public class BulletCurveFactory
{
    // 1·直线消失于目标
    // 2·直线贯穿消失在屏幕外
    // 3·抛物线弧线
    // 4·弹射
    // 5·透明
 
    public static BulletCurve CreateBulletCurve(
        BattleObject caster,
        SkillConfig skillConfig,
        EffectPlayer bulletEffect,
        RectTransform target,
        HB427_tagSCUseSkill tagUseSkillAttack,
        Action<int, List<HB427_tagSCUseSkill.tagSCUseSkillHurt>> onHit)
    {
        switch (skillConfig.BulletPath)
        {
            case 1: // 直线消失于目标
                return new StraightBulletCurve(caster, skillConfig, bulletEffect, target, onHit);
            case 2: // 直线贯穿消失在屏幕外
                return new PenetrateBulletCurve(caster, skillConfig, bulletEffect, target, onHit);
            case 3: // 抛物线弧线
                return new BezierBulletCurve(caster, skillConfig, bulletEffect, target, onHit);
            case 4: // 弹射
                return new BounceBulletCurve(caster, skillConfig, bulletEffect, target, tagUseSkillAttack,onHit);
            default:
                return new BulletCurve(caster, skillConfig, bulletEffect, target, onHit);
        }
    }
}