using System.Collections.Generic; using Gameplay.Area; using Gameplay.Area.AttackArea; namespace Gameplay.Summon.Logic { public class SLogicSetSmoke : BaseSummonLogic { public int distance; public int centerCellIndex; private IList _cellIndexList; private IList _tempBlockDataList; public SLogicSetSmoke(BaseSummon summon) : base(summon) { _tempBlockDataList = new List(); } protected override void _OnInit() { base._OnInit(); _tempBlockDataList.Clear(); _cellIndexList = AreaManager.instance.GetCellIndexsAround(centerCellIndex, distance, true); for (int i = 0; i < _cellIndexList.Count; i++) { var cellIndex = _cellIndexList[i]; var hasBlock = AreaManager.instance.attackAreaManager.CheckHasBlockAttackCell(cellIndex); if (hasBlock) continue; var tempBlock = AreaManager.instance.attackAreaManager.CreateBlockAttackCell(cellIndex); _tempBlockDataList.Add(tempBlock); } } protected override void _OnDispose() { base._OnDispose(); for (int i = 0; i < _tempBlockDataList.Count; i++) { var tempBlock = _tempBlockDataList[i]; if (tempBlock != null) { AreaManager.instance.attackAreaManager.RemoveBlockAttackCell(tempBlock.blockCellIndex); } } } } }