| | |
| | | |
| | | effectPlayer.Alpha = shotToSelf ? 0f : 1f; |
| | | |
| | | int bounceHitIndex = 0; |
| | | |
| | | var bulletCurve = BulletCurveFactory.CreateBulletCurve(caster, skillConfig, effectPlayer, target.heroRectTrans, tagUseSkillAttack.HurtList.ToList(), bulletIndex, (index, hitList) => |
| | | { |
| | | foreach (var hurt in hitList) |
| | | if (skillConfig.BulletPath == 4) |
| | | { |
| | | if (bounceHitIndex >= hitList.Count) |
| | | { |
| | | return; |
| | | } |
| | | var hurt = hitList[bounceHitIndex++]; |
| | | BattleObject targetObj = caster.battleField.battleObjMgr.GetBattleObject((int)hurt.ObjID); |
| | | if (targetObj == null) |
| | | if (targetObj != null) |
| | | { |
| | | PlayExplosionEffect(skillConfig.ExplosionEffectId, targetObj.heroGo.transform, caster.Camp); |
| | | PlayExplosionEffect(skillConfig.ExplosionEffect2, targetObj.heroGo.transform, caster.Camp); |
| | | PlayExplosionEffect(skillConfig.ExplosionEffect3, targetObj.heroGo.transform, caster.Camp); |
| | | PlayExplosionEffect(skillConfig.ExplosionEffect4, targetObj.heroGo.transform, caster.Camp); |
| | | } |
| | | else |
| | | { |
| | | Debug.LogError("目标为空 target == null ObjId : " + hurt.ObjID); |
| | | continue; |
| | | } |
| | | |
| | | PlayExplosionEffect(skillConfig.ExplosionEffectId, targetObj.heroGo.transform, caster.Camp); |
| | | PlayExplosionEffect(skillConfig.ExplosionEffect2, targetObj.heroGo.transform, caster.Camp); |
| | | PlayExplosionEffect(skillConfig.ExplosionEffect3, targetObj.heroGo.transform, caster.Camp); |
| | | PlayExplosionEffect(skillConfig.ExplosionEffect4, targetObj.heroGo.transform, caster.Camp); |
| | | } |
| | | // 表现子弹飞行到目标位置 |
| | | onHit?.Invoke(index, new List<HB427_tagSCUseSkill.tagSCUseSkillHurt> { hurt }); |
| | | |
| | | // 表现子弹飞行到目标位置 |
| | | onHit?.Invoke(index, hitList); |
| | | // 击中就销毁子弹 |
| | | caster.battleField.battleEffectMgr.RemoveEffect(skillConfig.BulletEffectId, effectPlayer); |
| | | if (bulletIndex == tagUseSkillAttack.HurtList.Length - 1) |
| | | { |
| | | caster.battleField.battleEffectMgr.RemoveEffect(skillConfig.BulletEffectId, effectPlayer); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | foreach (var hurt in hitList) |
| | | { |
| | | BattleObject targetObj = caster.battleField.battleObjMgr.GetBattleObject((int)hurt.ObjID); |
| | | if (targetObj == null) |
| | | { |
| | | Debug.LogError("目标为空 target == null ObjId : " + hurt.ObjID); |
| | | continue; |
| | | } |
| | | |
| | | PlayExplosionEffect(skillConfig.ExplosionEffectId, targetObj.heroGo.transform, caster.Camp); |
| | | PlayExplosionEffect(skillConfig.ExplosionEffect2, targetObj.heroGo.transform, caster.Camp); |
| | | PlayExplosionEffect(skillConfig.ExplosionEffect3, targetObj.heroGo.transform, caster.Camp); |
| | | PlayExplosionEffect(skillConfig.ExplosionEffect4, targetObj.heroGo.transform, caster.Camp); |
| | | } |
| | | |
| | | // 表现子弹飞行到目标位置 |
| | | onHit?.Invoke(index, hitList); |
| | | // 击中就销毁子弹 |
| | | |
| | | caster.battleField.battleEffectMgr.RemoveEffect(skillConfig.BulletEffectId, effectPlayer); |
| | | } |
| | | |
| | | if (isFinish) |
| | | return; |
| | |
| | | bulletCurves.Add(bulletCurve); |
| | | } |
| | | |
| | | |
| | | |
| | | protected void PlayExplosionEffect(int effectId, Transform parent, BattleCamp camp) |
| | | { |
| | | if (effectId <= 0) |