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

110 lines
2.7 KiB
C#
Raw Normal View History

using Gameplay.Vehicle.Impl;
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;
}
}
public GameUnit targetEnemy
{
get;
set;
}
2024-05-17 16:02:05 +08:00
public ContinueAttackData continueAttackData;
2024-07-17 18:31:55 +08:00
public ContinueSkillAttackData continueSkillData;
2023-08-22 19:08:45 +08:00
2024-03-12 19:44:05 +08:00
private GameUnit _tauntUnit;
/// <summary>
/// 嘲讽单位
/// </summary>
public GameUnit tauntUnit
{
get
{
if (_tauntUnit == null
|| _tauntUnit.isDisposed
2024-07-12 17:06:39 +08:00
|| _tauntUnit.statusData.CheckCanBeTarget(null))
2024-03-12 19:44:05 +08:00
{
_tauntUnit = null;
return null;
}
return _tauntUnit;
}
set
{
_tauntUnit = value;
}
}
2023-08-22 19:08:45 +08:00
// 标志和透传相关信息
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;
owner.transData.claimCellIndex = value;
2023-08-22 19:08:45 +08:00
}
}
}
2023-10-19 15:00:19 +08:00
public int skillCellIndex;
public bool forceUpdateTarget = false;
2023-08-22 19:08:45 +08:00
2024-05-17 19:27:02 +08:00
public bool disableAutoRecoverMorale = false;
2024-10-18 14:53:50 +08:00
public NormalVehicle markVehicle
{
get;
set;
}
public GameUnit markEnemy
{
get;
set;
}
2023-08-22 19:08:45 +08:00
public UnitControlData(GameUnit owner)
{
this.owner = owner;
2024-05-17 16:02:05 +08:00
continueAttackData = new ContinueAttackData();
2024-07-17 18:31:55 +08:00
continueSkillData = new ContinueSkillAttackData();
2023-08-22 19:08:45 +08:00
}
public void Reset()
{
followUnit = null;
targetEnemy = null;
targetCellIndex = -1;
skillCellIndex = -1;
}
2023-08-22 19:08:45 +08:00
}
}