54 lines
1.2 KiB
C#
54 lines
1.2 KiB
C#
using Gameplay.Common;
|
|
using Gameplay.Level.Select;
|
|
using Gameplay.Unit;
|
|
using PhxhSDK;
|
|
|
|
namespace Gameplay.Level
|
|
{
|
|
public partial class Level
|
|
{
|
|
public GameUnit selectUnit
|
|
{
|
|
get
|
|
{
|
|
return selectView.selectUnit;
|
|
}
|
|
}
|
|
public SelectView selectView { get; private set; }
|
|
|
|
public void SelectUnit(GameUnit newUnit)
|
|
{
|
|
if (selectUnit == newUnit) return;
|
|
if (!newUnit.commonData.canSelect)
|
|
return;
|
|
UnSelectUnit();
|
|
newUnit.OnSelect();
|
|
selectView.SetOwner(newUnit);
|
|
|
|
if (IsInBattle())
|
|
{
|
|
_map.ShowInfo(Map.InfoMask.ShowCells, true);
|
|
}
|
|
}
|
|
|
|
public void SelectUnit(uint id)
|
|
{
|
|
var newUnit = GameUnitManager.instance.infightUnits.Search(id);
|
|
SelectUnit(newUnit);
|
|
}
|
|
|
|
public void UnSelectUnit()
|
|
{
|
|
if (selectUnit == null) return;
|
|
selectUnit.OnUnSelect();
|
|
selectView.SetOwner(null);
|
|
|
|
if (IsInBattle())
|
|
{
|
|
_map.ShowInfo(Map.InfoMask.ShowCells, false);
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|