83 lines
2.0 KiB
C#
83 lines
2.0 KiB
C#
namespace Gameplay.Unit.Data
|
|
{
|
|
public class UnitControlData
|
|
{
|
|
public readonly GameUnit owner;
|
|
private GameUnit _followUnit;
|
|
public GameUnit followUnit
|
|
{
|
|
get
|
|
{
|
|
if (_followUnit == null || _followUnit.isDisposed)
|
|
{
|
|
_followUnit = null;
|
|
return null;
|
|
}
|
|
return _followUnit;
|
|
}
|
|
set
|
|
{
|
|
_followUnit = value;
|
|
}
|
|
}
|
|
public GameUnit targetEnemy;
|
|
|
|
private GameUnit _tauntUnit;
|
|
/// <summary>
|
|
/// 嘲讽单位
|
|
/// </summary>
|
|
public GameUnit tauntUnit
|
|
{
|
|
get
|
|
{
|
|
if (_tauntUnit == null
|
|
|| _tauntUnit.isDisposed
|
|
|| _tauntUnit.statusData.CheckCanBeTarget())
|
|
{
|
|
_tauntUnit = null;
|
|
return null;
|
|
}
|
|
return _tauntUnit;
|
|
}
|
|
set
|
|
{
|
|
_tauntUnit = value;
|
|
}
|
|
}
|
|
|
|
// 标志和透传相关信息
|
|
private int _targetCellIndex = -1;
|
|
public int targetCellIndex
|
|
{
|
|
get
|
|
{
|
|
return _targetCellIndex;
|
|
}
|
|
set
|
|
{
|
|
// ReSharper disable once RedundantCheckBeforeAssignment
|
|
if (_targetCellIndex != value)
|
|
{
|
|
// owner.Log("设置targetCellIndex:" + value);
|
|
_targetCellIndex = value;
|
|
}
|
|
}
|
|
}
|
|
|
|
public int skillCellIndex;
|
|
|
|
public UnitControlData(GameUnit owner)
|
|
{
|
|
this.owner = owner;
|
|
}
|
|
|
|
public void Reset()
|
|
{
|
|
followUnit = null;
|
|
targetEnemy = null;
|
|
targetCellIndex = -1;
|
|
skillCellIndex = -1;
|
|
}
|
|
}
|
|
}
|