Skip to content

GameCore.Components ​

CommandResultWalk 双端 ​

命名空间 GameCore.Components

csharp
public enum CommandResultWalk

枚举值 ​

  • Success = 0
  • Dead = 1
  • Waiting = 6
  • CloseEnough = 7
  • Invisible = 8
  • NoWalkable = 9

Component 双端 ​

命名空间 GameCore.Components

csharp
public abstract class Component<TComponent> : Component where TComponent : Component<TComponent>

Generic base class for typed components that automatically manage their registration in component sets.

备注

This class extends the base Component to provide type-safe component set management. Components of the same type are automatically grouped together in sets on their host entity, enabling efficient querying and management of similar components.

构造函数 ​

Component 双端 ​

csharp
protected Component(Entity host)

Initializes a new typed component and registers it in the appropriate component set on the host entity.

  • host — The entity that will own this component.

方法 ​

DisposeManaged 双端 ​

csharp
protected override void DisposeManaged()

Disposes managed resources and removes this component from its type set on the host entity.

Mover 双端 ​

命名空间 GameCore.Components

csharp
public abstract class Mover : DisposableObject, ISyncIdOwner, IMoverData, IExecutionContext

移动器基类。管理碰撞/命中字段、事件、生命周期。 所有 Mover 实例通过 Entity._activeMoverInstances 统一管理。

构造函数 ​

Mover 双端 ​

csharp
protected Mover(Entity host, IExecutionContext? context = null)

Mover 双端 ​

csharp
protected Mover(Entity host, IGameDataMover data, IExecutionContext context)

属性 ​

Host 双端 ​

csharp
public Entity Host { get; }

SyncId 双端 ​

csharp
public int SyncId { get; }

LaunchEntity 双端 ​

csharp
public Entity? LaunchEntity { get; init; }

LaunchSite 双端 ​

csharp
public ITarget? LaunchSite { get; init; }

Target 双端 ​

csharp
public virtual ITarget Target { get; set; }

Cache 双端 ​

csharp
public IGameDataMover? Cache { get; }

DoStaticCollision 双端 ​

csharp
public bool DoStaticCollision { get; set; }

StaticMask 双端 ​

csharp
public StaticCollisionMask StaticMask { get; set; }

DoImpactEntity 双端 ​

csharp
public bool DoImpactEntity { get; set; }

ImpactSearchFilter 双端 ​

csharp
public TargetFilterComplex ImpactSearchFilter { get; set; }

ImpactSearchRadius 双端 ​

csharp
public float ImpactSearchRadius { get; set; }

FinishArriveRadius 双端 ​

csharp
public float FinishArriveRadius { get; set; }

CompleteEffect 双端 ​

csharp
public IGameLink<GameDataEffect>? CompleteEffect { get; set; }

FinalEffect 双端 ​

csharp
public IGameLink<GameDataEffect>? FinalEffect { get; set; }

ImpactMaxCount 双端 ​

csharp
public double? ImpactMaxCount { get; set; }

ImpactEffect 双端 ​

csharp
public IGameLink<GameDataEffect>? ImpactEffect { get; set; }

ImpactSameTargetInterval 双端 ​

csharp
public TimeSpan? ImpactSameTargetInterval { get; set; }

AllowSpellModification 双端 ​

csharp
public bool AllowSpellModification { get; set; }

ImpactUnitLocVar 双端 ​

csharp
public LocVarType? ImpactUnitLocVar { get; set; }

KillHostOnRemoval 双端 ​

csharp
public bool KillHostOnRemoval { get; set; }

MissileScaling 双端 ​

csharp
public double? MissileScaling { get; set; }

ActorArray 双端 ​

csharp
public List<IGameLink<GameDataActor>?>? ActorArray { get; }

Context 双端 ​

csharp
public IExecutionContext Context { get; set; }

Caster 双端 ​

csharp
public Entity Caster { get; }

ImpactCount 仅服务端 ​

csharp
public uint ImpactCount { get; set; }

方法 ​

Stop 双端 ​

csharp
public bool Stop(bool complete = false)

ToString 双端 ​

csharp
public override string? ToString()

DisposeManaged 双端 ​

csharp
protected override void DisposeManaged()

DisposeUnmanaged 双端 ​

csharp
protected override void DisposeUnmanaged(bool finalizing)

InvokeOnMoveImpact 仅服务端 ​

csharp
protected void InvokeOnMoveImpact(Entity target)

InvokeOnMoveCollide 仅服务端 ​

csharp
protected void InvokeOnMoveCollide()

Execute 仅服务端 ​

csharp
public virtual bool Execute()

LocVarUnitAction 仅服务端 ​

csharp
protected static Action<Effect>? LocVarUnitAction(LocVarType? nullableType, ITarget target)

事件 ​

OnMoveComplete 仅服务端 ​

csharp
public event Action? OnMoveComplete

OnMoveStart 仅服务端 ​

csharp
public event Action? OnMoveStart

OnMoveStop 仅服务端 ​

csharp
public event Action? OnMoveStop

OnMoveCollide 仅服务端 ​

csharp
public event Action? OnMoveCollide

OnMoveImpact 仅服务端 ​

csharp
public event Action<Entity>? OnMoveImpact

字段 ​

completed 双端 ​

csharp
protected bool completed

MoverCustom 双端 ​

命名空间 GameCore.Components

csharp
public class MoverCustom : Mover, IAttachedObject, ISyncIdOwner, IDisposable, IThinker

自定义移动器。用户通过 GameDataMoverCustom.OnThink 回调手动控制每帧位置, 框架在服务端自动执行碰撞检测。同时存在于服务端和客户端,通过 IAttachedObject 同步生命周期。

构造函数 ​

MoverCustom 仅服务端 ​

csharp
public MoverCustom(Entity host, GameDataMoverCustom data, IExecutionContext context, ITarget launchSite, ITarget target, Entity? launchEntity = null)

属性 ​

Data 双端 ​

csharp
public GameDataMoverCustom Data { get; }

ElapsedMs 双端 ​

csharp
public int ElapsedMs { get; }

自创建以来经过的总时间(毫秒)。 服务端和客户端均基于服务端创建时刻起算,客户端通过 ServerTickOffset 进行时钟偏移校正。

SyncId 仅客户端 ​

csharp
public new int SyncId { get; set; }

Position 双端 ​

csharp
public ScenePoint Position { get; set; }

Facing 双端 ​

csharp
public Angle Facing { get; set; }

Rotation 双端 ​

csharp
public Vector3 Rotation { get; set; }

Target 双端 ​

csharp
public override ITarget Target { get; set; }

目标。服务端:原始 ITarget(Entity 或坐标)。 客户端:可见 Entity > 快照坐标。

TargetPosition 双端 ​

csharp
public ScenePoint TargetPosition { get; }

当前最佳目标位置。 服务端:实时实体位置(若可用),否则快照。 客户端:可见实体位置 > 上次已知位置 > 快照。

LaunchPosition 双端 ​

csharp
public ScenePoint LaunchPosition { get; }

发射位置(创建时快照)。

方法 ​

ToString 双端 ​

csharp
public override string? ToString()

DisposeManaged 双端 ​

csharp
protected override void DisposeManaged()

MoverOrbit 双端 ​

命名空间 GameCore.Components

csharp
public class MoverOrbit : Mover, IMoverDataOrbit, IMoverData

构造函数 ​

MoverOrbit 双端 ​

csharp
public MoverOrbit(Entity host, IExecutionContext context)

MoverOrbit 双端 ​

csharp
public MoverOrbit(Entity host, IGameDataMoverOrbit data, IExecutionContext context)

属性 ​

Cache 双端 ​

csharp
public new IGameDataMoverOrbit? Cache { get; }

OrbitAngularVelocity 双端 ​

csharp
public GameRate OrbitAngularVelocity { get; set; }

OrbitRadius 双端 ​

csharp
public float OrbitRadius { get; set; }

OrbitRelativeToTargetFacing 双端 ​

csharp
public bool OrbitRelativeToTargetFacing { get; set; }

SelfRotationRate 双端 ​

csharp
public GameRate SelfRotationRate { get; set; }

SelfRotationRelativeToTarget 双端 ​

csharp
public bool SelfRotationRelativeToTarget { get; set; }

InitialFacing 双端 ​

csharp
public Angle? InitialFacing { get; set; }

OrbitHeight 双端 ​

csharp
public float OrbitHeight { get; set; }

HeightRelativeToTarget 双端 ​

csharp
public bool HeightRelativeToTarget { get; set; }

AlwaysVisibleToOrbitTarget 双端 ​

csharp
public bool AlwaysVisibleToOrbitTarget { get; set; }

MoverTarget 双端 ​

命名空间 GameCore.Components

csharp
public class MoverTarget : Mover, IMoverDataTarget, IMoverData

构造函数 ​

MoverTarget 双端 ​

csharp
public MoverTarget(Entity host, IExecutionContext context)

MoverTarget 双端 ​

csharp
public MoverTarget(Entity host, IGameDataMoverTarget data, IExecutionContext context)

属性 ​

Cache 双端 ​

csharp
public new IGameDataMoverTarget? Cache { get; }

Speed 双端 ​

csharp
public GameRate Speed { get; set; }

Acceleration 双端 ​

csharp
public GameRate? Acceleration { get; set; }

MinSpeed 双端 ​

csharp
public GameRate? MinSpeed { get; set; }

MaxSpeed 双端 ​

csharp
public GameRate? MaxSpeed { get; set; }

LaunchHeight 双端 ​

csharp
public float? LaunchHeight { get; set; }

TargetHeight 双端 ​

csharp
public float? TargetHeight { get; set; }

TargetHeightIsAbsolute 双端 ​

csharp
public bool TargetHeightIsAbsolute { get; set; }

ParabolaApex 双端 ​

csharp
public float? ParabolaApex { get; set; }

ParabolaLandingHeight 双端 ​

csharp
public float? ParabolaLandingHeight { get; set; }

TurnToDirection 双端 ​

csharp
public bool TurnToDirection { get; set; }

TurnToVelocity 双端 ​

csharp
public bool TurnToVelocity { get; set; }

StickToGround 双端 ​

csharp
public bool StickToGround { get; set; }

ObjectManager 双端 ​

命名空间 GameCore.Components

csharp
public abstract class ObjectManager<TAttachedObject, TAttachedData> : TagComponent, IObjectManager<TAttachedObject> where TAttachedObject : IAttachedObject<TAttachedObject, TAttachedData> where TAttachedData : IGameData<TAttachedData>, IAttachedData<TAttachedData>

构造函数 ​

ObjectManager 双端 ​

csharp
protected ObjectManager(Entity host, ComponentTag tag)

属性 ​

ObjectType 双端 ​

csharp
public abstract AttachedType ObjectType { get; }

Objects 双端 ​

csharp
protected QuickDictionary<IGameLink<TAttachedData>, LinkManager> Objects { get; }

ObjectsByCategory 双端 ​

csharp
protected QuickDictionary<IExtendableEnum, HashSet<LinkManager>> ObjectsByCategory { get; }

方法 ​

IsEnabled 双端 ​

csharp
public bool IsEnabled(IGameLink<TAttachedData> link)

LinkDisabledCount 双端 ​

csharp
protected virtual int LinkDisabledCount(IGameLink<TAttachedData> link)

CategoriesDisabledCount 双端 ​

csharp
protected virtual int CategoriesDisabledCount(IEnumerable categories)

Get 双端 ​

csharp
public TAttachedObject? Get(IGameLink<TAttachedData> link)

GetAll 双端 ​

csharp
public HashSet<TAttachedObject> GetAll()

This will duplicate the collection.

返回:

GetAll 双端 ​

csharp
public ReadOnlySet<TAttachedObject>? GetAll(IGameLink<TAttachedData> link)

This will duplicate the collection.

返回:

Get 双端 ​

csharp
public IEnumerable<TAttachedObject> Get(Func<TAttachedObject, bool> condition)

YieldAll 双端 ​

csharp
public IEnumerable<TAttachedObject> YieldAll()

Get 双端 ​

csharp
public IEnumerable<TAttachedObjectDescendant> Get<TAttachedObjectDescendant>(Func<TAttachedObjectDescendant, bool> condition) where TAttachedObjectDescendant : TAttachedObject

GetOne 双端 ​

csharp
public TAttachedObject? GetOne(Func<TAttachedObject, bool> condition)

GetOne 双端 ​

csharp
public TAttachedObjectDescendant? GetOne<TAttachedObjectDescendant>(Func<TAttachedObjectDescendant, bool> condition) where TAttachedObjectDescendant : TAttachedObject

ProcessEnabledConfig 双端 ​

csharp
public void ProcessEnabledConfig(IEnumerable<IGameLink<TAttachedData>> linksToEnable, IEnumerable categoriesToEnable, IEnumerable<IGameLink<TAttachedData>> linksToDisable, IEnumerable categoriesToDisable)

Add 双端 ​

csharp
protected TAttachedObject Add(TAttachedObject attached)

NotifyLinkStateChanged 双端 ​

csharp
public void NotifyLinkStateChanged(IGameLink<TAttachedData> link)

Remove 双端 ​

csharp
protected bool Remove(TAttachedObject attached)

Dispose 双端 ​

csharp
protected override void Dispose(bool disposing)

ToString 双端 ​

csharp
public override string ToString()

Returns a string representation of this ObjectManager including its type, object count, and host information.

返回: A formatted string describing this ObjectManager.

csharp
protected IGameLink<TAttachedData>? GetRegisteredLink(TAttachedObject attached)

RestoreExisting 仅服务端 ​

csharp
protected bool RestoreExisting(TAttachedObject attached, IGameLink<TAttachedData>? registeredLink = null)

事件 ​

OnLinkAttached 双端 ​

csharp
protected event Action<TAttachedObject>? OnLinkAttached

OnLinkDetached 双端 ​

csharp
protected event Action<TAttachedObject>? OnLinkDetached

OnLinkActivated 双端 ​

csharp
public event Action<TAttachedObject>? OnLinkActivated

OnLinkDeactivated 双端 ​

csharp
public event Action<TAttachedObject>? OnLinkDeactivated

OnObjectAttached 双端 ​

csharp
public event Action<TAttachedObject>? OnObjectAttached

OnObjectRefresh 双端 ​

csharp
public event Action<TAttachedObject>? OnObjectRefresh

PropertyMoverCustom 双端 ​

命名空间 GameCore.Components

csharp
public readonly struct PropertyMoverCustom : IGameClass, IExtendableEnum<PropertyMoverCustom>, IExtendableEnum, IExtendedEnum, ISyncIdOwner

方法 ​

ToString 双端 ​

csharp
public override string? ToString()

operator == 双端 ​

csharp
public static bool operator ==(PropertyMoverCustom left, PropertyMoverCustom right)

operator != 双端 ​

csharp
public static bool operator !=(PropertyMoverCustom left, PropertyMoverCustom right)

Equals 双端 ​

csharp
public override bool Equals(object? obj)

GetHashCode 双端 ​

csharp
public override int GetHashCode()

OnRegisterGameClass 双端 ​

csharp
public static void OnRegisterGameClass()

字段 ​

InnerValue 双端 ​

csharp
public readonly Enum InnerValue

TargetSnapshotX 双端 ​

csharp
public static readonly PropertyMoverCustom TargetSnapshotX

TargetSnapshotY 双端 ​

csharp
public static readonly PropertyMoverCustom TargetSnapshotY

LaunchSnapshotX 双端 ​

csharp
public static readonly PropertyMoverCustom LaunchSnapshotX

LaunchSnapshotY 双端 ​

csharp
public static readonly PropertyMoverCustom LaunchSnapshotY

TargetEntityId 双端 ​

csharp
public static readonly PropertyMoverCustom TargetEntityId

StartTimeMs 双端 ​

csharp
public static readonly PropertyMoverCustom StartTimeMs

TagComponent 双端 ​

命名空间 GameCore.Components

csharp
public abstract class TagComponent : Component

Unique tag component, which is used to identify the component by a tag. At most one component of each tag can be attached to an entity. Component type can be descendent of each class.

构造函数 ​

TagComponent 双端 ​

csharp
protected TagComponent(Entity host, ComponentTag tag)

属性 ​

Tag 双端 ​

csharp
public ComponentTag Tag { get; }

方法 ​

DisposeManaged 双端 ​

csharp
protected override void DisposeManaged()

Turnable 双端 ​

命名空间 GameCore.Components

csharp
public class Turnable : TagComponent, IContextTypeService<Entity, Turnable>, IThinker

构造函数 ​

Turnable 双端 ​

csharp
public Turnable(Entity host)

属性 ​

TurnSpeed 双端 ​

csharp
public GameRate TurnSpeed { get; }

CurrentOrder 仅服务端 ​

csharp
public IApproachOrder? CurrentOrder { get; set; }

TracingTarget 仅服务端 ​

csharp
public ITarget? TracingTarget { get; set; }

方法 ​

CanTurn 双端 ​

csharp
public CmdResult CanTurn()

AllowApproachOrder 双端 ​

csharp
public bool AllowApproachOrder()

CreateInstance 双端 ​

csharp
public static Turnable CreateInstance(Entity content)

TurnTo 仅服务端 ​

csharp
public void TurnTo(Angle angle, TimeSpan time)

Turn to the specified angle within the specified time.

  • angle —
  • time —

TurnTo 仅服务端 ​

csharp
public CmdResult TurnTo(Angle angle)

Changes the direction the entity is facing based on the specified angle, using the entity's turning speed.

  • angle — Specifies the new direction for the entity to face.

TurnTo 仅服务端 ​

csharp
public CmdResult TurnTo(IApproachOrder order, bool trace = true)

Changes the facing direction of the host towards a specified target, and stores the approach order for future reference. Determines if any adjustments or corrections should be applied during the facing change, it will trace the targe if the host or target change position. Represents the approach order, the user can use the order as reference to stop a specific turning, it also provide the target object whose position will be used to adjust the facing direction.

  • trace — Determines if any adjustments or corrections should be applied during the facing change, it will trace the targe if the host or target change position.
  • order — Represents the approach order, the user can use the order as reference to stop a specific turning, it also provide the target object whose position will be used to adjust the facing direction.

ClearUpCurrentOrder 仅服务端 ​

csharp
protected void ClearUpCurrentOrder(bool fixAngle)

StopTurning 仅服务端 ​

csharp
protected void StopTurning(IApproachOrder order, bool fixAngle)

StopTurning 仅服务端 ​

csharp
public void StopTurning(IApproachOrder order)

OnTargetPositionChangingEnd 仅服务端 ​

csharp
protected void OnTargetPositionChangingEnd(ITarget target)

OnTargetPositionChanging 仅服务端 ​

csharp
protected void OnTargetPositionChanging(ITarget target)

Think 仅服务端 ​

csharp
public void Think(int delta)

字段 ​

_unitPropertyComplex 仅服务端 ​

csharp
protected UnitPropertyComplex _unitPropertyComplex

TurnableExtension 双端 ​

命名空间 GameCore.Components

csharp
public static class TurnableExtension

方法 ​

GetComponent 双端 ​

csharp
public static Turnable? GetComponent<TComponent>(this Entity entity) where TComponent : Turnable

UnitPropertyComplex 双端 ​

命名空间 GameCore.Components

csharp
public class UnitPropertyComplex : TagComponent, IGameClass, IContextTypeService<Entity, UnitPropertyComplex>

Manages complex unit properties, including initialization, calculation, and dependency tracking. Provides methods for setting, adding, and retrieving property values, as well as registering property formulas and dependencies.

构造函数 ​

UnitPropertyComplex 双端 ​

csharp
public UnitPropertyComplex(Entity host)

Initializes a new instance of the UnitPropertyComplex class for the specified host entity.

  • host — The host entity.

方法 ​

OnRegisterGameClass 双端 ​

csharp
public static void OnRegisterGameClass()

Registers the game class and hooks up property setup to the gameplay settings initialization event.

SetupAllProperties 双端 ​

csharp
public static void SetupAllProperties(GameDataGameMode _)

Sets up all unit properties by registering each property data from the catalog.

  • _ — The game mode (unused).

GetFormula 双端 ​

csharp
public static UnitPropertyFormula? GetFormula(IGameLink<GameDataUnitProperty> property)

Gets the formula associated with the specified property, if any.

  • property — The property to get the formula for.

返回: The UnitPropertyFormula if found; otherwise, null.

GetFinal 双端 ​

csharp
public double GetFinal(IGameLink<GameDataUnitProperty> property)

Gets the final value of the specified property, calculating it if necessary.

  • property — The property to retrieve.

返回: The final value of the property, or 0 if not set.

GetFinalOrNull 双端 ​

csharp
public double? GetFinalOrNull(IGameLink<GameDataUnitProperty> property)

Gets the final value of the property if it is set or initialized; otherwise, returns null.

  • property — The property to retrieve.

返回: The final value if set or initialized; otherwise, null.

RegisterPropertyData 双端 ​

csharp
public static void RegisterPropertyData(GameDataUnitProperty cache)

Registers property data and its formula for the specified property.

  • cache — The property data to register.

RegisterPropertyData 双端 ​

csharp
public static void RegisterPropertyData(IGameLink<GameDataUnitProperty> link)

Registers property data and its formula for the specified property link.

  • link — The property link to register.

RegisterFormula 双端 ​

csharp
public static void RegisterFormula(IGameLink<GameDataUnitProperty> property, UnitPropertyFormula formula)

Registers a formula for the specified property and tracks its dependencies.

  • property — The property to register the formula for.
  • formula — The formula to register.

RegisterDependency 双端 ​

csharp
public static bool RegisterDependency(IGameLink<GameDataUnitProperty> property, IGameLink<GameDataUnitProperty> dependency)

Registers a dependency between two properties.

  • property — The dependent property.
  • dependency — The property it depends on.

返回: true if the dependency was added; otherwise, false.

Dispose 双端 ​

csharp
protected override void Dispose(bool disposing)

Disposes the resources used by the component.

  • disposing — Indicates whether the method is called from Dispose.

CreateInstance 双端 ​

csharp
public static UnitPropertyComplex CreateInstance(Entity content)

Creates a new instance of UnitPropertyComplex for the specified entity.

  • content — The entity to attach the component to.

返回: A new UnitPropertyComplex instance.

ContainsProperty 仅服务端 ​

csharp
public bool ContainsProperty(IGameLink<GameDataUnitProperty> property)

Checks if the property has been set or initialized in the unit's property data.

  • property — The property to check.

返回: true if the property exists; otherwise, false.

备注

Even if the property is not set or initialized, it may still have a default value of 0 for all sub types, so the final value may still be able to be retrieved.

GetFixed 仅服务端 ​

csharp
public double GetFixed(IGameLink<GameDataUnitProperty> property, PropertySubType subType)

Gets the value of a specific property and subtype, falling back to initial data or 0 if not set.

  • property — The property to retrieve.
  • subType — The subtype of the property.

返回: The value of the property and subtype, or 0 if not set.

SetFixed 仅服务端 ​

csharp
public void SetFixed(IGameLink<GameDataUnitProperty> property, PropertySubType subType, double value)

Sets the value of a specific property and subtype, and triggers recalculation of dependencies.

  • property — The property to set.
  • subType — The subtype of the property.
  • value — The value to set.

AddFixed 仅服务端 ​

csharp
public void AddFixed(IGameLink<GameDataUnitProperty> property, PropertySubType subType, double value)

Adds a value to a specific property and subtype, and triggers recalculation of dependencies.

  • property — The property to add to.
  • subType — The subtype of the property.
  • value — The value to add.

CalcAndSetFinalForDependencies 仅服务端 ​

csharp
public void CalcAndSetFinalForDependencies(IGameLink<GameDataUnitProperty> property, HashSet<IGameLink<GameDataUnitProperty>>? processedProperties = null)

Calculates and sets the final value of the property and all of its affected properties, updating the host unit.

  • property — The property to process.
  • processedProperties — A set of already processed properties to avoid recursion.

CalcAndSetFinal 仅服务端 ​

csharp
public bool CalcAndSetFinal(IGameLink<GameDataUnitProperty> property)

Calculates and sets the final value of the specified property, updating the host unit and notifying listeners if changed.

  • property — The property to calculate and set.

返回: true if the value changed; otherwise, false.

UnitPropertyComplexExtension 双端 ​

命名空间 GameCore.Components

csharp
public static class UnitPropertyComplexExtension

Extension methods for working with UnitPropertyComplex components on entities.

方法 ​

GetComponent 双端 ​

csharp
public static UnitPropertyComplex? GetComponent<TComponent>(this Entity entity) where TComponent : UnitPropertyComplex

Gets the UnitPropertyComplex component from the entity, if present.

  • entity — The entity to query.

返回: The component if found; otherwise, null.

GetOrCreateComponent 双端 ​

csharp
public static UnitPropertyComplex GetOrCreateComponent<TComponent>(this Entity entity) where TComponent : UnitPropertyComplex

Gets or creates the UnitPropertyComplex component on the entity.

  • entity — The entity to query or attach to.

返回: The component instance.

GetUnitPropertyFinal 双端 ​

csharp
public static double? GetUnitPropertyFinal(this Entity entity, IGameLink<GameDataUnitProperty> property)

Gets the final value of a unit property for the entity, if available.

  • entity — The entity to query.
  • property — The property to retrieve.

返回: The final value if available; otherwise, null.

UnitVision 双端 ​

命名空间 GameCore.Components

csharp
public class UnitVision : TagComponent, IContextTypeService<Entity, UnitVision>

单位视野能力对象。该组件管理观察者开关和视野形状;视野距离仍以 ScopeData.UnitProperty.Sight 为权威来源。 观察者开关和视野形状目前用于 Precise 场景视野模式下的可见性判定; 客户端本地视野遮罩在设置了本地焦点时也会复用同一份形状参数。

构造函数 ​

UnitVision 双端 ​

csharp
public UnitVision(Entity host)

属性 ​

ObserverEnabled 双端 ​

csharp
public bool ObserverEnabled { get; set; }

当前单位是否作为精确视野观察者参与计算。只有场景视野模式为 Precise 且观察者策略为 Explicit 时才会筛选此开关。

Range 双端 ​

csharp
public float Range { get; }

视野距离。该属性读写的是 ScopeData.UnitProperty.Sight,不是 UnitVision 自己维护的第二套距离;客户端只读。

Shape 双端 ​

csharp
public UnitVisionShape Shape { get; }

当前视野形状。

CentralAngle 双端 ​

csharp
public float CentralAngle { get; }

当前扇形中心角,单位为度。圆形视野固定为 360。

InnerRadius 双端 ​

csharp
public float InnerRadius { get; }

当前扇形内半径,单位为世界距离。

DirectionSource 双端 ​

csharp
public UnitVisionDirectionSource DirectionSource { get; }

当前扇形方向来源。

FixedDirection 双端 ​

csharp
public float FixedDirection { get; }

固定方向角,单位为度,仅当 DirectionSource 为 Fixed 时使用。

方法 ​

Apply 双端 ​

csharp
public void Apply(UnitVisionConfig config)

应用单位默认视野配置。视野距离不来自 UnitVisionConfig,仍由 ScopeData.UnitProperty.Sight 提供。

SetCircle 双端 ​

csharp
public void SetCircle()

设置为圆形视野。半径仍来自 Range;该形状目前用于精确视野模式下的可见性判定和客户端本地视野遮罩表现。

SetCone 双端 ​

csharp
public void SetCone(float centralAngleDegrees, float innerRadius = 0f, UnitVisionDirectionSource directionSource = UnitVisionDirectionSource.Facing, float fixedDirectionDegrees = 0f)

设置为扇形视野。半径仍来自 Range;该形状目前用于精确视野模式下的可见性判定和客户端本地视野遮罩表现。

DisposeManaged 双端 ​

csharp
protected override void DisposeManaged()

CreateInstance 双端 ​

csharp
public static UnitVision CreateInstance(Entity content)

UnitVisionExtension 双端 ​

命名空间 GameCore.Components

csharp
public static class UnitVisionExtension

Extension methods for working with UnitVision components on units.

方法 ​

GetComponent 双端 ​

csharp
public static UnitVision? GetComponent<TComponent>(this Entity entity) where TComponent : UnitVision

GetOrCreateComponent 双端 ​

csharp
public static UnitVision GetOrCreateComponent<TComponent>(this Entity entity) where TComponent : UnitVision

Walkable 双端 ​

命名空间 GameCore.Components

csharp
public class Walkable : TagComponent, IContextTypeService<Entity, Walkable>, ICommandHandler

构造函数 ​

Walkable 双端 ​

csharp
public Walkable(Entity host)

属性 ​

IsVectorMoveBypassOrderQueue 双端 ​

csharp
public bool IsVectorMoveBypassOrderQueue { get; }

IsVectorMoveSuppressed 仅服务端 ​

csharp
public bool IsVectorMoveSuppressed { get; }

摇杆移动是否被指令队列抑制 如果指令队列为空,则不抑制 如果单位具有 VectorMoveBypassOrderQueue 状态,则不抑制

VectorMoveState 仅服务端 ​

csharp
public VectorMoveState VectorMoveState { get; }

摇杆移动状态管理

方法 ​

Dispose 双端 ​

csharp
protected override void Dispose(bool disposing)

CanWalk 双端 ​

csharp
public CmdResult CanWalk()

AllowApproachOrder 双端 ​

csharp
public bool AllowApproachOrder()

CreateInstance 双端 ​

csharp
public static Walkable CreateInstance(Entity content)

VectorMoveTo 仅服务端 ​

csharp
public void VectorMoveTo(Vector3 vector3)

开始三维向量摇杆移动。该入口面向飞行、自由空间移动等真正需要 Z 方向输入的场景; 普通 3D 地面单位不要用它表达上下坡,地面单位应使用 Vector2), 只传水平意图,Nav3D 会在运行时把单位贴合到坡面或屋顶等可走面。

  • vector3 — 三维移动方向向量。当前 Host 侧三维 rocker overload 尚未作为普通地面移动入口启用。
备注

此方法会始终更新摇杆移动状态,记录移动方向。 摇杆移动的执行取决于 IsVectorMoveSuppressed 的状态: 如果单位具有 VectorMoveBypassOrderQueue 状态,则立即执行移动 如果指令队列为空则立即执行移动 如果指令队列有指令则暂时抑制移动,但记录移动方向 被抑制的摇杆移动会在指令队列执行完毕时自动恢复(会跳过可打断的后摇)。

VectorMoveTo 仅服务端 ​

csharp
public void VectorMoveTo(Vector2 vector2)

开始水平摇杆移动。普通 2.5D 单位和 3D 地面单位都应走这个入口; 在 3D 场景中,X/Y 只表示“向这个水平朝向移动”,上下坡和多层可走面的 Z 由 Nav3D 贴合处理。

  • vector2 — 水平移动方向向量。建议传归一化方向;停止移动请调用 StopVectorMove。
备注

此方法会始终更新摇杆移动状态,记录移动方向。 摇杆移动的执行取决于 IsVectorMoveSuppressed 的状态: 如果单位具有 VectorMoveBypassOrderQueue 状态,则立即执行移动 如果指令队列为空则立即执行移动 如果指令队列有指令则暂时抑制移动,但记录移动方向 被抑制的摇杆移动会在指令队列执行完毕时自动恢复(会跳过可打断的后摇)。

UpdateVectorMoveState 仅服务端 ​

csharp
public void UpdateVectorMoveState()

恢复被抑制的摇杆移动

StopVectorMove 仅服务端 ​

csharp
public void StopVectorMove()

停止摇杆移动

StopNavigationPathingPreserveVectorMove 仅服务端 ​

csharp
public void StopNavigationPathingPreserveVectorMove()

停止寻路/接近等导航执行态,但保留摇杆连续移动意图,供 movement controller 切换模式后 replay。

Approach 仅服务端 ​

csharp
public bool Approach(ITarget target, IApproachOrder approachOrder, float maxDistance, float minDistance = -1f, bool targetEntityVisionCheck = true)

PathTo 仅服务端 ​

csharp
public bool PathTo(ITarget target, bool targetEntityVisionCheck = true)

PathTo 仅服务端 ​

csharp
public bool PathTo(ITarget target, float maxDistance, float minDistance = -1f, bool targetEntityVisionCheck = true)

StopApproach 仅服务端 ​

csharp
public bool StopApproach(IApproachOrder approachOrder)

CreateOrder 仅服务端 ​

csharp
public CmdResult<Order> CreateOrder(Command command)

WalkableExtension 双端 ​

命名空间 GameCore.Components

csharp
public static class WalkableExtension

方法 ​

GetComponent 双端 ​

csharp
public static Walkable? GetComponent<TComponent>(this Entity entity) where TComponent : Walkable

GameDataMover 双端 ​

命名空间 GameCore.Components.Data

csharp
public abstract class GameDataMover : GameDataCategory<GameDataMover>, IGameDataMover, IGameData, IGameDataCategory<GameDataMover>, IGameData<GameDataMover>

移动体数据基类。定义投射物、飞行物等的移动、碰撞与命中逻辑。

构造函数 ​

GameDataMover 双端 ​

csharp
public GameDataMover(GameLink<GameDataMover, GameDataMover> link)

GameDataMover 双端 ​

csharp
public GameDataMover(IGameLink<GameDataMover> link)

属性 ​

DoStaticCollision 双端 ​

csharp
public bool DoStaticCollision { get; set; }

是否与静态障碍物(地形、建筑等)发生碰撞。

StaticMask 双端 ​

csharp
public List<StaticCollisionMask> StaticMask { get; set; }

静态碰撞检测的遮罩类型。如不可飞行区域等。

DoImpactEntity 双端 ​

csharp
public bool DoImpactEntity { get; set; }

是否在移动过程中检测并命中实体(单位等)。

ImpactSearchFilter 双端 ​

csharp
public TargetFilterComplex ImpactSearchFilter { get; set; }

命中实体时的目标筛选条件(如排除无敌、死亡单位)。

ImpactSearchRadius 双端 ​

csharp
public FuncFloat ImpactSearchRadius { get; set; }

命中检测的搜索半径(游戏单位)。

FinishArriveRadius 双端 ​

csharp
public FuncFloat FinishArriveRadius { get; set; }

判定到达目标时的半径阈值,小于此距离视为已到达。

CompleteEffect 双端 ​

csharp
public IGameLink<GameDataEffect>? CompleteEffect { get; set; }

到达目标时触发的效果。

FinalEffect 双端 ​

csharp
public IGameLink<GameDataEffect>? FinalEffect { get; set; }

移动体被移除时触发的效果(如爆炸、消散)。

ImpactMaxCount 双端 ​

csharp
public FuncNumber? ImpactMaxCount { get; set; }

最多可命中的实体数量。用于限制穿透型投射物的命中次数。

ImpactEffect 双端 ​

csharp
public IGameLink<GameDataEffect>? ImpactEffect { get; set; }

命中实体时施加的效果。

ImpactSameTargetInterval 双端 ​

csharp
public TimeSpan? ImpactSameTargetInterval { get; set; }

同一目标两次命中之间的最小间隔,用于防止连续命中。

AllowSpellModification 双端 ​

csharp
public bool AllowSpellModification { get; set; }

是否允许技能修改移动体参数(如伤害、速度)。

ImpactUnitLocVar 双端 ​

csharp
public LocVarType? ImpactUnitLocVar { get; set; }

命中单位时写入的局部变量类型,供后续逻辑引用。

KillHostOnRemoval 双端 ​

csharp
public bool KillHostOnRemoval { get; set; }

移动体被移除时是否同时销毁宿主实体。

MissileScaling 双端 ​

csharp
public FuncNumber? MissileScaling { get; set; }

投射物伤害/效果的缩放系数,可随等级等动态计算。

ActorArray 双端 ​

csharp
public List<IGameLink<GameDataActor>?>? ActorArray { get; set; }

移动体携带的演员列表,用于生成视觉效果(如拖尾、光环)。

Priority 双端 ​

csharp
public int? Priority { get; set; }

移动器优先级。为 null 时新移动器永远覆盖已有移动器。 双方都有值时,仅当已有移动器的优先级严格大于新移动器时才拒绝新移动器。

方法 ​

CreateMover 双端 ​

csharp
public abstract Mover? CreateMover(IExecutionContext context, Entity host, ITarget launchSite, ITarget target, Entity? launchEntity = null)

TryReplacePreviousMovers 双端 ​

csharp
protected bool TryReplacePreviousMovers(Entity host)

检查并移除 host 上已有的低优先级移动器。 返回 true 表示可以创建新移动器,false 表示被已有高优先级移动器阻止。

GameDataMoverCustom 双端 ​

命名空间 GameCore.Components.Data

csharp
public class GameDataMoverCustom : GameDataMover, IAttachedData, IGameData<GameDataMoverCustom>, IGameData

自定义移动器数据。用户通过 OnThink 回调手动控制每帧位置,框架自动执行碰撞检测。 继承 GameDataMover,因此 GameDataEffectUnitMoverApply / MoverRemove 等效果均可使用。

构造函数 ​

GameDataMoverCustom 双端 ​

csharp
public GameDataMoverCustom(GameLink<GameDataMover, GameDataMoverCustom> link)

GameDataMoverCustom 双端 ​

csharp
public GameDataMoverCustom(IGameLink<GameDataMoverCustom> link)

属性 ​

OnThink 双端 ​

csharp
public Action<MoverCustom, int>? OnThink { get; set; }

每帧 Think 回调。在服务端和客户端都会被调用。 用户在此计算新位置并通过 mover.Position / mover.Rotation 设置。 delta 参数为距上一帧的毫秒数。

SyncType 双端 ​

csharp
public SyncType SyncType { get; set; }

Mover 组件属性的同步类型。默认值为 Sight。

csharp
public new IGameLink<GameDataMoverCustom> Link { get; }

方法 ​

CreateMover 双端 ​

csharp
public override Mover? CreateMover(IExecutionContext context, Entity host, ITarget launchSite, ITarget target, Entity? launchEntity = null)

Create 仅服务端 ​

csharp
public MoverCustom Create(Entity host, IExecutionContext context, ITarget launchSite, ITarget target, Entity? launchEntity = null)

在服务端创建 MoverCustom 实例。

GameDataMoverOrbit 双端 ​

命名空间 GameCore.Components.Data

csharp
public class GameDataMoverOrbit : GameDataMover, IGameDataMoverOrbit, IGameDataMover, IGameData, IGameData<GameDataMoverOrbit>

环绕型移动体数据。实体围绕目标做圆周或椭圆运动,如环绕飞行的导弹、卫星。

构造函数 ​

GameDataMoverOrbit 双端 ​

csharp
public GameDataMoverOrbit(GameLink<GameDataMover, GameDataMoverOrbit> link)

GameDataMoverOrbit 双端 ​

csharp
public GameDataMoverOrbit(IGameLink<GameDataMoverOrbit> link)

属性 ​

OrbitAngularVelocity 双端 ​

csharp
public FuncRate OrbitAngularVelocity { get; set; }

环绕角速度(度/秒)。正值逆时针,负值顺时针。

OrbitRadius 双端 ​

csharp
public FuncFloat OrbitRadius { get; set; }

环绕半径(游戏单位)。

OrbitRelativeToTargetFacing 双端 ​

csharp
public bool OrbitRelativeToTargetFacing { get; set; }

环绕平面是否随目标朝向旋转。启用时环绕会跟随目标面向。

SelfRotationRate 双端 ​

csharp
public FuncRate SelfRotationRate { get; set; }

自身旋转速率(度/秒)。用于模型自转效果。

SelfRotationRelativeToTarget 双端 ​

csharp
public bool SelfRotationRelativeToTarget { get; set; }

自身旋转是否相对于目标朝向。否则为世界空间旋转。

InitialFacing 双端 ​

csharp
public FuncAngle? InitialFacing { get; set; }

实体的初始面朝方向(角度)。为 null 时保持实体当前朝向。

OrbitHeight 双端 ​

csharp
public FuncFloat OrbitHeight { get; set; }

环绕高度偏移(游戏单位)。用于 3D 场景中的垂直偏移。

HeightRelativeToTarget 双端 ​

csharp
public bool HeightRelativeToTarget { get; set; }

高度是否相对于目标位置。否则为世界空间高度。

AlwaysVisibleToOrbitTarget 双端 ​

csharp
public bool AlwaysVisibleToOrbitTarget { get; set; }

是否始终对环绕目标可见(用于视野、选中等逻辑)。

csharp
public new IGameLink<GameDataMoverOrbit> Link { get; }

方法 ​

CreateMover 双端 ​

csharp
public override Mover? CreateMover(IExecutionContext context, Entity host, ITarget launchSite, ITarget target, Entity? launchEntity = null)

CreateMover 双端 ​

csharp
public virtual Mover? CreateMover(IExecutionContext context, Entity host, Entity target)

GameDataMoverTarget 双端 ​

命名空间 GameCore.Components.Data

csharp
public class GameDataMoverTarget : GameDataMover, IGameDataMoverTarget, IGameDataMover, IGameData, IGameData<GameDataMoverTarget>

追踪目标的移动器,使宿主单位朝目标位置/单位移动(如投射物飞行、冲锋等)

构造函数 ​

GameDataMoverTarget 双端 ​

csharp
public GameDataMoverTarget(GameLink<GameDataMover, GameDataMoverTarget> link)

GameDataMoverTarget 双端 ​

csharp
public GameDataMoverTarget(IGameLink<GameDataMoverTarget> link)

属性 ​

Speed 双端 ​

csharp
public FuncRate Speed { get; set; }

移动速度(单位:距离/秒)

Acceleration 双端 ​

csharp
public FuncRate? Acceleration { get; set; }

加速度。null 表示无加速(匀速运动)

MinSpeed 双端 ​

csharp
public FuncRate? MinSpeed { get; set; }

最小速度限制

MaxSpeed 双端 ​

csharp
public FuncRate? MaxSpeed { get; set; }

最大速度限制

LaunchHeight 双端 ​

csharp
public FuncFloat? LaunchHeight { get; set; }

发射时的初始高度偏移

TargetHeight 双端 ​

csharp
public FuncFloat? TargetHeight { get; set; }

目标位置的高度偏移

TargetHeightIsAbsolute 双端 ​

csharp
public bool TargetHeightIsAbsolute { get; set; }

TargetHeight 是否为绝对高度(true)还是相对于地面的高度(false)

ParabolaApex 双端 ​

csharp
public FuncFloat? ParabolaApex { get; set; }

抛物线轨迹的最高点高度。设置后将沿抛物线飞行

ParabolaLandingHeight 双端 ​

csharp
public FuncFloat? ParabolaLandingHeight { get; set; }

抛物线落地时的目标高度

TurnToDirection 双端 ​

csharp
public bool TurnToDirection { get; set; }

是否朝向飞行方向(面向目标点)

TurnToVelocity 双端 ​

csharp
public bool TurnToVelocity { get; set; }

是否朝向实时速度方向(抛物线时会随曲线旋转)

StickToGround 双端 ​

csharp
public bool StickToGround { get; set; }

是否贴地移动(跟随地形高度)

csharp
public new IGameLink<GameDataMoverTarget> Link { get; }

方法 ​

CreateMover 双端 ​

csharp
public override Mover? CreateMover(IExecutionContext context, Entity host, ITarget launchSite, ITarget target, Entity? launchEntity = null)

IGameDataMover 双端 ​

命名空间 GameCore.Components.Data

csharp
public interface IGameDataMover : IGameData

属性 ​

DoStaticCollision 双端 ​

csharp
public bool DoStaticCollision { get; }

StaticMask 双端 ​

csharp
public List<StaticCollisionMask> StaticMask { get; }

DoImpactEntity 双端 ​

csharp
public bool DoImpactEntity { get; }

ImpactSearchFilter 双端 ​

csharp
public TargetFilterComplex ImpactSearchFilter { get; }

ImpactSearchRadius 双端 ​

csharp
public FuncFloat ImpactSearchRadius { get; }

FinishArriveRadius 双端 ​

csharp
public FuncFloat FinishArriveRadius { get; }

CompleteEffect 双端 ​

csharp
public IGameLink<GameDataEffect>? CompleteEffect { get; }

FinalEffect 双端 ​

csharp
public IGameLink<GameDataEffect>? FinalEffect { get; }

ImpactMaxCount 双端 ​

csharp
public FuncNumber? ImpactMaxCount { get; }

ImpactEffect 双端 ​

csharp
public IGameLink<GameDataEffect>? ImpactEffect { get; }

ImpactSameTargetInterval 双端 ​

csharp
public TimeSpan? ImpactSameTargetInterval { get; }

AllowSpellModification 双端 ​

csharp
public bool AllowSpellModification { get; }

ImpactUnitLocVar 双端 ​

csharp
public LocVarType? ImpactUnitLocVar { get; }

KillHostOnRemoval 双端 ​

csharp
public bool KillHostOnRemoval { get; }

MissileScaling 双端 ​

csharp
public FuncNumber? MissileScaling { get; }

ActorArray 双端 ​

csharp
public List<IGameLink<GameDataActor>?>? ActorArray { get; }

IGameDataMoverOrbit 双端 ​

命名空间 GameCore.Components.Data

csharp
public interface IGameDataMoverOrbit : IGameDataMover, IGameData

Defines the configuration interface for orbital movement data, extending basic mover functionality with orbit-specific properties.

备注

This interface provides configuration for movers that orbit around specific target entities in circular patterns. It supports complex orbital behaviors including self-rotation during orbit, offset calculations relative to target facing, height control, and visibility management between orbiting entity and orbit target.

属性 ​

OrbitAngularVelocity 双端 ​

csharp
public FuncRate OrbitAngularVelocity { get; }

The orbital angular velocity that controls how fast the entity orbits around the target.

备注

This defines the angular velocity for orbital movement around the target, measured in degrees per second. Positive values create counterclockwise orbit, negative values create clockwise orbit.

OrbitRadius 双端 ​

csharp
public FuncFloat OrbitRadius { get; }

The orbit radius that defines the distance from the target center to the orbiting entity.

备注

This determines how far from the target the entity will orbit. The radius can be dynamic, allowing for spiral movements or changing orbital distances over time.

OrbitRelativeToTargetFacing 双端 ​

csharp
public bool OrbitRelativeToTargetFacing { get; }

Whether the orbital angle should be offset by the orbit target's facing direction.

备注

When true, the orbital position will be calculated relative to the target's current facing direction, causing the orbit to rotate with the target. When false, the orbit maintains fixed world coordinates.

SelfRotationRate 双端 ​

csharp
public FuncRate SelfRotationRate { get; }

The self-rotation rate that controls how fast the orbiting entity rotates around its own axis.

备注

This defines the angular velocity for the entity's self-rotation while orbiting, measured in degrees per second. Self-rotation is independent of orbital movement and can create spinning effects during orbit.

SelfRotationRelativeToTarget 双端 ​

csharp
public bool SelfRotationRelativeToTarget { get; }

Whether the entity's self-rotation should be offset by the orbit target's facing direction.

备注

When true, the entity's self-rotation will be relative to the orbit target's current facing direction, creating synchronized rotational behavior. When false, self-rotation uses absolute world coordinates.

InitialFacing 双端 ​

csharp
public FuncAngle? InitialFacing { get; }

The initial facing direction for the orbiting entity when it begins orbital movement.

备注

When specified, determines the starting facing orientation of the orbiting entity. If null, the entity retains its current facing direction when orbit begins. Note: this controls the entity's own facing direction, not its position on the orbit circle (which is calculated from the entity's current position).

OrbitHeight 双端 ​

csharp
public FuncFloat OrbitHeight { get; }

The orbital height that defines the vertical offset of the orbiting entity relative to the target.

备注

This controls the height at which the entity orbits around the target. Combined with HeightRelativeToTarget, it allows for both absolute and relative height positioning in orbital movement patterns.

HeightRelativeToTarget 双端 ​

csharp
public bool HeightRelativeToTarget { get; }

Whether the orbit height is calculated relative to the target's height.

备注

When true, OrbitHeight represents an offset relative to the target's current height position. When false, it represents an absolute world height coordinate for the orbital plane.

AlwaysVisibleToOrbitTarget 双端 ​

csharp
public bool AlwaysVisibleToOrbitTarget { get; }

Whether the orbiting entity should always remain visible to the orbit target.

备注

When true, even if the orbiting entity is of another team or faction, it will remain visible to the target.

IGameDataMoverTarget 双端 ​

命名空间 GameCore.Components.Data

csharp
public interface IGameDataMoverTarget : IGameDataMover, IGameData

Defines the configuration interface for movement target data, extending basic mover functionality with target-specific properties.

备注

This interface provides configuration for movers that move toward specific targets, including speed control, trajectory settings for parabolic movement, directional behavior, and ground alignment. It supports complex movement patterns like projectile arcs, homing behaviors, and physics-based motion with acceleration limits.

属性 ​

Speed 双端 ​

csharp
public FuncRate Speed { get; }

Gets the base movement speed function for the mover.

备注

This defines the primary speed at which the mover approaches its target. The function allows for dynamic speed calculation based on execution context.

Acceleration 双端 ​

csharp
public FuncRate? Acceleration { get; }

Gets the acceleration function that determines how quickly the mover reaches its target speed.

备注

When specified, the mover will gradually accelerate to its target speed rather than instantly achieving it. This provides more realistic and smooth movement behavior.

MinSpeed 双端 ​

csharp
public FuncRate? MinSpeed { get; }

Gets the minimum speed function that constrains the lower bound of movement speed.

备注

This ensures the mover maintains a minimum velocity even when slowing down or when other factors would reduce its speed below this threshold.

MaxSpeed 双端 ​

csharp
public FuncRate? MaxSpeed { get; }

Gets the maximum speed function that constrains the upper bound of movement speed.

备注

This caps the mover's velocity to prevent excessive speed, even when acceleration or other factors would increase speed beyond this limit.

LaunchHeight 双端 ​

csharp
public FuncFloat? LaunchHeight { get; }

Gets the launch height function for parabolic movement trajectories.

备注

When specified, the mover will begin its trajectory at this height above its starting position, creating an arc-like movement pattern suitable for projectiles or jumping behaviors.

TargetHeight 双端 ​

csharp
public FuncFloat? TargetHeight { get; }

Gets the target height function that defines the vertical position of the destination.

备注

This determines the final height where the mover should arrive. Combined with launch height, it helps define the overall trajectory shape for parabolic movement.

TargetHeightIsAbsolute 双端 ​

csharp
public bool TargetHeightIsAbsolute { get; }

Gets a value indicating whether the target height is an absolute world position or relative offset.

备注

When true, TargetHeight represents an absolute world coordinate. When false, it represents an offset relative to the target's position.

ParabolaApex 双端 ​

csharp
public FuncFloat? ParabolaApex { get; }

Gets the parabola apex function that defines the highest point of the movement arc.

备注

This controls the peak height of parabolic trajectories, allowing fine-tuning of arc shape for different visual and gameplay effects.

ParabolaLandingHeight 双端 ​

csharp
public FuncFloat? ParabolaLandingHeight { get; }

Gets the parabola landing height function that defines where the arc intersects the ground.

备注

This determines the final ground level for parabolic movement, useful for projectiles that need to account for terrain height differences.

TurnToDirection 双端 ​

csharp
public bool TurnToDirection { get; }

Gets a value indicating whether the mover should rotate to face its movement direction.

备注

When true, the mover will automatically orient itself to face the direction it's moving, providing natural-looking movement behavior for units and projectiles.

TurnToVelocity 双端 ​

csharp
public bool TurnToVelocity { get; }

Gets a value indicating whether the mover should rotate to face its velocity vector.

备注

Similar to TurnToDirection but uses the actual velocity vector, which may differ from movement direction when acceleration or external forces are applied.

StickToGround 双端 ​

csharp
public bool StickToGround { get; }

Gets a value indicating whether the mover should maintain contact with the ground during movement.

备注

When true, the mover will follow terrain contours and stay grounded rather than moving in straight lines through the air. This is useful for ground-based units.

VectorMoveState 仅服务端 ​

命名空间 GameCore.Components.Struct

csharp
public class VectorMoveState

摇杆移动状态管理类 记录当前摇杆移动方向和抑制状态

构造函数 ​

VectorMoveState 仅服务端 ​

csharp
public VectorMoveState(Walkable walkable)

摇杆移动状态管理类 记录当前摇杆移动方向和抑制状态

属性 ​

Is3D 仅服务端 ​

csharp
public bool Is3D { get; }

Direction 仅服务端 ​

csharp
public Vector3? Direction { get; set; }

当前摇杆移动方向(无论是否被抑制) null表示没有摇杆移动输入

IsSuppressed 仅服务端 ​

csharp
public bool IsSuppressed { get; }

摇杆移动是否被指令队列抑制 true表示有摇杆输入但被暂停,false表示摇杆移动正常执行

HasMovementInput 仅服务端 ​

csharp
public bool HasMovementInput { get; }

是否有摇杆移动输入(无论是否被抑制)

IsActivelyMoving 仅服务端 ​

csharp
public bool IsActivelyMoving { get; set; }

是否正在执行摇杆移动(有输入且未被抑制)

方法 ​

ClearDirection 仅服务端 ​

csharp
public void ClearDirection()

清空摇杆移动方向记录

UpdateDirection 仅服务端 ​

csharp
public void UpdateDirection(Vector2 direction)

更新摇杆移动方向

  • direction — 新的移动方向

UpdateDirection 仅服务端 ​

csharp
public void UpdateDirection(Vector3 direction)

Reset 仅服务端 ​

csharp
public void Reset()

重置所有状态