NLDClient-yudde/ProjectNLD/Assets/Code/Scripts/Gameplay/Summon/State/SummonStateMineBoom.cs

46 lines
1.2 KiB
C#
Raw Normal View History

2023-08-22 19:08:45 +08:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Gameplay.Summon
{
using Framework;
using Gameplay.Area;
using Gameplay.Bullet;
using Gameplay.Common;
using Gameplay.Skill;
using LTGame;
public class SummonStateMineBoom : BaseSummonState
{
2023-10-19 15:00:19 +08:00
private readonly SummonMine _mine;
2023-08-22 19:08:45 +08:00
public SummonStateMineBoom(SummonMine owner) : base(owner, ESummonState.MineBoom)
{
_mine = owner;
}
protected override void _OnEnter(NBaseState exitState, object param)
{
base._OnEnter(exitState, param);
isFinished = true;
nextState = ESummonState.WaitRemove;
var bulletId = _mine.emitBulletId;
var areaId = _mine.areaId;
// 根据作用区域筛选目标
var selectIndexs = AreaManager.instance.GetCellIndexs(owner.transData.cellIndex, areaId);
for (var i = 0; i < selectIndexs.Count; ++i)
{
var cellIndex = selectIndexs[i];
2023-10-19 15:00:19 +08:00
BulletManager.instance.EmitBullet(bulletId, cellIndex, _mine);
2023-08-22 19:08:45 +08:00
}
}
}
}