NLDClient-yudde/ProjectNLD/Assets/Code/Scripts/Gameplay/PlayerSkill/Logic/PlayerSkillLogic08.cs

35 lines
970 B
C#

using Gameplay.Area;
using Gameplay.Bullet;
using Gameplay.Unit.Data;
namespace Gameplay.PlayerSkill.Logic
{
public class PlayerSkillLogic08 : BasePlayerSkillLogic
{
protected override void _OnInit()
{
base._OnInit();
var bulletId = owner.ReadParamInt(0);
var selectCellIndex = owner.selectedCellIndex;
var units = AreaManager.instance.GetUnitsByCellIndex(selectCellIndex);
foreach (var unit in units)
{
if (unit.commonData.troopId != owner.playerUnit.commonData.troopId)
{
continue;
}
if (unit.gameunitType != EGameUnitType.Vehicle)
{
continue;
}
BulletManager.instance.EmitBullet(bulletId, unit, owner.playerUnit);
break;
}
isFinished = true;
}
}
}