Skip to content

GameCore.EntitySystem ​

Entity 双端 ​

命名空间 GameCore.EntitySystem

csharp
public class Entity : DisposableObject, IActorSync, IActor, IActorAnimationPlayable, IDisposable, ISyncIdOwner, IActorScopePersist, IActorScope, IActorScopeOwner, IActorScopeContext, ICooldownHost, ICooldownOwner, IPropertyOwner, IPropertyHost, IEventSender, IExecutionContext, ITarget, ICommandTarget, IStateOwner<EntityState>

场景中所有可交互对象的基类(单位、建筑、物品、特效等)。 提供定位、归属权、可见性、生命周期管理以及父子挂接层级关系等基础能力。

构造函数 ​

Entity 双端 ​

csharp
protected internal Entity(Player player, IViewActor viewActor, bool registerCooldownHost = true)

Entity 双端 ​

csharp
public Entity(int unitId, Player player, IGameLink<GameDataUnit> unitLink, Scene scene, Vector3 position, Vector3 rotation, int componentMask)

Entity 仅服务端 ​

csharp
public Entity(Player player, ScenePoint scenePoint, Angle facing, int hash = 0)

属性 ​

BoneChains 仅客户端 ​

csharp
public ImmutableHashSet<BoneChain>? BoneChains { get; }

DefaultModel 双端 ​

csharp
protected virtual IGameLink<GameDataModel>? DefaultModel { get; }

OrderQueue 双端 ​

csharp
public OrderQueue? OrderQueue { get; set; }

BearingSnapshot 双端 ​

csharp
public BearingSnapshot BearingSnapshot { get; }

实体坐标与朝向的快照。实体销毁后仍可通过此快照获取最后已知的位置和朝向, 供死亡特效、结算逻辑等需要引用销毁后状态的系统使用。

ShouldIgnoreDamage 双端 ​

csharp
public virtual bool ShouldIgnoreDamage { get; }

Gets a value indicating whether this entity should ignore incoming damage.

备注

By default, entities do not ignore damage. Derived classes can override this property to implement damage immunity based on states, effects, or other conditions.

Scene 双端 ​

csharp
public Scene Scene { get; }

Gets the scene that contains this entity.

CanReceiveCommandRequest 双端 ​

csharp
public virtual bool CanReceiveCommandRequest { get; }

Gets a value indicating whether this entity can receive command requests from players or AI systems.

备注

This property determines if the entity can be given orders such as move, attack, or use abilities. Derived classes may override this to implement specific logic for command reception.

Facing 双端 ​

csharp
public Angle Facing { get; }

Gets the facing direction of this entity.

备注

On the client side, facing can only be read, not modified. If the entity is not valid, returns the cached facing from the bearing snapshot.

IsValid 双端 ​

csharp
public override bool IsValid { get; }

Gets a value indicating whether this entity is valid and can be used.

备注

On the client side, an entity is valid if its view actor exists. The client relies on the server to manage the detailed validity of entities.

IsAlive 双端 ​

csharp
public virtual bool IsAlive { get; }

Gets a value indicating whether this entity is alive and functional.

备注

By default, an entity is considered alive if it is valid. Derived classes such as Unit may override this to provide more specific life state logic.

Position 双端 ​

csharp
public ScenePoint Position { get; }

Gets the current position of this entity in the scene.

备注

If the entity has a parent, returns the parent's position. Otherwise, returns the entity's own position from its view actor, or the cached position if invalid.

Parent 双端 ​

csharp
public Entity? Parent { get; set; }

Gets or sets the parent entity in the attachment hierarchy.

备注

Setting the parent creates an attachment relationship where this entity will follow the parent's transformations. Setting to null detaches the entity. Circular parent-child relationships are prevented by throwing an exception.

EntityId 双端 ​

csharp
public int EntityId { get; init; }

Gets the unique identifier for this entity.

Player 双端 ​

csharp
public Player Player { get; set; }

Gets the player that owns this entity.

Filters 双端 ​

csharp
public virtual HashSet<UnitFilter>? Filters { get; }

Gets the set of unit filters that apply to this entity for targeting and selection purposes.

备注

This property is typically overridden by derived classes to provide entity-specific filtering capabilities for targeting systems, AI, and other game mechanics.

SyncId 双端 ​

csharp
public int SyncId { get; }

Gets the synchronization identifier for this entity.

SyncIdType 双端 ​

csharp
public static SyncIdType SyncIdType { get; }

Gets the type of synchronization ID used by this entity.

ApproachableTarget 双端 ​

csharp
public IApproachableTarget ApproachableTarget { get; }

Gets an interface for approaching this entity as a target.

备注

This interface is used by movement and pathfinding systems to determine how other entities can approach and interact with this entity.

HighlightAggregator 仅客户端 ​

csharp
public ArithmeticAggregator<HdrColor>? HighlightAggregator { get; set; }

TintColorAggregators 仅客户端 ​

csharp
public ValueKeyDictionary<TintColorType, ArithmeticAggregator<HdrColor>>? TintColorAggregators { get; set; }

Context 双端 ​

csharp
public IActorScopeContext Context { get; }

SourceSite 仅客户端 ​

csharp
public IActor SourceSite { get; }

EnsuredSourceSite 仅客户端 ​

csharp
public IActor EnsuredSourceSite { get; }

ClientActors 仅客户端 ​

csharp
public HashSet<Actor> ClientActors { get; }

Target 双端 ​

csharp
public ITarget? Target { get; }

AggregatorWeakReference 双端 ​

csharp
public WeakReference<EventAggregator> AggregatorWeakReference { get; }

CreationContext 双端 ​

csharp
public IExecutionContext? CreationContext { get; init; }

Creator 双端 ​

csharp
public Entity? Creator { get; }

ScaleAggregator 仅服务端 ​

csharp
protected ActorScaleAggregator? ScaleAggregator { get; }

ModelLinkAggregator 仅服务端 ​

csharp
public OrderedDictionary<object, IGameLink<GameDataModel>>? ModelLinkAggregator { get; }

IsChangingPosition 仅服务端 ​

csharp
public bool IsChangingPosition { get; }

WaveAI 仅服务端 ​

csharp
public WaveAI? WaveAI { get; set; }

方法 ​

GetById 双端 ​

csharp
public static Entity? GetById(int entityId)

Retrieves an entity by its unique identifier.

  • entityId — The unique identifier of the entity to retrieve.

返回: The entity with the specified ID, or null if not found.

UpdateActor 双端 ​

csharp
protected virtual void UpdateActor()

UpdateParentage 双端 ​

csharp
public bool? UpdateParentage()

MoveTo 双端 ​

csharp
public bool MoveTo(ScenePoint scenePoint)

将实体瞬移到指定位置(同步传送)。

SetPosition 双端 ​

csharp
public bool SetPosition(ScenePoint scenePoint, bool sync = false, bool syncDistance = false)

Sets the position of this entity to the specified scene point.

  • scenePoint — The target position to move this entity to.
  • sync — Whether to synchronize the position immediately (blink/teleport).
  • syncDistance — Whether to synchronize over distance for smooth movement.

返回: True if the position was set successfully; otherwise, false.

备注

Entities with parents cannot have their position set directly. If the target scene is different from the current scene, this method will attempt to switch scenes first. On the server, the target scene must be loaded for the operation to succeed.

IsAncestorOf 双端 ​

csharp
public bool IsAncestorOf(Entity? other)

Checks if this entity is an ancestor of another entity in the parent-child hierarchy.

  • other — The entity to check for descendant relationship.

返回: True if this entity is an ancestor of the other entity; otherwise, false.

备注

This method traverses up the parent chain of the other entity to determine if this entity appears anywhere in that chain. Returns true if the entities are the same.

GetTagComponent 双端 ​

csharp
public TagComponent? GetTagComponent(ComponentTag tag)

Retrieves a tag component of any type by its tag identifier.

  • tag — The tag identifier of the component to retrieve.

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

GetTagComponent 双端 ​

csharp
public TComponent? GetTagComponent<TComponent>() where TComponent : class

Retrieves the first tag component that implements the requested interface or base type.

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

HasTagComponent 双端 ​

csharp
public bool HasTagComponent(ComponentTag tag)

Checks if this entity has a tag component with the specified tag.

  • tag — The tag identifier to check for.

返回: True if the entity has a component with the specified tag; otherwise, false.

GetComponentSet 双端 ​

csharp
public ReadOnlySet<TComponent>? GetComponentSet<TComponent>() where TComponent : Component<TComponent>

Get component set of the entity. This create a read-only set of the component set.

返回:

HasFilter 双端 ​

csharp
public bool HasFilter(UnitFilter filter)

判定此实体是否拥有指定的静态分类标签。

GetRelationship 双端 ​

csharp
public UnitRelationship GetRelationship(Entity target)

获取目标实体相对于当前实体的关系。 与 Player) 不同,此方法额外处理 Self 判定。

  • target — 要判定关系的目标实体。

返回: 目标相对于当前实体的 UnitRelationship。

IsValidTargetTo 双端 ​

csharp
public bool IsValidTargetTo(Entity caster, bool isRequest)

Determines if this entity is a valid target for the specified caster.

  • caster — The entity attempting to target this entity.
  • isRequest — Whether this is a targeting request that requires visibility.

返回: True if this entity can be targeted by the caster; otherwise, false.

备注

For an entity to be a valid target, it must be in the same scene as the caster. If this is a targeting request, the entity must also be visible to the caster.

SameScene 双端 ​

csharp
public bool SameScene(ITarget target)

Checks if this entity is in the same scene as the specified target.

  • target — The target to compare scenes with.

返回: True if both entities are in the same scene; otherwise, false.

CanBeSeen 双端 ​

csharp
public bool CanBeSeen(Entity caster)

判断此实体是否对指定施法者可见。 服务端通过引擎的视野系统判定;客户端通过玩家关系判定(盟友或本地玩家可见)。

AngleTo 双端 ​

csharp
public Angle? AngleTo(ITarget target)

Calculates the angle from this entity to the specified target.

  • target — The target to calculate the angle to.

返回: The angle to the target, or null if they are in different scenes.

备注

If the entities are at the same position or are the same entity, returns the current facing direction. Otherwise, calculates the angle based on their positions.

VectorTargetPosition 双端 ​

csharp
public ScenePoint? VectorTargetPosition(ITarget target, double vectorLength)

Calculates a position at a specified vector length in the direction of the target.

  • target — The target to calculate the vector towards.
  • vectorLength — The length of the vector from this entity's position.

返回: The calculated scene point, or null if the target is in a different scene.

备注

This method is useful for positioning effects, projectiles, or other objects at a specific distance in the direction of a target. The vector length is adjusted by this entity's interaction radius.

GetFilterTags 双端 ​

csharp
public virtual void GetFilterTags(Entity caster, in HashSet<UnitFilterTag> tags)

根据此实体与施法者的关系,填充筛选标签集合(Self/Player/Alliance/Enemy/Neutral/Visible)。 用于目标筛选、AI 决策等需要按关系过滤实体的系统。

CanBeControlledBy 双端 ​

csharp
public bool CanBeControlledBy(Player player)

判断指定玩家是否有权控制此实体。同时检查 Player 级别和实体级别的共享控制权。

InitializeHighlightAggregator 仅客户端 ​

csharp
public void InitializeHighlightAggregator()

SetHighlight 仅客户端 ​

csharp
public void SetHighlight(HdrColor color, object? key, double weight = 1.0)

ClearHighlight 仅客户端 ​

csharp
public void ClearHighlight(object? key)

ClearAllHighlights 仅客户端 ​

csharp
public void ClearAllHighlights()

AnimateHighlight 仅客户端 ​

csharp
public ArithmeticAnimation<ArithmeticMixer<HdrColor>> AnimateHighlight(HdrColor color, TimeSpan blendTime, bool autoReverse = false, RepeatBehavior? repeatBehavior = null, object? key = null, double weight = 1.0)

AnimateHighlight 仅客户端 ​

csharp
public ArithmeticAnimation<ArithmeticMixer<HdrColor>> AnimateHighlight(HdrColor from, HdrColor to, TimeSpan blendTime, bool autoReverse = false, RepeatBehavior? repeatBehavior = null, object? key = null, double weight = 1.0)

InitializeTintColorAggregators 仅客户端 ​

csharp
public void InitializeTintColorAggregators()

SetTintColor 仅客户端 ​

csharp
public void SetTintColor(HdrColor color, TintColorType tintColorType = TintColorType.Factor, object? key = null, double weight = 1.0)

ClearTintColorByKey 仅客户端 ​

csharp
public void ClearTintColorByKey(object? key, TintColorType tintColorType = TintColorType.Factor)

ResetTintColorByType 仅客户端 ​

csharp
public void ResetTintColorByType(TintColorType tintColorType = TintColorType.Factor)

ClearTintColor 仅客户端 ​

csharp
public void ClearTintColor()

AnimateTintColor 仅客户端 ​

csharp
public ArithmeticAnimation<ArithmeticMixer<HdrColor>> AnimateTintColor(HdrColor color, TintColorType tintColorType = TintColorType.Factor, TimeSpan blendTime = default(TimeSpan), bool autoReverse = false, RepeatBehavior? repeatBehavior = null, object? key = null, double weight = 1.0)

AnimateTintColor 仅客户端 ​

csharp
public ArithmeticAnimation<ArithmeticMixer<HdrColor>> AnimateTintColor(HdrColor from, HdrColor to, TintColorType tintColorType = TintColorType.Factor, TimeSpan blendTime = default(TimeSpan), bool autoReverse = false, RepeatBehavior? repeatBehavior = null, object? key = null, double weight = 1.0)

InitializeColorAggregators 仅客户端 ​

csharp
public void InitializeColorAggregators()

ClearAllColorEffects 仅客户端 ​

csharp
public void ClearAllColorEffects()

DisposeManaged 双端 ​

csharp
protected override void DisposeManaged()

DisposeUnmanaged 双端 ​

csharp
protected override void DisposeUnmanaged(bool finalizing)

Publish 双端 ​

csharp
public virtual void Publish<TEvent>(TEvent eventToPublish)

GetPublisher 双端 ​

csharp
public virtual Action<TEvent>? GetPublisher<TEvent>()

AddState 双端 ​

csharp
public void AddState(EntityState state)

RemoveState 双端 ​

csharp
public void RemoveState(EntityState state)

HasState 双端 ​

csharp
public bool HasState(EntityState state)

AddImmunity 双端 ​

csharp
public void AddImmunity(EntityState state)

RemoveImmunity 双端 ​

csharp
public void RemoveImmunity(EntityState state)

HasImmunity 双端 ​

csharp
public bool HasImmunity(EntityState state)

SetScale 仅服务端 ​

csharp
public void SetScale(float scale, object? tag = null)

以聚合器模式设置缩放(多方可通过不同 tag 各自设置缩放,最终值取聚合结果)。 使用 Object) 移除指定 tag 的缩放。

ClearScale 仅服务端 ​

csharp
public void ClearScale(object? tag = null)

ClearAllScale 仅服务端 ​

csharp
public void ClearAllScale()

ModelSwap 仅服务端 ​

csharp
public virtual void ModelSwap(IGameLink<GameDataModel> link, object? tag = null)

以聚合器模式替换模型(支持多层叠加,后入优先)。 使用 Object) 移除指定 tag 的模型替换,恢复为前一层或默认模型。

ModelSwapPop 仅服务端 ​

csharp
public void ModelSwapPop(object tag)

ChangeOwner 仅服务端 ​

csharp
public bool ChangeOwner(Player newPlayer)

Changes the ownership of this entity to a new player.

  • newPlayer — The player who will become the new owner of this entity.

返回: True if the ownership change was successful; otherwise, false.

备注

This operation updates both the entity's player reference and the underlying view actor's ownership.

OnSceneSwitched 仅服务端 ​

csharp
protected virtual void OnSceneSwitched(Scene oldScene, Scene newScene)

Called after the underlying view actor and GameCore scene collections have been updated successfully.

csharp
protected virtual bool ChangeLink(int linkHashLocal)

Changes the data link hash for this entity, potentially altering its appearance or behavior.

  • linkHashLocal — The new link hash to apply to this entity.

返回: True if the link change was successful; otherwise, false.

备注

This is used for morphing or transforming entities while preserving their identity. The hash corresponds to different data configurations that define the entity's properties.

SetFacing 仅服务端 ​

csharp
public void SetFacing(Angle facing, TimeSpan duration)

Sets the facing direction of this entity with animation over a specified duration.

  • facing — The target facing direction.
  • duration — The time span over which to rotate to the new facing direction.
备注

This method allows for smooth rotation animations. The entity will gradually turn from its current facing to the specified direction over the given duration.

Kill 仅服务端 ​

csharp
public virtual void Kill(DeathType deathType = DeathType.Normal, IExecutionContext? context = null)

Kills this entity with the specified death type and execution context.

  • deathType — The type of death that occurred (default: Normal).
  • context — The execution context that caused the death, if any.
备注

This method triggers the EntityDeath event before destroying the entity. It provides a way to distinguish between different types of entity destruction for proper event handling and effects.

IsVisibleTo 仅服务端 ​

csharp
public bool IsVisibleTo(Player player)

判断此实体是否对指定玩家可见(服务端视野系统)。 已知问题:刚创建的单位在当前帧不可见,需等待一帧。

SetShareControlTo 仅服务端 ​

csharp
public void SetShareControlTo(Player player, bool on)

设置是否将此实体的控制权共享给指定玩家(实体级别的共享,区别于 Player 级别的共享)。

IsVisibleToTransient 仅服务端 ​

csharp
public bool IsVisibleToTransient(Player player)

SetSyncType 仅服务端 ​

csharp
public void SetSyncType(SyncType type)

事件 ​

OnPositionChangingStart 仅服务端 ​

csharp
public event Action<ITarget>? OnPositionChangingStart

OnPositionChangingEnd 仅服务端 ​

csharp
public event Action<ITarget>? OnPositionChangingEnd

字段 ​

_viewActor 双端 ​

csharp
protected internal IViewActor _viewActor

_clientActors 仅客户端 ​

csharp
protected HashSet<Actor>? _clientActors

aggregator 双端 ​

csharp
protected EventAggregator? aggregator

syncIds 双端 ​

csharp
protected QuickDictionary<long, HashSet<int>>? syncIds

EPropertyUnit 双端 ​

命名空间 GameCore.EntitySystem

csharp
public enum EPropertyUnit

枚举值 ​

  • PlacedId
  • Dead
  • DeathType
  • States
  • ModSeed
  • Level — The current level of the unit.
  • Experience — The experience points gained since the last level up.
  • ExperienceToNextLevel — The total experience points required to advance from the current level to the next level.
  • StatusBarDisplayName — The text displayed by status bar widgets for this unit.
  • StatusBarDisplayImage — The image displayed by status bar widgets for this unit.

PropertyItem 双端 ​

命名空间 GameCore.EntitySystem

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

方法 ​

ToString 双端 ​

csharp
public override string? ToString()

operator == 双端 ​

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

operator != 双端 ​

csharp
public static bool operator !=(PropertyItem left, PropertyItem 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 System.Enum InnerValue

PlacedId 双端 ​

csharp
public static readonly PropertyItem PlacedId

Slot 双端 ​

csharp
public static readonly PropertyItem Slot

Stack 双端 ​

csharp
public static readonly PropertyItem Stack

Level 双端 ​

csharp
public static readonly PropertyItem Level

Quality 双端 ​

csharp
public static readonly PropertyItem Quality

PropertyItemMod 双端 ​

命名空间 GameCore.EntitySystem

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

方法 ​

ToString 双端 ​

csharp
public override string? ToString()

operator == 双端 ​

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

operator != 双端 ​

csharp
public static bool operator !=(PropertyItemMod left, PropertyItemMod 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 System.Enum InnerValue

ModSeedCarry 双端 ​

csharp
public static readonly PropertyItemMod ModSeedCarry

ModSeedEquip 双端 ​

csharp
public static readonly PropertyItemMod ModSeedEquip

ActiveAbility 双端 ​

csharp
public static readonly PropertyItemMod ActiveAbility

DynamicModificationKeys 双端 ​

csharp
public static readonly PropertyItemMod DynamicModificationKeys

PropertyPlayer 双端 ​

命名空间 GameCore.EntitySystem

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

方法 ​

ToString 双端 ​

csharp
public override string? ToString()

operator == 双端 ​

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

operator != 双端 ​

csharp
public static bool operator !=(PropertyPlayer left, PropertyPlayer 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 System.Enum InnerValue

SharedControlToPlayers 双端 ​

csharp
public static readonly PropertyPlayer SharedControlToPlayers

PropertyPlayerNumeric 双端 ​

命名空间 GameCore.EntitySystem

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

方法 ​

ToString 双端 ​

csharp
public override string? ToString()

operator == 双端 ​

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

operator != 双端 ​

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

Equals 双端 ​

csharp
public override bool Equals(object? obj)

GetHashCode 双端 ​

csharp
public override int GetHashCode()

OnRegisterGameClass 双端 ​

csharp
public static void OnRegisterGameClass()

implicit operator 双端 ​

csharp
public static PropertyPlayer implicit operator(PropertyPlayerNumeric e)

字段 ​

InnerValue 双端 ​

csharp
public readonly System.Enum InnerValue

Gold 双端 ​

csharp
public static readonly PropertyPlayerNumeric Gold

PropertyUnit 双端 ​

命名空间 GameCore.EntitySystem

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

方法 ​

ToString 双端 ​

csharp
public override string? ToString()

operator == 双端 ​

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

operator != 双端 ​

csharp
public static bool operator !=(PropertyUnit left, PropertyUnit 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 System.Enum InnerValue

PlacedId 双端 ​

csharp
public static readonly PropertyUnit PlacedId

Dead 双端 ​

csharp
public static readonly PropertyUnit Dead

DeathType 双端 ​

csharp
public static readonly PropertyUnit DeathType

States 双端 ​

csharp
public static readonly PropertyUnit States

ModSeed 双端 ​

csharp
public static readonly PropertyUnit ModSeed

Level 双端 ​

csharp
public static readonly PropertyUnit Level

The current level of the unit.

Experience 双端 ​

csharp
public static readonly PropertyUnit Experience

The experience points gained since the last level up.

ExperienceToNextLevel 双端 ​

csharp
public static readonly PropertyUnit ExperienceToNextLevel

The total experience points required to advance from the current level to the next level.

StatusBarDisplayName 双端 ​

csharp
public static readonly PropertyUnit StatusBarDisplayName

The text displayed by status bar widgets for this unit.

StatusBarDisplayImage 双端 ​

csharp
public static readonly PropertyUnit StatusBarDisplayImage

The image displayed by status bar widgets for this unit.

Team 双端 ​

命名空间 GameCore.EntitySystem

csharp
public class Team

Represents a team that groups players together for shared objectives, visibility, and game mechanics.

备注

Teams provide a way to organize players into groups that share common goals, resources, and visibility. Players on the same team typically have allied relationships and can cooperate in various game systems. Each team has a unique identifier and manages its member players automatically.

属性 ​

DisplayName 双端 ​

csharp
public LocalizedString? DisplayName { get; set; }

Id 双端 ​

csharp
public int Id { get; }

Gets the unique identifier for this team.

方法 ​

ToString 双端 ​

csharp
public override string ToString()

Returns a string representation of this team.

返回: A formatted string containing the team identifier.

GetAllPlayers 双端 ​

csharp
public Player[] GetAllPlayers()

Gets an array containing all players currently on this team.

返回: An array of all players belonging to this team.

备注

This method creates a new array each time it's called to prevent external modification of the internal player collection. The returned array represents a snapshot of the team membership at the time of the call.

AddPlayer 双端 ​

csharp
public void AddPlayer(Player player)

Adds a player to this team.

  • player — The player to add to this team.
备注

If the player is already on this team, no action is taken. If the player belongs to another team, they will be automatically removed from their current team before being added to this one. On the server side, the player's Team property will be updated to reference this team.

GetById 双端 ​

csharp
public static Team? GetById(int id)

Retrieves an existing team by its identifier.

  • id — The unique identifier of the team to retrieve.

返回: The team with the specified ID, or null if no team exists with that ID.

备注

This method only returns existing teams that have already been created. Use GetOrCreateById if you need to ensure a team exists.

Unit 双端 ​

命名空间 GameCore.EntitySystem

csharp
public class Unit : Entity, IActorAnimationPlayable, IActor, ITarget, ICommandTarget, IActorScope, IActorScopeContext, ICooldownHost, ICooldownOwner, IPropertyOwner, ISyncIdOwner, IPropertyHost, IDisplayInfo, IGameObject<GameDataUnit>, IGameObject, IKillable, IPropertyOwner<PropertyUnit>, IPropertyOwner<PropertyUnitMovement>, IResponseOwner, IExecutionContext, IStateOwner<UnitState>

Represents a game unit entity with advanced capabilities including abilities, inventories, vitals, and level progression.

备注

Unit extends the base Entity class to provide game-specific functionality such as:

  • Ability system integration for spells and skills
  • Inventory management for items and equipment
  • Vital properties like health and mana
  • Leveling and experience systems
  • State management for unit conditions
  • Combat and interaction capabilities This class serves as the foundation for characters, NPCs, creatures, and other interactive game objects.

构造函数 ​

Unit 仅客户端 ​

csharp
protected Unit(IGameLink<GameDataUnit> link, Player player, IViewActor viewActor)

Unit 双端 ​

csharp
protected internal Unit(int unitId, Player player, IGameLink<GameDataUnit> link, Scene scene, Vector3 position, Vector3 rotation, int componentMask)

Unit 仅服务端 ​

csharp
protected internal Unit(IGameLink<GameDataUnit> link, Player player, ScenePoint scenePoint, Angle facing)

Initializes a new unit with the specified data link, owner, position, and facing direction.

  • link — The game data link defining this unit's properties and capabilities.
  • player — The player that owns this unit.
  • scenePoint — The initial position of the unit in the scene.
  • facing — The initial facing direction of the unit.
备注

This constructor sets up all unit systems including components, abilities, inventories, vitals, and states based on the configuration defined in the unit's game data.

属性 ​

DefaultModel 双端 ​

csharp
protected override IGameLink<GameDataModel>? DefaultModel { get; }

ModSeed 双端 ​

csharp
public int ModSeed { get; }

Gets or sets the modification seed used for random generation and procedural content.

备注

This value is used to ensure consistent random generation for unit properties and behaviors. On the server, it's automatically generated; on the client, it's synchronized from the server.

ShouldIgnoreDamage 双端 ​

csharp
public override bool ShouldIgnoreDamage { get; }

Gets a value indicating whether this unit should ignore incoming damage.

备注

Units ignore damage when they are dead or when the base entity has damage immunity.

InteractRadius 双端 ​

csharp
public float InteractRadius { get; }

Gets the radius within which other entities can interact with this unit.

CanReceiveCommandRequest 双端 ​

csharp
public override bool CanReceiveCommandRequest { get; }

Gets a value indicating whether this unit can receive command requests from players or AI.

备注

Units cannot receive commands when they have the UnCommandable state or when the base entity cannot receive commands.

Filters 双端 ​

csharp
public override HashSet<UnitFilter>? Filters { get; }
csharp
public IGameLink<GameDataUnit> Link { get; }

Cache 双端 ​

csharp
public GameDataUnit Cache { get; }

UnitLinkAggregator 双端 ​

csharp
public OrderedDictionary<object, IGameLink<GameDataUnit>>? UnitLinkAggregator { get; }

LinkOrigin 双端 ​

csharp
public IGameLink<GameDataUnit> LinkOrigin { get; }

IsDead 双端 ​

csharp
public bool IsDead { get; }

IsAlive 双端 ​

csharp
public override bool IsAlive { get; }

PlacedUnit 双端 ​

csharp
public PlacedUnit? PlacedUnit { get; set; }

StatusBarDisplayName 双端 ​

csharp
public UTF8String StatusBarDisplayName { get; }

UTF8 text displayed by status bar widgets bound to StatusBarDisplayName.

StatusBarDisplayImage 双端 ​

csharp
public UTF8String StatusBarDisplayImage { get; }

UTF8 image path displayed by status bar widgets bound to StatusBarDisplayImage.

StatusBar 仅客户端 ​

csharp
public StatusBar StatusBar { get; }

Runtime handle for this unit's current status bar.

Vision 双端 ​

csharp
public UnitVision Vision { get; }

懒创建单位视野能力对象。

VisionIfCreated 双端 ​

csharp
public UnitVision? VisionIfCreated { get; }

获取已创建的单位视野能力对象;未创建时返回 null。

Height 仅服务端 ​

csharp
public float Height { get; set; }

Attack 仅服务端 ​

csharp
public AbilityExecute? Attack { get; }

LootOverride 仅服务端 ​

csharp
public IGameLink<GameDataReward>? LootOverride { get; set; }

运行时覆盖的战利品奖励,优先级高于数据表中的 Loot 字段

备注

此属性允许在运行时动态修改单位死亡时掉落的战利品。 优先级:LootOverride > GameDataUnit.Loot 使用场景: 动态调整掉落奖励(如活动期间提升掉落) 特殊BOSS的临时掉落配置 根据游戏进度动态调整掉落 注意事项: 设置为 null 将恢复使用数据表中的配置 当死亡类型为 Destroy 时,不会发放任何奖励 奖励优先发放给击杀者,若无击杀者则发放给单位自己

方法 ​

GetFilterTags 双端 ​

csharp
public override void GetFilterTags(Entity caster, in HashSet<UnitFilterTag> tags)

Populates the provided tag set with filter tags that apply to this unit from the perspective of the given caster.

  • caster — The entity requesting the filter information.
  • tags — The set to populate with applicable filter tags.
备注

This method combines static filters from the unit's configuration with dynamic filters based on current states. The tags are used for targeting, abilities, and other game systems that need to filter or categorize units.

ToString 双端 ​

csharp
public override string ToString()

Returns a string representation of this unit including its type and friendly name.

返回: A formatted string describing this unit.

Dispose 双端 ​

csharp
protected override void Dispose(bool disposing)

Performs cleanup of unit-specific resources during disposal.

  • disposing — True if called from Dispose method; false if called from finalizer.

DisposeManaged 双端 ​

csharp
protected override void DisposeManaged()

Publish 双端 ​

csharp
public override void Publish<TEvent>(TEvent eventToPublish)

GetPublisher 双端 ​

csharp
public override Action<TEvent>? GetPublisher<TEvent>()

GetProperty 双端 ​

csharp
public TValue? GetProperty<TValue>(PropertyUnit property)

GetProperty 双端 ​

csharp
public TValue? GetProperty<TValue>(PropertyUnitMovement property)

Gets a movement-controller host property value by stable movement property key.

HasState 双端 ​

csharp
public bool HasState(UnitState state)

GetStates 双端 ​

csharp
public HashSet<UnitState> GetStates()

AddHeight 仅服务端 ​

csharp
public void AddHeight(float height)

Morph 仅服务端 ​

csharp
public void Morph(IGameDataMorph morphData)

将此单位变形为另一个单位配置。通过 MorphFlags 控制变形范围 (模型、技能、响应、属性、状态等)。变形可通过 IGameDataMorph) 撤销。

UnMorph 仅服务端 ​

csharp
public void UnMorph(IGameDataMorph morphData)

撤销指定的变形,将受影响的方面恢复为当前 Link 栈顶的配置。 如果该变形不在 Link 聚合器中,则不执行任何操作。

LinkSwap 仅服务端 ​

csharp
public virtual bool LinkSwap(IGameLink<GameDataUnit> newLink, object? tag = null)

以聚合器模式替换此单位的数据链接(用于变形等场景,支持多层叠加,后入优先)。 使用 Object) 移除指定 tag 的替换。

LinkSwapPop 仅服务端 ​

csharp
public bool LinkSwapPop(object tag)

移除指定 tag 的数据链接替换,恢复为聚合器中前一层或原始链接。

Kill 仅服务端 ​

csharp
public override void Kill(DeathType deathType = DeathType.Normal, IExecutionContext? context = null)

击杀此单位。拥有 Unkillable 状态的单位不会被击杀。

备注

流程:经验结算 → 触发 EventEntityDeath → 标记死亡 → 发放战利品 → 禁用 AI → Normal 死亡保留实体(可复活),其他死亡类型立即销毁实体。

Revive 仅服务端 ​

csharp
public void Revive()

复活此单位。移除死亡状态、重新启用 AI 并触发 EventUnitRevive 事件。 对已存活的单位调用无效果。

SetProperty 仅服务端 ​

csharp
public void SetProperty<TValue>(PropertyUnit property, TValue value)

AddProperty 仅服务端 ​

csharp
public void AddProperty(PropertyUnit property, double value)

SetProperty 仅服务端 ​

csharp
public void SetProperty<TValue>(PropertyUnitMovement property, TValue value)

Sets a movement-controller host property value by stable movement property key.

AddState 仅服务端 ​

csharp
public void AddState(UnitState state)

RemoveState 仅服务端 ​

csharp
public void RemoveState(UnitState state)

AddImmunity 仅服务端 ​

csharp
public void AddImmunity(UnitState state)

RemoveImmunity 仅服务端 ​

csharp
public void RemoveImmunity(UnitState state)

HasImmunity 仅服务端 ​

csharp
public bool HasImmunity(UnitState state)

OnSceneSwitched 仅服务端 ​

csharp
protected override void OnSceneSwitched(Scene oldScene, Scene newScene)

事件 ​

OnDeath 仅服务端 ​

csharp
public event Action<DeathType>? OnDeath

OnRevived 仅服务端 ​

csharp
public event Action? OnRevived

GameDataUnit 双端 ​

命名空间 GameCore.EntitySystem.Data

csharp
public class GameDataUnit : GameDataCategory<GameDataUnit>, IResponseOwnerData, IGameDataActorScopeOwner, IGameData<IGameDataActorScopeOwner>, IGameData, IDisplayInfoData, IEventSender, IGameDataActorScope, IGameDataNativeCacheRefreshable, IGameDataCategory<GameDataUnit>, IGameData<GameDataUnit>

单位的数据配置,定义单位的外观、能力、属性、AI、碰撞等所有静态配置。

构造函数 ​

GameDataUnit 双端 ​

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

GameDataUnit 双端 ​

csharp
public GameDataUnit(IGameLink<GameDataUnit> link)

属性 ​

DisplayName 双端 ​

csharp
public LocalizedString? DisplayName { get; set; }

Description 双端 ​

csharp
public LocalizedString? Description { get; set; }

Icon 双端 ​

csharp
public Icon? Icon { get; set; }

Filter 双端 ​

csharp
public List<UnitFilter> Filter { get; set; }

单位的分类标签集合,用于技能目标筛选和效果条件判断(如 Hero、Unit、Building 等)

State 双端 ​

csharp
public List<UnitState>? State { get; set; }

单位创建时默认启用的状态列表(如隐身、忽略碰撞等)

AttackableRadius 双端 ​

csharp
public float AttackableRadius { get; set; }

可被攻击的判定半径。当目标选择或弹道命中判定时,以此半径作为单位的可攻击范围

CollisionRadius 双端 ​

csharp
public float CollisionRadius { get; set; }

碰撞体半径,用于单位之间的物理碰撞和寻路避让计算

Height 双端 ​

csharp
public float Height { get; set; }

单位距地面的初始高度偏移。 适用于需要悬浮显示的单位(如掉落物、飞行单位)。 运行时可通过 Unit.Height 属性动态修改。

DynamicCollisionMask 双端 ​

csharp
public DynamicCollisionMask DynamicCollisionMask { get; set; }

动态碰撞掩码,决定此单位与哪些类型的动态物体产生碰撞

Abilities 双端 ​

csharp
public List<IGameLink<GameDataAbility>?>? Abilities { get; set; }

单位自带的技能列表。列表中的位置对应技能栏的槽位索引,null 表示该槽位为空

Responses 双端 ​

csharp
public List<IGameLink<GameDataResponse>?>? Responses { get; set; }

单位的响应列表,用于在特定事件发生时自动触发效果(如受到伤害时反弹)

Inventories 双端 ​

csharp
public List<IGameLink<GameDataInventory>?>? Inventories { get; set; }

单位拥有的背包/容器列表,每个容器可独立配置槽位数量和物品限制

Properties 双端 ​

csharp
public UnitPropertyInitialData Properties { get; set; }

单位的初始属性值集合(如最大生命、攻击力、移速等)

VitalProperties 双端 ​

csharp
public List<IGameLink<GameDataVital>?>? VitalProperties { get; set; }

单位的生命维持属性配置(如生命值、魔法值等需要持续追踪的资源属性)

UpdateFlags 双端 ​

csharp
public UpdateFlags UpdateFlags { get; set; }

单位的更新行为标志,控制是否可移动、可转向、可行走等基本行为开关

MovementController 双端 ​

csharp
public IGameLink<GameDataUnitMovementController>? MovementController { get; set; }

可选单位移动控制器配置。配置存在时,服务端创建单位时会创建并初始化单位移动控制器。

Model 双端 ​

csharp
public IGameLink<GameDataModel>? Model { get; set; }

Particle 双端 ​

csharp
public Particle? Particle { get; set; }

TacticalAI 双端 ​

csharp
public IGameLink<GameDataAIThinkTree>? TacticalAI { get; set; }

单位的默认战术 AI 思维树,决定单位的自主行为逻辑

Footprint 双端 ​

csharp
public Footprint? Footprint { get; set; }

单位的占地配置。设置后单位将在场景中占据固定区域,影响寻路和碰撞类型(静态或动态)

Leveling 双端 ​

csharp
public IGameLink<GameDataUnitLeveling>? Leveling { get; set; }

单位的等级成长配置,定义升级所需经验、每级属性成长等

Level 双端 ​

csharp
public int Level { get; set; }

单位创建后的初始等级。若大于 0,则在单位创建后自动设置其等级。

备注

当单位拥有 Leveling 配置时,通过 ForceSetLevel 设置, 受到 LevelMax 限制。 当单位没有 Leveling 配置时,直接写入 Level 属性。

Vision 双端 ​

csharp
public UnitVisionConfig? Vision { get; set; }

可选单位视野能力默认配置。配置存在时,单位构造后会懒创建 UnitVision 并应用该配置。 该配置目前只影响 Precise 场景视野模式下的可见性判定; 客户端本地视野遮罩在设置了本地焦点时也会复用同一份形状参数。

Loot 双端 ​

csharp
public IGameLink<GameDataReward>? Loot { get; set; }

单位死亡时掉落的战利品奖励

备注

当单位死亡时,系统会根据此配置向击杀者发放奖励。 发放条件: 单位死亡类型不是 Destroy(被移除) 运行时的 LootOverride 为 null 时才使用此配置 奖励接收者优先级: 击杀者(造成单位死亡的实体) 单位自己(当无法获取击杀者时) 配置优先级: LootOverride - 运行时动态覆盖(优先) Loot - 数据表配置(默认) 支持的奖励类型: GameDataRewardItem - 物品奖励 GameDataRewardUnit - 单位奖励 GameDataRewardAbility - 技能奖励 GameDataRewardBuff - Buff奖励 GameDataRewardEffect - 效果奖励 GameDataRewardSet - 奖励集合(支持随机掉落)

ActorArray 双端 ​

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

单位附带的表现(Actor)列表,用于附加额外的视觉效果(如光环、翅膀等)。 Actor 会自动附着在单位的隐含场景 Node 上。 即使不设 Model,仅配置 ActorArray 的单位也是有效的—— 适用于掉落物、经验宝石等仅需粒子特效而不需要 3D 模型的场景实体。

PrimitiveShape 双端 ​

csharp
public PrimitiveShapeConfig? PrimitiveShape { get; set; }

单位的基本几何形状配置(单个形状)

备注

当单位没有复杂模型时,可以使用基本几何形状作为临时表现。 这些形状会在客户端自动创建并附着到单位上。 如果同时设置了PrimitiveShape和CompositeShapes,将优先使用CompositeShapes。

CompositeShapes 双端 ​

csharp
public List<PrimitiveShapeConfig>? CompositeShapes { get; set; }

单位的复合几何形状配置(多个形状组合)

备注

用于创建由多个基本形状组成的复杂表现,如机器人、建筑等。 数组中的形状会按照Priority排序后依次创建。

ScaleVector 双端 ​

csharp
public Vector3? ScaleVector { get; set; }

单位模型的缩放向量。null 使用默认缩放(1,1,1)

Rotation 双端 ​

csharp
public Vector3? Rotation { get; set; }

单位模型的初始旋转角度(欧拉角,单位:度)

MiniMapIcon 双端 ​

csharp
public MiniMapIcon? MiniMapIcon { get; set; }

单位在小地图上的图标配置

StatusBarSetting 双端 ​

csharp
public StatusBarSetting? StatusBarSetting { get; set; }

单位头顶状态栏的显示配置(如血条、名称、等级等)

DeathRemovalDelay 双端 ​

csharp
public TimeSpan? DeathRemovalDelay { get; set; }

单位死亡后的移除延迟。延迟期间单位仍可被复活,复活后延迟重置。 拥有静态 Footprint 的单位不适用此设置。null 表示无延迟(立即移除)。

DeathProcedure 双端 ​

csharp
public DeathProcedure? DeathProcedure { get; set; }

单位的死亡流程配置,可自定义死亡时播放的动画和效果序列

ImpactActors 双端 ​

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

FilterCache 双端 ​

csharp
public HashSet<UnitFilter> FilterCache { get; }

AggregatorWeakReference 双端 ​

csharp
public WeakReference<EventAggregator> AggregatorWeakReference { get; }

SyncType 双端 ​

csharp
public SyncType SyncType { get; set; }

DebugDrawSettings 双端 ​

csharp
public DebugDrawSettings? DebugDrawSettings { get; set; }

方法 ​

ClearFilterCache 双端 ​

csharp
public void ClearFilterCache()

单位的物理属性配置(如质量、摩擦力等),用于物理模拟

SetNativeCacheRefresh 双端 ​

csharp
public void SetNativeCacheRefresh(bool refresh = true)

请求刷新此单位定义在 native 侧的缓存。

  • refresh — 为 true 时,请求 native 侧在下次读取此 GameDataUnit 定义时重建缓存; 为 false 时,清除此刷新请求。
备注

某些 GameDataUnit 定义在运行时会被 native 层缓存。 如果你在游戏运行过程中修改了这类定义,后续新创建的单位不一定会自动使用最新值。 调用此方法后,后续再次读取此定义的 native 逻辑会使用最新数据。 但已经创建并持有旧缓存结果的运行时对象,不保证立即更新。 这个方法适合在你运行时修改单位定义后调用。 如果该单位定义尚未被 native 侧读取过,提前调用通常也是安全的。

CreateUnit 仅服务端 ​

csharp
public virtual Unit? CreateUnit(Player player, ScenePoint scenePoint, Angle facing, IExecutionContext? creationContext = null, bool useDefaultAI = false)

根据此数据配置创建一个单位实例。仅服务端可用。

备注

创建流程:约束坐标 → 实例化 Unit → 可选添加默认 AI → 触发 EventUnitCreate 事件。 创建失败时不会抛出异常,而是记录错误日志并返回 null。 创建结果同时存储在 LastCreatedUnit 中。

DeathProcedureMode 双端 ​

命名空间 GameCore.EntitySystem.Data.Enum

csharp
public enum DeathProcedureMode

枚举值 ​

  • None
  • Sink
  • Disintegrate

DynamicCollisionMask 双端 ​

命名空间 GameCore.EntitySystem.Data.Enum

csharp
public enum DynamicCollisionMask

枚举值 ​

  • None = 0u
  • Hero = 1u
  • Unit = 2u
  • Item = 4u
  • Building = 8u
  • Custom4 = 0x10u
  • Custom5 = 0x20u
  • Custom6 = 0x40u
  • Custom7 = 0x80u
  • Custom8 = 0x100u
  • Custom9 = 0x200u
  • Custom10 = 0x400u
  • Custom11 = 0x800u
  • Custom12 = 0x1000u
  • Custom13 = 0x2000u
  • Custom14 = 0x4000u
  • Custom15 = 0x8000u

ViewActorType 双端 ​

命名空间 GameCore.EntitySystem.Data.Enum

csharp
public enum ViewActorType

枚举值 ​

  • Unit = 1 — Normal creature, has most of the features.
  • Projectile = 2 — Cannot walk, can have mover, destroyed after killed.
  • Block = 3 — Cannot walk, cannot have mover, but have customized static collision footprint.
  • Building = 5 — Creature but cannot walk, can have customized dynamic collision footprint.
  • Destructible = 6 — Cannot walk, cannot have mover, cannot have footprint.

DeathProcedure 双端 ​

命名空间 GameCore.EntitySystem.Data.Struct

csharp
public class DeathProcedure

构造函数 ​

DeathProcedure 双端 ​

csharp
public DeathProcedure()

属性 ​

Mode 双端 ​

csharp
public DeathProcedureMode Mode { get; set; }

SinkHeightDelta 双端 ​

csharp
public float SinkHeightDelta { get; set; }

StatusBarSetting 双端 ​

命名空间 GameCore.EntitySystem.Data.Struct

csharp
public class StatusBarSetting

构造函数 ​

StatusBarSetting 双端 ​

csharp
public StatusBarSetting()

属性 ​

DefaultOn 双端 ​

csharp
public bool DefaultOn { get; set; }

DefaultStatusBar 双端 ​

csharp
public IGameLink<GameDataStatusBar>? DefaultStatusBar { get; set; }

未匹配到任何关系覆盖时使用的默认状态栏。

OverrideByRelationShip 双端 ​

csharp
public Dictionary<PlayerUnitRelationShip, IGameLink<GameDataStatusBar>?>? OverrideByRelationShip { get; set; }

按玩家与单位的关系覆盖状态栏配置。 MainUnit 优先级高于 Player。

UpdateFlags 双端 ​

命名空间 GameCore.EntitySystem.Data.Struct

csharp
public class UpdateFlags

Defines configuration flags that control how an entity is updated and behaves in the game world.

备注

These flags determine which systems and capabilities are enabled for an entity, affecting performance and functionality. They are typically set based on the entity's data configuration and determine which components and behaviors are active.

构造函数 ​

UpdateFlags 双端 ​

csharp
public UpdateFlags()

属性 ​

Walkable 双端 ​

csharp
public bool Walkable { get; set; }

Gets or sets a value indicating whether the entity can walk or move through the world.

备注

When true, the entity will have walking/movement capabilities enabled and can respond to movement commands.

Turnable 双端 ​

csharp
public bool Turnable { get; set; }

Gets or sets a value indicating whether the entity can turn or rotate.

备注

When true, the entity can change its facing direction in response to commands or game logic.

AllowMover 双端 ​

csharp
public bool AllowMover { get; set; }

Gets or sets a value indicating whether the entity can have mover components attached.

备注

When true, the entity supports advanced movement systems like projectiles, guided movement, or special mover behaviors.

DisableClientUpdate 双端 ​

csharp
public bool DisableClientUpdate { get; set; }

Gets or sets a value indicating whether client-side updates should be disabled for this entity.

备注

When true, the entity will not perform certain update operations on the client side, typically used for performance optimization.

EntityState 双端 ​

命名空间 GameCore.EntitySystem.Enum

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

方法 ​

ToString 双端 ​

csharp
public override string? ToString()

operator == 双端 ​

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

operator != 双端 ​

csharp
public static bool operator !=(EntityState left, EntityState 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 System.Enum InnerValue

IsChangingPosition 双端 ​

csharp
public static readonly EntityState IsChangingPosition

Indicates that the entity is currently in the process of changing its position.

备注

This state is typically set when an entity begins moving and cleared when movement completes. It can be used to trigger position change events and manage movement-related behaviors.

EPropertyEntity 双端 ​

命名空间 GameCore.EntitySystem.Enum

csharp
public enum EPropertyEntity

Defines property types that can be associated with entities for networking and state management.

备注

These properties represent data that can be synchronized between server and client or tracked for entities. This enum is extendable, allowing additional property types to be defined elsewhere.

枚举值 ​

  • Components — Represents component-related properties for the entity.

PropertyEntity 双端 ​

命名空间 GameCore.EntitySystem.Enum

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

方法 ​

ToString 双端 ​

csharp
public override string? ToString()

operator == 双端 ​

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

operator != 双端 ​

csharp
public static bool operator !=(PropertyEntity left, PropertyEntity 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 System.Enum InnerValue

Components 双端 ​

csharp
public static readonly PropertyEntity Components

Represents component-related properties for the entity.

备注

This property type is used to track and synchronize information about the entity's components, such as component state changes or component-specific data.