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

38 lines
1.0 KiB
C#

using Gameplay.Area;
using Gameplay.Bullet;
using LTGame;
namespace Gameplay.Summon
{
public class SummonStateMine2Boom : BaseSummonState
{
private readonly SummonMine2 _mine2;
public SummonStateMine2Boom(SummonMine2 owner) : base(owner, ESummonState.MineBoom)
{
_mine2 = owner;
}
protected override void _OnEnter(NBaseState exitState, object param)
{
base._OnEnter(exitState, param);
isFinished = true;
nextState = ESummonState.WaitRemove;
var bulletId = _mine2.emitBulletId;
var areaId = _mine2.areaId;
// 根据作用区域筛选目标
var selectIndexs = AreaManager.instance.GetCellIndexs(owner.transData.cellIndex, areaId);
for (var i = 0; i < selectIndexs.Count; ++i)
{
var cellIndex = selectIndexs[i];
BulletManager.instance.EmitBulletFromSummon(bulletId, cellIndex, _mine2);
}
}
}
}