NLDClient-yudde/ProjectNLD/Assets/Code/Scripts/Gameplay/Summon/Impl/SummonLightUp.cs

47 lines
1.3 KiB
C#

using cfg.SummonCfg;
using Gameplay.Summon.Logic;
using Gameplay.Unit;
namespace Gameplay.Summon
{
public class SummonLightUp : LogicCombineSummon
{
public int targetCellIndex;
public int lightUpDistance;
public SummonLightUp(DataSummon configData, uint id, GameUnit creator)
: base(configData, id, creator)
{
lightUpDistance = _ReadIntParam(0);
}
private void _AutoReadTargetCellIndex()
{
if (creator is Character.Character unitCharacter)
{
var skillTargetCellIndex = unitCharacter.controlData.skillCellIndex;
targetCellIndex = skillTargetCellIndex;
}
else
{
DebugUtil.LogError("SummonLightUp: creator is not a Character, cannot auto read target cell index");
targetCellIndex = transData.cellIndex;
}
}
protected override void _OnInited()
{
base._OnInited();
_AutoReadTargetCellIndex();
var lightUpLogic = new SLogicLightUpArea(this);
lightUpLogic.targetCellIndex = targetCellIndex;
lightUpLogic.lightUpDistance = lightUpDistance;
_AddLogic(lightUpLogic);
}
}
}