35 lines
970 B
C#
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;
|
|
}
|
|
|
|
}
|
|
}
|