NLDClient-yudde/ProjectNLD/Assets/Code/Scripts/Gameplay/Unit/Data/UnitControlData.cs

60 lines
1.4 KiB
C#
Raw Normal View History

2023-12-13 16:20:41 +08:00
namespace Gameplay.Unit.Data
2023-08-22 19:08:45 +08:00
{
public class UnitControlData
{
2023-10-19 15:00:19 +08:00
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;
}
}
2023-08-22 19:08:45 +08:00
public GameUnit targetEnemy;
// 标志和透传相关信息
private int _targetCellIndex = -1;
public int targetCellIndex
{
get
{
return _targetCellIndex;
}
set
{
2023-11-08 13:47:15 +08:00
// ReSharper disable once RedundantCheckBeforeAssignment
2023-08-22 19:08:45 +08:00
if (_targetCellIndex != value)
{
2023-11-08 13:47:15 +08:00
// owner.Log("设置targetCellIndex:" + value);
2023-08-22 19:08:45 +08:00
_targetCellIndex = value;
}
}
}
2023-10-19 15:00:19 +08:00
public int skillCellIndex;
2023-08-22 19:08:45 +08:00
public UnitControlData(GameUnit owner)
{
this.owner = owner;
}
public void Reset()
{
followUnit = null;
targetEnemy = null;
targetCellIndex = -1;
skillCellIndex = -1;
}
2023-08-22 19:08:45 +08:00
}
}