64 lines
1.9 KiB
C#
64 lines
1.9 KiB
C#
using Gameplay.Area;
|
|
using Gameplay.Common;
|
|
using Gameplay.Unit;
|
|
using Gameplay.Unit.Data;
|
|
namespace Gameplay.PlayerSkill.Logic
|
|
{
|
|
public class PlayerSkillLogic06 : BasePlayerSkillLogic
|
|
{
|
|
|
|
protected override void _OnInit()
|
|
{
|
|
base._OnInit();
|
|
|
|
var units = AreaManager.instance.GetUnitsByCellIndex(owner.selectedCellIndex);
|
|
GameUnit selectUnit = null;
|
|
for (int i = 0; i < units.Count; i++)
|
|
{
|
|
var unit = units[i];
|
|
if (unit.commonData.troopId == owner.playerUnit.commonData.troopId)
|
|
{
|
|
// 友军不生效
|
|
continue;
|
|
}
|
|
if (unit.gameunitType != EGameUnitType.Character)
|
|
{
|
|
// 只对角色生效
|
|
continue;
|
|
}
|
|
selectUnit = unit;
|
|
break;
|
|
}
|
|
|
|
if (selectUnit != null)
|
|
{
|
|
var allUnits = GameUnitManager.instance.infightUnits;
|
|
for (int i = 0; i < allUnits.count; i++)
|
|
{
|
|
var unit = allUnits.GetByIndex(i);
|
|
if (unit.commonData.troopId != owner.playerUnit.commonData.troopId)
|
|
{
|
|
// 只筛选友军
|
|
continue;
|
|
}
|
|
if (unit.gameunitType != EGameUnitType.Character)
|
|
{
|
|
// 只对角色生效
|
|
continue;
|
|
}
|
|
var charactor = unit as Character.Character;
|
|
if (charactor == null)
|
|
{
|
|
continue;
|
|
}
|
|
charactor.MoveTo(selectUnit);
|
|
}
|
|
}
|
|
|
|
isFinished = true;
|
|
|
|
}
|
|
|
|
}
|
|
}
|