2024-10-08 12:06:06 +08:00
|
|
|
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;
|
2024-03-06 12:58:09 +08:00
|
|
|
private GameUnit _followUnit;
|
|
|
|
|
public GameUnit followUnit
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
if (_followUnit == null || _followUnit.isDisposed)
|
|
|
|
|
{
|
|
|
|
|
_followUnit = null;
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
return _followUnit;
|
|
|
|
|
}
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
_followUnit = value;
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-07-15 19:03:51 +08:00
|
|
|
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;
|
2024-09-19 15:56:19 +08:00
|
|
|
owner.transData.claimCellIndex = value;
|
2023-08-22 19:08:45 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-10-19 15:00:19 +08:00
|
|
|
|
|
|
|
|
public int skillCellIndex;
|
2024-05-17 14:37:55 +08:00
|
|
|
|
|
|
|
|
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-08 12:06:06 +08:00
|
|
|
|
|
|
|
|
public NormalVehicle markVehicle;
|
2024-10-08 13:23:53 +08:00
|
|
|
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
|
|
|
}
|
2023-12-19 14:26:50 +08:00
|
|
|
|
|
|
|
|
public void Reset()
|
|
|
|
|
{
|
|
|
|
|
followUnit = null;
|
|
|
|
|
targetEnemy = null;
|
|
|
|
|
targetCellIndex = -1;
|
|
|
|
|
skillCellIndex = -1;
|
|
|
|
|
}
|
2023-08-22 19:08:45 +08:00
|
|
|
}
|
|
|
|
|
}
|