37 lines
1.0 KiB
C#
37 lines
1.0 KiB
C#
namespace Gameplay.Summon
|
|
{
|
|
using Gameplay.Area;
|
|
using Gameplay.Bullet;
|
|
using LTGame;
|
|
|
|
public class SummonStateMineBoom : BaseSummonState
|
|
{
|
|
private readonly SummonMine _mine;
|
|
|
|
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 boomDistance = _mine.boomDistance;
|
|
|
|
// 根据作用区域筛选目标
|
|
var selectIndexs = AreaManager.instance.GetCellIndexsAround(owner.transData.cellIndex, boomDistance);
|
|
|
|
for (var i = 0; i < selectIndexs.Count; ++i)
|
|
{
|
|
var cellIndex = selectIndexs[i];
|
|
BulletManager.instance.EmitBulletFromSummon(bulletId, cellIndex, _mine);
|
|
}
|
|
}
|
|
}
|
|
}
|