Skip to content

GameCore.ActorSystem ​

Actor 双端 ​

命名空间 GameCore.ActorSystem

csharp
public abstract class Actor : DisposableObject, IActor, IGameObject<GameDataActor>, IGameObject

Represents the base class for all actors in the game world, providing visual representation and interactive capabilities.

备注

Actors are objects that can be displayed on the client side within the game world, such as effects, models, animations, sounds, and other visual elements. They are managed by actor scopes and can be attached to entities or other actors to create complex visual hierarchies. Actors can be transient (temporary) or persistent based on their configuration and scope.

构造函数 ​

Actor 双端 ​

csharp
public Actor(IGameLink<GameDataActor> link, bool skipBirth, IActorScope? scope, Scene? scene = null, Player? forcePlayer = null, ActorCreationOptions? creationOptions = null)

属性 ​

CreationFilterLevel 仅客户端 ​

csharp
public static int? CreationFilterLevel { get; set; }

Facing 双端 ​

csharp
public Angle Facing { get; }

Position 双端 ​

csharp
public ScenePoint Position { get; set; }

WorldPosition 仅客户端 ​

csharp
public ScenePoint WorldPosition { get; }

Rotation 仅客户端 ​

csharp
public Vector3 Rotation { get; set; }

获取或设置Actor的旋转角度(欧拉角,以度为单位)

备注

重要注意事项: 旋转是相对于父对象的本地坐标系进行的。 旋转顺序:先绕X轴,再绕Y轴,最后绕Z轴(欧拉角顺序)。 若设置附着后的旋转,需要在调用AttachTo之后设置旋转,因为AttachTo会重置旋转值。 正确的操作顺序是:AttachTo → Rotation → SetOffset 旋转不会影响偏移值,但会影响子对象的坐标系。 常用的旋转值: new Vector3(0, 0, 90) - 绕Z轴旋转90度 new Vector3(90, 0, 0) - 绕X轴旋转90度(水平放置) new Vector3(180, 0, 0) - 绕X轴旋转180度(倒置) new Vector3(0, 90, 0) - 绕Y轴旋转90度 示例用法: // 将轮子附着到车身 wheel.AttachTo(carBody); // 设置轮子水平放置 wheel.Rotation = new Vector3(90, 0, 0); // 设置轮子位置 wheel.SetOffset(wheelPosition);

GroundZ 仅客户端 ​

csharp
public float GroundZ { get; set; }

Gets or sets the ground Z-coordinate value. It's really just a calculated Z-coordinate value offset from the ground, there is no 'UseGroundHeight' state internally.

Scale 仅客户端 ​

csharp
public Vector3 Scale { get; set; }

ShouldRemoveWithParent 仅客户端 ​

csharp
public bool ShouldRemoveWithParent { get; set; }

Player 双端 ​

csharp
public Player Player { get; set; }

Gets or sets the player that owns this actor.

备注

If no player is explicitly set, the actor will use the player from its scope context or fall back to the default player.

Scope 双端 ​

csharp
public IActorScope? Scope { get; set; }

Gets or sets the actor scope that manages this actor's lifecycle and context.

备注

The scope provides context information such as position, targets, and other actors within the same logical group. This property is managed internally by the scope system.

Context 双端 ​

csharp
public IActorScopeContext? Context { get; }

Gets the context information from the actor's scope, if available.

备注

The context provides access to targets, position, scale, and other environmental information that affects how the actor behaves and appears.

Parent 双端 ​

csharp
public IActor? Parent { get; set; }

Gets the parent actor in the attachment hierarchy.

备注

The parent relationship determines visual hierarchy and can affect transformations like position, rotation, and scale inheritance. Use the AttachTo method to establish parent-child relationships between actors.

RuntimeIsTransient 双端 ​

csharp
public bool RuntimeIsTransient { get; }

RuntimeTransientDuration 双端 ​

csharp
public TimeSpan? RuntimeTransientDuration { get; }

IsTransient 双端 ​

csharp
public bool IsTransient { get; }

Gets a value indicating whether this actor is transient (temporary).

备注

Transient actors are typically short-lived effects or animations that are not persisted and may be cleaned up more aggressively. Transient actors are often fire and forget, they will kill themselves after they are done playing 'OneShot' animations/effects/sounds. While persistent actors are designed to be long-lived and persistent, they will have to be killed manually. This value is determined by the actor's data configuration and its scope settings.

csharp
public IGameLink<GameDataActor> Link { get; }

Cache 双端 ​

csharp
public GameDataActor Cache { get; }

HasDelayedInitialization 双端 ​

csharp
public virtual bool HasDelayedInitialization { get; }

Some actor will need to wait for 1 tick to Initialize.

方法 ​

GetByViewActorId 仅客户端 ​

csharp
public static Actor? GetByViewActorId(int viewActorId)

Get actor by ViewActor's Id, only work for model and particle actors, and only work if the actor is not transient, and not destroyed or Garbage collected.

  • viewActorId —

返回:

SetOffset 仅客户端 ​

csharp
public void SetOffset(Vector3 vector3)

设置Actor相对于其父对象的偏移量

  • vector3 — 偏移向量,相对于父对象的本地坐标系
备注

重要注意事项: 偏移值会自动受到父对象缩放的影响。如果父对象在某个轴上缩放了2倍, 那么该轴上的偏移值也会被放大2倍。 偏移是相对于附着绑点计算的。 在调用AttachTo之后设置偏移,因为AttachTo可能会重置之前的偏移值。 偏移值通常需要根据父对象的实际尺寸来计算,而不是标准尺寸。 例如:如果父对象是圆柱体,标准高度100,缩放0.5f,实际高度50, 那么要在顶部放置子对象,偏移应该是50而不是100。 示例用法: // 将头部附着到身体上 head.AttachTo(body); // 设置头部在身体顶部,考虑身体的实际高度 head.SetOffset(new Vector3(0, 0, bodyHeight * scale));

Attach 仅客户端 ​

csharp
public bool Attach(IActor child, UTF8String? socket)

AttachTo 仅客户端 ​

csharp
protected internal virtual bool AttachTo(IActor parent, UTF8String socket, bool forwardOnce)

AttachTo 仅客户端 ​

csharp
public bool AttachTo(IActor? parent, UTF8String? socket = null)

Detach 仅客户端 ​

csharp
public virtual bool Detach(bool resetBearings = false)

SetCreationOptions 双端 ​

csharp
protected void SetCreationOptions(ActorCreationOptions? creationOptions)

Kill 双端 ​

csharp
public void Kill()

Destroy 双端 ​

csharp
public void Destroy(bool forceNoFade = false, bool isHostDispose = false)

DisposeManaged 双端 ​

csharp
protected override void DisposeManaged()

DisposeUnmanaged 双端 ​

csharp
protected override void DisposeUnmanaged(bool finalizing)

Only destroy the view actor when not finalizing.

  • finalizing —

DelayedInitialization 双端 ​

csharp
protected virtual void DelayedInitialization()

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.

IsVisibleTo 仅服务端 ​

csharp
public virtual bool IsVisibleTo(Player player)

字段 ​

_actorsByViewActorId 仅客户端 ​

csharp
protected static readonly ValueKeyDictionary<int, WeakReference<Actor>> _actorsByViewActorId

_viewAsyncActor 仅客户端 ​

csharp
protected internal IViewAsyncActorController _viewAsyncActor

_forceNoFade 双端 ​

csharp
protected bool _forceNoFade

ActorAction 双端 ​

命名空间 GameCore.ActorSystem

csharp
public class ActorAction : ActorHostModifier, IActorDualEndPoints, IActor, IGameObject<IGameDataActorDualEndPoints>, IGameObject, IGameObject<GameDataActorAction>

构造函数 ​

ActorAction 双端 ​

csharp
public ActorAction(IGameLink<GameDataActorAction> link, bool skipBirth, IActorScope? scope, Scene? scene = null, Player? forcePlayer = null, ActorCreationOptions? creationOptions = null)

属性 ​

HasDelayedInitialization 双端 ​

csharp
public override bool HasDelayedInitialization { get; }

LaunchSiteContext 仅客户端 ​

csharp
public IActorEndPointContext? LaunchSiteContext { get; set; }
csharp
public new IGameLink<GameDataActorAction> Link { get; }

Cache 双端 ​

csharp
public new GameDataActorAction Cache { get; }

方法 ​

DelayedInitialization 仅客户端 ​

csharp
protected override void DelayedInitialization()

SetImpactSite 仅客户端 ​

csharp
public bool SetImpactSite(AttachContext site)

ActorAdditionModel 双端 ​

命名空间 GameCore.ActorSystem

csharp
public class ActorAdditionModel : Actor, IGameObject<GameDataActorAdditionModel>, IGameObject

构造函数 ​

ActorAdditionModel 双端 ​

csharp
public ActorAdditionModel(IGameLink<GameDataActorAdditionModel> link, bool skipBirth, IActorScope? scope, Scene? scene = null, Player? forcePlayer = null, ActorCreationOptions? creationOptions = null)

属性 ​

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

Cache 双端 ​

csharp
public new GameDataActorAdditionModel Cache { get; }

ActorBeam 双端 ​

命名空间 GameCore.ActorSystem

csharp
public class ActorBeam : Actor, IActorPlayable, IActor, IActorDualEndPoints, IGameObject<IGameDataActorDualEndPoints>, IGameObject, IGameObject<GameDataActorBeam>

Represents a beam effect actor that renders directional visual effects like lasers, lightning, or energy beams.

备注

ActorBeam is specialized for creating linear visual effects that typically extend from one point to another. Common uses include laser beams, lightning bolts, energy rays, magical beams, and other directional effects. It implements IActorPlayable to support playback control and can be configured for automatic playback. The beam actor integrates with the game's visual effects system and supports various timing controls, though speed adjustment may have limitations depending on the beam type. 与 GameGraph 的 ParticleSystem 共享底层光束粒子系统。 通过 GameDataActorBeam.Beam 引用粒子资源,由 Actor 框架管理单位/挂点跟随和生命周期, 每帧更新端点位置,不通过 C# 粒子 Builder 实现。 直接基于 Node 构造光束时,可用 ParticleSystem.CreateRuntime() 和 ParticleEmitterBeamBuilder 配置资源,再通过挂载后的 ParticleEmitter 的 SetSourcePoint / SetEndPoint 更新端点。 Builder 只保存坐标值,不绑定 Node;直接使用 GameGraph 时由调用方管理跟随和清理。

构造函数 ​

ActorBeam 双端 ​

csharp
public ActorBeam(IGameLink<GameDataActorBeam> link, bool skipBirth, IActorScope? scope, Scene? scene = null, Player? forcePlayer = null, ActorCreationOptions? creationOptions = null)

Represents a beam effect actor that renders directional visual effects like lasers, lightning, or energy beams.

备注

ActorBeam is specialized for creating linear visual effects that typically extend from one point to another. Common uses include laser beams, lightning bolts, energy rays, magical beams, and other directional effects. It implements IActorPlayable to support playback control and can be configured for automatic playback. The beam actor integrates with the game's visual effects system and supports various timing controls, though speed adjustment may have limitations depending on the beam type. 与 GameGraph 的 ParticleSystem 共享底层光束粒子系统。 通过 GameDataActorBeam.Beam 引用粒子资源,由 Actor 框架管理单位/挂点跟随和生命周期, 每帧更新端点位置,不通过 C# 粒子 Builder 实现。 直接基于 Node 构造光束时,可用 ParticleSystem.CreateRuntime() 和 ParticleEmitterBeamBuilder 配置资源,再通过挂载后的 ParticleEmitter 的 SetSourcePoint / SetEndPoint 更新端点。 Builder 只保存坐标值,不绑定 Node;直接使用 GameGraph 时由调用方管理跟随和清理。

属性 ​

IsPaused 仅客户端 ​

csharp
public bool IsPaused { get; set; }

HasDelayedInitialization 仅客户端 ​

csharp
public override bool HasDelayedInitialization { get; }

Gets a value indicating whether this beam actor requires delayed initialization.

备注

When auto-play is enabled, the beam effect will be automatically started during the delayed initialization phase, which occurs after the actor has been fully set up and positioned. This ensures the beam appears at the correct location with proper timing.

LaunchSiteContext 仅客户端 ​

csharp
public IActorEndPointContext? LaunchSiteContext { get; set; }
csharp
public new IGameLink<GameDataActorBeam> Link { get; }

Cache 双端 ​

csharp
public new GameDataActorBeam Cache { get; }

方法 ​

Stop 仅客户端 ​

csharp
public bool Stop(bool fade = false)

Play 仅客户端 ​

csharp
public virtual bool Play()

Starts playing the beam effect.

返回: True if the beam effect was successfully started; otherwise, false.

备注

This method initiates the beam effect playback. Once started, the beam will be rendered with its configured visual properties and animations. The method tracks the play state to prevent duplicate playback commands and ensure proper effect management.

SetPlaySpeed 仅客户端 ​

csharp
public virtual bool SetPlaySpeed(float speed)

Sets the playback speed multiplier for the beam effect.

  • speed — The speed multiplier (1.0 = normal speed, 0.5 = half speed, 2.0 = double speed).

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

备注

Setting play speed for beam effects may not be supported or may have limited effect depending on the specific beam implementation and visual system. Some beam effects are designed with fixed timing that cannot be easily modified. This method provides the interface for speed control but actual support varies by beam type.

DelayedInitialization 仅客户端 ​

csharp
protected override void DelayedInitialization()

Performs delayed initialization of the beam actor.

备注

This method is called during the delayed initialization phase and automatically starts the beam effect if auto-play is enabled and the effect hasn't been manually started yet. This provides automatic beam playback for fire-and-forget scenarios.

SetImpactSite 仅客户端 ​

csharp
public bool SetImpactSite(AttachContext site)

ActorCreationOptions 双端 ​

命名空间 GameCore.ActorSystem

csharp
public sealed class ActorCreationOptions : IEquatable<ActorCreationOptions>

构造函数 ​

ActorCreationOptions 双端 ​

csharp
public ActorCreationOptions()

属性 ​

Default 双端 ​

csharp
public static ActorCreationOptions Default { get; }

ForceTransient 双端 ​

csharp
public bool ForceTransient { get; init; }

TransientDuration 双端 ​

csharp
public TimeSpan? TransientDuration { get; init; }

HasTransientEndCondition 双端 ​

csharp
public bool HasTransientEndCondition { get; }

方法 ​

Transient 双端 ​

csharp
public static ActorCreationOptions Transient(TimeSpan? duration = null)

ToString 双端 ​

csharp
public override string ToString()

operator != 双端 ​

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

operator == 双端 ​

csharp
public static bool operator ==(ActorCreationOptions? left, ActorCreationOptions? right)

GetHashCode 双端 ​

csharp
public override int GetHashCode()

Equals 双端 ​

csharp
public override bool Equals(object? obj)

Equals 双端 ​

csharp
public bool Equals(ActorCreationOptions? other)

ActorGrid 双端 ​

命名空间 GameCore.ActorSystem

csharp
public class ActorGrid : Actor, IGameObject<GameDataActorGrid>, IGameObject

Represents a grid actor that can display and manage a 2D grid overlay in the game world. On the client side, provides full grid functionality including visual representation and state management. On the server side, serves as a lightweight type container for message transport and type matching.

备注

The grid can be used for various purposes such as: Building placement guides Area highlighting and selection Tile-based game mechanics Visual debugging overlays

构造函数 ​

ActorGrid 仅客户端 ​

csharp
public ActorGrid(IGameLink<GameDataActorGrid> link, bool skipBirth, IActorScope? scope, Scene? scene = null, Player? forcePlayer = null, ActorCreationOptions? creationOptions = null)

Initializes a new instance of the ActorGrid class.

  • link — The game data link that defines the grid's configuration and appearance.
  • skipBirth — If true, skips the actor's birth process.
  • scope — The scope that manages this actor's lifecycle. Can be null.
  • scene — The scene to which this grid belongs. Can be null.
  • forcePlayer — Forces the grid to be associated with a specific player. Can be null.
  • creationOptions — Runtime creation options for this actor instance.
备注

The grid is initialized with default orthogonal axes and zero bounds. Set the Bounds property to make the grid visible.

ActorGrid 仅服务端 ​

csharp
public ActorGrid(IGameLink<GameDataActor> link, bool skipBirth, IActorScope? scope, Scene? scene = null, Player? forcePlayer = null, ActorCreationOptions? creationOptions = null)

Initializes a new instance of the ActorGrid class for server-side use.

  • link — The game data link for type compatibility. Functionality is limited on server side.
  • skipBirth — If true, skips the actor's birth process.
  • scope — The scope that manages this actor's lifecycle. Can be null.
  • scene — The scene to which this grid belongs. Can be null.
  • forcePlayer — Forces the grid to be associated with a specific player. Can be null.
  • creationOptions — Runtime creation options for this actor instance.
备注

Server-side ActorGrid instances serve as lightweight type containers for message transport and type matching. They do not provide grid functionality or visual representation.

属性 ​

Axis 仅客户端 ​

csharp
public GridAxis Axis { get; set; }

Gets or sets the axis vectors that define the orientation and scale of the grid in 3D space.

备注

Changing this property will update the visual representation of the grid in the game world. If the update fails, an exception will be logged but the operation will not throw.

OffsetX 仅客户端 ​

csharp
public int OffsetX { get; }

Gets the X offset of the grid bounds origin in grid cell units.

备注

This is a read-only property. To change the offset, use the Bounds property. The offset represents the starting position of the grid in the grid coordinate system.

OffsetY 仅客户端 ​

csharp
public int OffsetY { get; }

Gets the Y offset of the grid bounds origin in grid cell units.

备注

This is a read-only property. To change the offset, use the Bounds property. The offset represents the starting position of the grid in the grid coordinate system.

DimensionX 仅客户端 ​

csharp
public int DimensionX { get; }

Gets the size of the grid bounds in X direction in grid cells.

备注

This is a read-only property. To change the dimension, use the Bounds property. The dimension represents the number of grid cells along the X axis.

DimensionY 仅客户端 ​

csharp
public int DimensionY { get; }

Gets the size of the grid bounds in Y direction in grid cells.

备注

This is a read-only property. To change the dimension, use the Bounds property. The dimension represents the number of grid cells along the Y axis.

Bounds 仅客户端 ​

csharp
public GridBounds Bounds { get; set; }

Gets or sets the bounds that define the area covered by the grid in grid cell coordinates.

备注

The bounds determine which portion of the grid space will display the grid overlay. The OffsetX and OffsetY represent the grid's starting position in grid cell coordinates. The DimensionX and DimensionY represent the number of grid cells in each dimension. Setting invalid bounds will result in a logged exception, but the operation will not throw. The grid will only be visible when bounds have positive dimensions.

StickToGround 仅客户端 ​

csharp
public bool StickToGround { get; set; }

Gets or sets a value indicating whether the grid should automatically align itself to the ground surface.

备注

When enabled, the grid will automatically adjust its vertical position to follow the terrain or ground surface. This is useful for building placement grids that need to conform to uneven terrain. If the setting fails to apply, an exception will be logged but the operation will not throw.

GridStates 仅客户端 ​

csharp
public GridState GridStates { get; }

Gets the state manager for all cells in the grid.

备注

Each cell can have different visual states represented by integer values. The available visual representations are defined by StateModels. State changes are immediately reflected in the game's visual representation.

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

Cache 双端 ​

csharp
public new GameDataActorGrid Cache { get; }

ActorHighlight 双端 ​

命名空间 GameCore.ActorSystem

csharp
public class ActorHighlight : ActorHostModifier, IGameObject<GameDataActorHighlight>, IGameObject

Represents an actor that provides highlighting effects for other actors, typically used for selection, targeting, or status indication.

  • link — The game data link defining the configuration for this highlight actor.
  • skipBirth — Whether to skip birth animations or effects.
  • scope — The actor scope that will manage this actor's lifecycle.
  • scene — The scene to create the actor in, if different from the scope's scene.
  • forcePlayer — Optional player to override the default player assignment.
  • creationOptions — Runtime creation options for this actor instance.
备注

ActorHighlight is a specialized actor that attaches to other actors to provide visual highlighting effects. It integrates with the highlight aggregation system to create smooth color transitions and animations. The highlight can be configured with different colors, durations, and animation behaviors such as auto-reverse and repeat patterns. This is commonly used for UI feedback, target selection, and status visualization.

构造函数 ​

ActorHighlight 双端 ​

csharp
public ActorHighlight(IGameLink<GameDataActorHighlight> link, bool skipBirth, IActorScope? scope, Scene? scene = null, Player? forcePlayer = null, ActorCreationOptions? creationOptions = null)

Represents an actor that provides highlighting effects for other actors, typically used for selection, targeting, or status indication.

  • link — The game data link defining the configuration for this highlight actor.
  • skipBirth — Whether to skip birth animations or effects.
  • scope — The actor scope that will manage this actor's lifecycle.
  • scene — The scene to create the actor in, if different from the scope's scene.
  • forcePlayer — Optional player to override the default player assignment.
  • creationOptions — Runtime creation options for this actor instance.
备注

ActorHighlight is a specialized actor that attaches to other actors to provide visual highlighting effects. It integrates with the highlight aggregation system to create smooth color transitions and animations. The highlight can be configured with different colors, durations, and animation behaviors such as auto-reverse and repeat patterns. This is commonly used for UI feedback, target selection, and status visualization.

属性 ​

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

Cache 双端 ​

csharp
public new GameDataActorHighlight Cache { get; }

方法 ​

Detach 仅客户端 ​

csharp
public override bool Detach(bool resetBearings = false)

Detaches this highlight actor from its parent and removes it from the highlight aggregation system.

  • resetBearings — Whether to reset the actor's position and rotation when detaching.

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

备注

When detaching, this method ensures that the highlight effect is properly removed from the parent actor's highlight aggregator to prevent visual artifacts and memory leaks.

DisposeManaged 仅客户端 ​

csharp
protected override void DisposeManaged()

Releases managed resources used by this highlight actor.

备注

This method ensures that the highlight effect is properly removed from the parent actor's highlight aggregator during disposal to prevent memory leaks and visual artifacts.

AttachTo 仅客户端 ​

csharp
protected internal override bool AttachTo(IActor parent, UTF8String socket, bool forwardOnce)

Attaches this highlight actor to a parent actor and initializes the highlighting animation.

  • parent — The parent actor to attach to.
  • socket — The socket name for attachment, if any.
  • forwardOnce — Whether to face forward once when attached.

返回: True if the attachment and highlight initialization was successful; otherwise, false.

备注

This method sets up the highlight animation with the configured colors, duration, and animation properties. It initializes the parent's highlight aggregator if necessary and starts the color transition animation. The highlight will animate from the 'From' color to the 'To' color based on the configuration settings.

ActorHostModifier 双端 ​

命名空间 GameCore.ActorSystem

csharp
public abstract class ActorHostModifier : Actor, IGameObject<GameDataActorHostModifier>, IGameObject

构造函数 ​

ActorHostModifier 双端 ​

csharp
protected ActorHostModifier(IGameLink<GameDataActorHostModifier> link, bool skipBirth, IActorScope? scope, Scene? scene = null, Player? forcePlayer = null, ActorCreationOptions? creationOptions = null)

属性 ​

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

Cache 双端 ​

csharp
public new GameDataActorHostModifier Cache { get; }

ActorMaterial 双端 ​

命名空间 GameCore.ActorSystem

csharp
public class ActorMaterial : ActorHostModifier, IActorPlayable, IActor, IGameObject<GameDataActorMaterial>, IGameObject

构造函数 ​

ActorMaterial 双端 ​

csharp
public ActorMaterial(IGameLink<GameDataActorMaterial> link, bool skipBirth, IActorScope? scope, Scene? scene = null, Player? forcePlayer = null, ActorCreationOptions? creationOptions = null)

属性 ​

HasDelayedInitialization 仅客户端 ​

csharp
public override bool HasDelayedInitialization { get; }

IsPaused 仅客户端 ​

csharp
public bool IsPaused { get; set; }
csharp
public new IGameLink<GameDataActorMaterial> Link { get; }

Cache 双端 ​

csharp
public new GameDataActorMaterial Cache { get; }

方法 ​

DelayedInitialization 仅客户端 ​

csharp
protected override void DelayedInitialization()

Play 仅客户端 ​

csharp
public virtual bool Play()

Stop 仅客户端 ​

csharp
public bool Stop(bool fade = false)

ActorModel 双端 ​

命名空间 GameCore.ActorSystem

csharp
public class ActorModel : Actor, IActorAnimationPlayable, IActor, IGameObject<GameDataActorModel>, IGameObject

Represents a 3D model actor that can be displayed in the game world.

备注

ActorModel is used to render 3D models, meshes, and other geometric objects in the game. It supports highlighting effects and integrates with the actor management system for lifecycle control. The model actor can be either transient (temporary) or persistent based on its configuration and intended usage.

构造函数 ​

ActorModel 双端 ​

csharp
public ActorModel(IGameLink<GameDataActorModel> link, bool skipBirth, IActorScope? scope, Scene? scene = null, Player? forcePlayer = null, ActorCreationOptions? creationOptions = null)

Initializes a new instance of the ActorModel class with the specified configuration.

  • link — The game data link defining the configuration for this model actor.
  • skipBirth — Whether to skip birth animations or effects.
  • scope — The actor scope that will manage this actor's lifecycle.
  • scene — The scene to create the actor in, if different from the scope's scene.
  • forcePlayer — Optional player to override the default player assignment.
  • creationOptions — Runtime creation options for this actor instance.
备注

On the client side, non-transient model actors are registered in a global lookup for efficient retrieval and management. This registration is automatically handled during construction and cleaned up during disposal.

属性 ​

BoneChains 仅客户端 ​

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

HighlightAggregator 仅客户端 ​

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

TintColorAggregators 仅客户端 ​

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

ShowShadow 仅客户端 ​

csharp
public bool ShowShadow { get; set; }

获取或设置是否显示阴影

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

Cache 双端 ​

csharp
public new GameDataActorModel Cache { get; }

方法 ​

DisposeManaged 仅客户端 ​

csharp
protected override void DisposeManaged()

Releases managed resources used by this model actor.

备注

This method cleans up highlight aggregators and removes the actor from global lookup tables if it was registered. It ensures proper resource management and prevents memory leaks when the model actor is destroyed.

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()

ActorParticle 双端 ​

命名空间 GameCore.ActorSystem

csharp
public class ActorParticle : Actor, IActorPlayable, IActor, IGameObject<GameDataActorParticle>, IGameObject

Represents a particle effect actor that can display particle systems and visual effects in the game world.

备注

ActorParticle is designed to render particle effects such as explosions, magic spells, environmental effects, and other visual phenomena. It implements IActorPlayable to support playback control and can be configured for automatic playback. The particle actor integrates with the game's visual effects system and supports various timing and animation controls.

构造函数 ​

ActorParticle 双端 ​

csharp
public ActorParticle(IGameLink<GameDataActorParticle> link, bool skipBirth, IActorScope? scope, Scene? scene = null, Player? forcePlayer = null, ActorCreationOptions? creationOptions = null)

Initializes a new instance of the ActorParticle class with the specified configuration.

  • link — The game data link defining the configuration for this particle actor.
  • skipBirth — Whether to skip birth animations or effects.
  • scope — The actor scope that will manage this actor's lifecycle.
  • scene — The scene to create the actor in, if different from the scope's scene.
  • forcePlayer — Optional player to override the default player assignment.
  • creationOptions — Runtime creation options for this actor instance.
备注

On the client side, non-transient particle actors are registered in a global lookup for efficient retrieval and management. This registration is automatically handled during construction and cleaned up during disposal.

属性 ​

IsPaused 仅客户端 ​

csharp
public bool IsPaused { get; set; }

HasDelayedInitialization 仅客户端 ​

csharp
public override bool HasDelayedInitialization { get; }

Gets a value indicating whether this particle actor requires delayed initialization.

备注

When auto-play is enabled, the particle effect will be automatically started during the delayed initialization phase, which occurs after the actor has been fully set up.

ShowShadow 仅客户端 ​

csharp
public bool ShowShadow { get; set; }

获取或设置是否显示阴影

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

Cache 双端 ​

csharp
public new GameDataActorParticle Cache { get; }

方法 ​

Stop 仅客户端 ​

csharp
public bool Stop(bool fade = false)

Play 仅客户端 ​

csharp
public virtual bool Play()

Starts playing the particle effect.

返回: True if the particle effect was successfully started; otherwise, false.

备注

This method initiates the particle effect playback. Once started, the particle system will begin emitting and animating particles according to its configuration. The method tracks the play state to prevent duplicate playback commands.

SetPlaySpeed 仅客户端 ​

csharp
public virtual bool SetPlaySpeed(float speed)

Sets the playback speed multiplier for the particle effect.

  • speed — The speed multiplier (1.0 = normal speed, 0.5 = half speed, 2.0 = double speed).

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

备注

This method allows dynamic control of particle effect timing, enabling effects like slow motion or fast-forward. A speed of 1.0 represents normal playback, values less than 1.0 slow down the effect, and values greater than 1.0 speed up the effect.

DelayedInitialization 仅客户端 ​

csharp
protected override void DelayedInitialization()

Performs delayed initialization of the particle actor.

备注

This method is called during the delayed initialization phase and automatically starts the particle effect if auto-play is enabled and the effect hasn't been manually started yet.

DisposeManaged 仅客户端 ​

csharp
protected override void DisposeManaged()

Releases managed resources used by this particle actor.

备注

This method cleans up the particle actor and removes it from global lookup tables if it was registered as a non-transient actor. It ensures proper resource management when the particle effect is destroyed.

ActorScope 双端 ​

命名空间 GameCore.ActorSystem

csharp
public abstract class ActorScope : DisposableObject, IActorScope

Represents a scope that manages a group of actors sharing the same context and lifecycle.

  • context — The context information that defines the scope's environment and parameters.
备注

Actor scopes provide a way to group related actors together and manage their collective lifecycle. They maintain context information such as position, targets, visibility, and other shared properties that affect all actors within the scope. Scopes can be transient (temporary) or persistent based on their intended usage patterns.

构造函数 ​

ActorScope 双端 ​

csharp
protected ActorScope(IActorScopeContext context)

Represents a scope that manages a group of actors sharing the same context and lifecycle.

  • context — The context information that defines the scope's environment and parameters.
备注

Actor scopes provide a way to group related actors together and manage their collective lifecycle. They maintain context information such as position, targets, visibility, and other shared properties that affect all actors within the scope. Scopes can be transient (temporary) or persistent based on their intended usage patterns.

属性 ​

Id 双端 ​

csharp
public virtual int Id { get; }

Gets the unique identifier for this actor scope.

备注

By default, this returns the hash code of the scope instance. Derived classes may override this to provide more specific identification logic.

Context 双端 ​

csharp
public IActorScopeContext Context { get; }

Gets the context information that defines this scope's environment and parameters.

备注

The context provides information such as position, targets, player ownership, scale, and other environmental factors that affect actors within this scope.

Host 双端 ​

csharp
public IActorSync? Host { get; }

Gets the host object that owns this actor scope, if any.

备注

The host is typically an entity or other object that serves as the primary owner or anchor point for the actors managed by this scope.

SourceSite 仅客户端 ​

csharp
public abstract IActor? SourceSite { get; set; }

Gets the source site actor for this scope, if any.

备注

The source site represents the primary visual anchor point for actors in this scope. This property must be implemented by derived classes.

EnsuredSourceSite 仅客户端 ​

csharp
public abstract IActor EnsuredSourceSite { get; }

Gets the ensured source site actor, creating it if necessary.

备注

This property guarantees that a source site actor exists, creating one if needed. It provides a reliable anchor point for actor attachments and positioning.

AttachSite 仅客户端 ​

csharp
public abstract IActor? AttachSite { get; }

Gets the attach site actor for this scope, if any.

备注

The attach site represents the preferred attachment point for new actors being added to this scope.

ClientActors 仅客户端 ​

csharp
public virtual HashSet<Actor>? ClientActors { get; }

Gets the collection of client-side actors managed by this scope.

备注

This collection tracks actors that are specifically managed on the client side for rendering and visual effects. Base implementation returns null.

方法 ​

Kill 双端 ​

csharp
public abstract void Kill()

Terminates all actors in this scope and marks the scope for cleanup.

备注

This method should be implemented by derived classes to define how actors are terminated when the scope is being shut down.

IsVisibleTo 仅服务端 ​

csharp
public abstract bool IsVisibleTo(Player player)

Determines whether this scope is visible to the specified player.

  • player — The player to check visibility for.

返回: true if the scope is visible to the player; otherwise, false.

备注

This method must be implemented by derived classes to define visibility rules for server-side actor management and network synchronization.

IsVisibleToTransient 仅服务端 ​

csharp
public abstract bool IsVisibleToTransient(Player player)

Determines whether this scope is visible to the specified player for transient operations.

  • player — The player to check transient visibility for.

返回: true if the scope is visible for transient operations; otherwise, false.

备注

Transient visibility may have different rules than regular visibility, often used for temporary effects or short-lived actors.

Add 仅服务端 ​

csharp
public virtual bool Add(Actor actor)

Adds an actor to this scope.

  • actor — The actor to add to the scope.

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

备注

An actor can only belong to one scope at a time. If the actor is already assigned to another scope, this method will return false.

Remove 仅服务端 ​

csharp
public virtual void Remove(Actor actor)

Removes an actor from this scope.

  • actor — The actor to remove from the scope.
备注

If the actor belongs to this scope, it will be unassigned and no longer managed by this scope. Actors from other scopes are ignored.

ActorScopePersist 双端 ​

命名空间 GameCore.ActorSystem

csharp
public class ActorScopePersist : ActorScope, IActorScopePersist, IActorScope, IActor, ICooldownHost, ICooldownOwner, IPropertyOwner, ISyncIdOwner, IPropertyHost, IPropertyOwner<PropertyActorScopePersist>

构造函数 ​

ActorScopePersist 仅客户端 ​

csharp
public ActorScopePersist(IViewActor viewActor, IActorScopeOwner context, IGameLink<GameDataActorScope> link)

ActorScopePersist 仅服务端 ​

csharp
public ActorScopePersist(IActorScopeContext context, IGameLink<GameDataActorScope>? link = null)

ActorScopePersist 仅服务端 ​

csharp
public ActorScopePersist(IViewActor viewActor, IActorScopeContext context)

属性 ​

AttachSite 仅客户端 ​

csharp
public override IActor? AttachSite { get; }

SourceSite 仅客户端 ​

csharp
public override IActor? SourceSite { get; set; }

EnsuredSourceSite 仅客户端 ​

csharp
public override IActor EnsuredSourceSite { get; }

ClientActors 仅客户端 ​

csharp
public override HashSet<Actor> ClientActors { get; }
csharp
public IGameLink<GameDataActorScope>? Link { get; }

Cache 双端 ​

csharp
public GameDataActorScope? Cache { get; }

Id 双端 ​

csharp
public override int Id { get; }

Scene 双端 ​

csharp
public Scene Scene { get; }

Position 双端 ​

csharp
public ScenePoint Position { get; set; }

IsValid 双端 ​

csharp
public override bool IsValid { get; }

Scope 双端 ​

csharp
public IActorScope? Scope { get; }

Scale 双端 ​

csharp
public float? Scale { get; }

Player 双端 ​

csharp
public Player Player { get; }

SyncId 双端 ​

csharp
public int SyncId { get; }

SyncIdType 双端 ​

csharp
public SyncIdType SyncIdType { get; }

方法 ​

ToString 双端 ​

csharp
public override string? ToString()

IsAncestorOf 双端 ​

csharp
public bool IsAncestorOf(IActorSync? other)

Kill 双端 ​

csharp
public override void Kill()

DisposeManaged 双端 ​

csharp
protected override void DisposeManaged()

DisposeUnmanaged 双端 ​

csharp
protected override void DisposeUnmanaged(bool finalizing)

GetProperty 双端 ​

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

AddProperty 仅服务端 ​

csharp
public void AddProperty(PropertyActorScopePersist property, double value)

SetProperty 仅服务端 ​

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

IsVisibleTo 仅服务端 ​

csharp
public override bool IsVisibleTo(Player player)

IsVisibleToTransient 仅服务端 ​

csharp
public override bool IsVisibleToTransient(Player player)

字段 ​

_clientActors 仅客户端 ​

csharp
protected HashSet<Actor>? _clientActors

ActorScopeTransient 双端 ​

命名空间 GameCore.ActorSystem

csharp
public class ActorScopeTransient : ActorScope

构造函数 ​

ActorScopeTransient 双端 ​

csharp
public ActorScopeTransient(IActorScopeContext context)

属性 ​

StaticSite 仅客户端 ​

csharp
public IActor? StaticSite { get; }

AttachSite 仅客户端 ​

csharp
public override IActor? AttachSite { get; }

SourceSite 仅客户端 ​

csharp
public override IActor? SourceSite { get; set; }

EnsuredSourceSite 仅客户端 ​

csharp
public override IActor EnsuredSourceSite { get; }

方法 ​

Kill 双端 ​

csharp
public override void Kill()

Only work if there is no host

DisposeManaged 双端 ​

csharp
protected override void DisposeManaged()

DisposeUnmanaged 双端 ​

csharp
protected override void DisposeUnmanaged(bool finalizing)

IsVisibleTo 仅服务端 ​

csharp
public override bool IsVisibleTo(Player player)

IsVisibleToTransient 仅服务端 ​

csharp
public override bool IsVisibleToTransient(Player player)

ActorScopeTransientPlayExtensions 双端 ​

命名空间 GameCore.ActorSystem

csharp
public static class ActorScopeTransientPlayExtensions

方法 ​

PlayTransient 仅服务端 ​

csharp
public static bool PlayTransient(this IActorScope scope, IGameLink<GameDataActor> actor, ActorScopeTransientPlayOptions? options = null)

ActorScopeTransientPlayOptions 双端 ​

命名空间 GameCore.ActorSystem

csharp
public sealed class ActorScopeTransientPlayOptions : IEquatable<ActorScopeTransientPlayOptions>

构造函数 ​

ActorScopeTransientPlayOptions 双端 ​

csharp
public ActorScopeTransientPlayOptions()

属性 ​

Duration 双端 ​

csharp
public TimeSpan? Duration { get; init; }

LocalOffset 双端 ​

csharp
public Vector3? LocalOffset { get; init; }

Rotation 双端 ​

csharp
public Vector3? Rotation { get; init; }

Scale 双端 ​

csharp
public Vector3? Scale { get; init; }

ScopeScale 双端 ​

csharp
public float? ScopeScale { get; init; }

Facing 双端 ​

csharp
public Angle? Facing { get; init; }

AutoPlay 双端 ​

csharp
public bool AutoPlay { get; init; }

方法 ​

ToString 双端 ​

csharp
public override string ToString()

operator != 双端 ​

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

operator == 双端 ​

csharp
public static bool operator ==(ActorScopeTransientPlayOptions? left, ActorScopeTransientPlayOptions? right)

GetHashCode 双端 ​

csharp
public override int GetHashCode()

Equals 双端 ​

csharp
public override bool Equals(object? obj)

Equals 双端 ​

csharp
public bool Equals(ActorScopeTransientPlayOptions? other)

ActorSegmented 双端 ​

命名空间 GameCore.ActorSystem

csharp
public abstract class ActorSegmented : Actor, IGameObject<GameDataActorSegmented>, IGameObject

Represents an abstract base class for segmented actors that can display directional effects such as beams, projectiles, or area indicators.

备注

Segmented actors are special visual effects that extend from one point to another, often used for spells, projectiles, beams, or area-of-effect indicators. They consist of multiple segments that can be arranged in a line, with optional launch and impact effects at the endpoints. The actor automatically calculates its orientation and length based on the positions of its start and end points.

构造函数 ​

ActorSegmented 双端 ​

csharp
public ActorSegmented(IGameLink<GameDataActorSegmented> link, bool skipBirth, IActorScope? scope, Scene? scene = null, Player? forcePlayer = null, ActorCreationOptions? creationOptions = null)

Initializes a new instance of the ActorSegmented class on the client side.

  • link — The game data link defining the configuration for this segmented actor.
  • skipBirth — Whether to skip birth animations or effects.
  • scope — The actor scope that will manage this actor's lifecycle.
  • scene — The scene to create the actor in, if different from the scope's scene.
  • forcePlayer — Optional player to override the default player assignment.
  • creationOptions — Runtime creation options for this actor instance.
备注

On the client side, this constructor also initializes debug drawing capabilities if enabled in the segmented actor's configuration flags.

属性 ​

DebugDraw 仅客户端 ​

csharp
public IDebugDraw? DebugDraw { get; set; }

Gets or sets the debug drawing interface for rendering debugging information.

DebugDrawEnabled 仅客户端 ​

csharp
public bool DebugDrawEnabled { get; set; }

Gets or sets a value indicating whether debug drawing is enabled for this segmented actor.

备注

When enabled, additional visual debugging information will be rendered to help with development and troubleshooting of the segmented actor's positioning and orientation.

ForwardEndPoint 仅客户端 ​

csharp
public IActorEndPointContext? ForwardEndPoint { get; set; }

Gets or sets the end point context that defines where the segmented actor should point toward.

备注

This property determines the forward direction and target of the segmented actor. When set, the actor will orient itself to point from its current position toward this end point.

ActualLength 仅客户端 ​

csharp
public float ActualLength { get; set; }

Gets the actual calculated length of the segmented actor.

备注

This property reflects the real length of the segmented actor after UpdateForward() has been called. It may differ from the Length property if the Length is null, in which case it's calculated from positions.

Length 仅客户端 ​

csharp
public float? Length { get; set; }

Gets or sets the desired length of the segmented actor.

备注

When set to a specific value, this overrides the calculated distance between start and end points. When null, the actor will calculate its length based on the actual distance to the ForwardEndPoint.

LaunchActor 仅客户端 ​

csharp
public Actor? LaunchActor { get; set; }

Gets the actor displayed at the launch point (start) of the segmented effect.

备注

This actor is typically used for effects such as muzzle flashes, spell origins, or other visual indicators at the start point of the segmented effect.

ImpactActor 仅客户端 ​

csharp
public Actor? ImpactActor { get; set; }

Gets the actor displayed at the impact point (end) of the segmented effect.

备注

This actor is typically used for effects such as explosions, spell impacts, or other visual indicators at the end point of the segmented effect.

Segments 仅客户端 ​

csharp
protected List<Actor> Segments { get; set; }

Gets the collection of segment actors that make up the body of the segmented effect.

备注

These actors are arranged in sequence to create the visual representation of the segmented effect, such as beam segments, projectile trails, or area indicator sections.

CenterActors 仅客户端 ​

csharp
public IReadOnlyList<Actor> CenterActors { get; }

Gets a read-only view of the center segment actors.

备注

This property provides external access to the segment actors without allowing direct modification of the internal collection.

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

Cache 双端 ​

csharp
public new GameDataActorSegmented Cache { get; }

方法 ​

UpdateForward 仅客户端 ​

csharp
public virtual bool UpdateForward()

Updates the forward direction and length of the segmented actor based on its end point.

返回: True if the forward direction was successfully updated; otherwise, false.

备注

This method calculates the orientation and actual length of the segmented actor by examining the positions of its start point (current position) and end point (ForwardEndPoint). The actor's rotation is updated to face toward the end point, and the actual length is either set to the specified Length property or calculated from the distance between points.

DisposeManaged 仅客户端 ​

csharp
protected override void DisposeManaged()

Releases managed resources used by this segmented actor.

备注

This method cleans up all segment actors, launch and impact actors, debug drawing resources, and cached position data when the segmented actor is being disposed.

字段 ​

forwardAngleCache 仅客户端 ​

csharp
protected Angle? forwardAngleCache

positionCache 仅客户端 ​

csharp
protected ScenePoint? positionCache

forwardPositionCache 仅客户端 ​

csharp
protected ScenePoint? forwardPositionCache

ActorSegmentedRectangle 双端 ​

命名空间 GameCore.ActorSystem

csharp
public class ActorSegmentedRectangle : ActorSegmented, IGameObject<GameDataActorSegmentedRectangle>, IGameObject

构造函数 ​

ActorSegmentedRectangle 双端 ​

csharp
public ActorSegmentedRectangle(IGameLink<GameDataActorSegmentedRectangle> link, bool skipBirth, IActorScope? scope, Scene? scene = null, Player? forcePlayer = null, ActorCreationOptions? creationOptions = null)

属性 ​

Width 仅客户端 ​

csharp
public float Width { get; set; }
csharp
public new IGameLink<GameDataActorSegmentedRectangle> Link { get; }

Cache 双端 ​

csharp
public new GameDataActorSegmentedRectangle Cache { get; }

方法 ​

UpdateForward 仅客户端 ​

csharp
public override bool UpdateForward()

ActorSegmentedSector 双端 ​

命名空间 GameCore.ActorSystem

csharp
public class ActorSegmentedSector : ActorSegmented, IGameObject<GameDataActorSegmentedSector>, IGameObject

构造函数 ​

ActorSegmentedSector 双端 ​

csharp
public ActorSegmentedSector(IGameLink<GameDataActorSegmentedSector> link, bool skipBirth, IActorScope? scope, Scene? scene = null, Player? forcePlayer = null, ActorCreationOptions? creationOptions = null)

属性 ​

CentralAngle 仅客户端 ​

csharp
public Angle? CentralAngle { get; set; }
csharp
public new IGameLink<GameDataActorSegmentedSector> Link { get; }

Cache 双端 ​

csharp
public new GameDataActorSegmentedSector Cache { get; }

方法 ​

UpdateForward 仅客户端 ​

csharp
public override bool UpdateForward()

ActorSite 双端 ​

命名空间 GameCore.ActorSystem

csharp
public class ActorSite : Actor, IGameObject<GameDataActorSite>, IGameObject

构造函数 ​

ActorSite 双端 ​

csharp
public ActorSite(IGameLink<GameDataActor> link, bool skipBirth, IActorScope? scope, Scene? scene = null, Player? forcePlayer = null, ActorCreationOptions? creationOptions = null)

属性 ​

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

Cache 双端 ​

csharp
public new GameDataActorSite Cache { get; }

方法 ​

ToString 双端 ​

csharp
public override string ToString()

ActorSound 双端 ​

命名空间 GameCore.ActorSystem

csharp
public class ActorSound : Actor, IActorPlayable, IActor, IActorTimelineAsset, IGameObject<GameDataActorSound>, IGameObject

构造函数 ​

ActorSound 双端 ​

csharp
public ActorSound(IGameLink<GameDataActorSound> link, bool skipBirth, IActorScope? scope, Scene? scene = null, Player? forcePlayer = null, ActorCreationOptions? creationOptions = null)

属性 ​

SoundAsset 仅客户端 ​

csharp
public UTF8String SoundAsset { get; }

HasDelayedInitialization 仅客户端 ​

csharp
public override bool HasDelayedInitialization { get; }

IsPaused 仅客户端 ​

csharp
public bool IsPaused { get; set; }

IsMuted 仅客户端 ​

csharp
public bool IsMuted { get; set; }
csharp
public new IGameLink<GameDataActorSound> Link { get; }

Cache 双端 ​

csharp
public new GameDataActorSound Cache { get; }

方法 ​

Play 仅客户端 ​

csharp
public virtual bool Play()

SetPlaySpeed 仅客户端 ​

csharp
public virtual bool SetPlaySpeed(float speed)

DelayedInitialization 仅客户端 ​

csharp
protected override void DelayedInitialization()

Stop 仅客户端 ​

csharp
public bool Stop(bool fade = false)

SetSoundVolume 仅客户端 ​

csharp
public bool SetSoundVolume(float volume)

DisposeManaged 仅客户端 ​

csharp
protected override void DisposeManaged()

事件 ​

TimelineEventTriggered 仅客户端 ​

csharp
public event Action<UTF8String, bool>? TimelineEventTriggered

ActorText 双端 ​

命名空间 GameCore.ActorSystem

csharp
public class ActorText : Actor, IGameObject<GameDataActorText>, IGameObject

构造函数 ​

ActorText 双端 ​

csharp
public ActorText(IGameLink<GameDataActorText> link, bool skipBirth, IActorScope? scope, Scene? scene = null, Player? forcePlayer = null, ActorCreationOptions? creationOptions = null)

属性 ​

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

Cache 双端 ​

csharp
public new GameDataActorText Cache { get; }

方法 ​

SetText 仅客户端 ​

csharp
public bool SetText(UTF8String text)

SetText 仅客户端 ​

csharp
public bool SetText(string text)

AttachContext 双端 ​

命名空间 GameCore.ActorSystem

csharp
public class AttachContext : IActorEndPointContext

构造函数 ​

AttachContext 双端 ​

csharp
public AttachContext(IActor parent, UTF8String? socket)

属性 ​

Parent 双端 ​

csharp
public required IActor Parent { get; init; }

Socket 双端 ​

csharp
public UTF8String? Socket { get; }

WorldPosition 仅客户端 ​

csharp
public ScenePoint WorldPosition { get; }

方法 ​

AsLaunchSiteFor 仅客户端 ​

csharp
public bool AsLaunchSiteFor(IActorDualEndPoints actor)

ToString 双端 ​

csharp
public override string ToString()

IActorAnimationPlayable 双端 ​

命名空间 GameCore.ActorSystem

csharp
public interface IActorAnimationPlayable : IActor

表示可以播放动画的Actor接口

属性 ​

ModelData 仅客户端 ​

csharp
public GameDataModel? ModelData { get; }

TimedEventTriggeredActors 仅客户端 ​

csharp
public Dictionary<UTF8String, HashSet<Actor>>? TimedEventTriggeredActors { get; set; }

方法 ​

CreateBoneChain 仅客户端 ​

csharp
BoneChain? CreateBoneChain(IEnumerable<IViewAsyncActor.ModelBoneWeight> modelBoneWeights)

创建骨骼链。骨骼链可以通过脚本单独控制旋转。实现诸如上下半身朝向不一致等效果。 如果中途替换模型素材,骨骼链会自动销毁并需要重新创建。

  • modelBoneWeights — 骨骼链的骨骼权重。在进行旋转时,会根据骨骼权重来计算旋转。

返回: 创建的骨骼链,如果失败则返回null

备注

骨骼权重用于控制骨骼链旋转时各骨骼的影响程度。权重值通常在0到1之间,权重越大,该骨骼受旋转影响越大。

SetUpperBodyRootBone 仅客户端 ​

csharp
bool SetUpperBodyRootBone(UTF8String boneName)

设置上半身的根骨骼,用于定义上下半身动画的分界点。

  • boneName — 作为上半身根骨骼的骨骼名称。该骨骼及其所有子骨骼将被视为上半身。

返回: 设置成功返回true,否则返回false。

备注

当播放 UpperBody 或 LowerBody 动画时, 系统根据此方法设置的根骨骼来区分上下半身: 指定的骨骼及其所有子骨骼被视为上半身 其他骨骼被视为下半身 典型应用场景:角色在移动时(下半身播放行走动画)同时施放技能(上半身播放施法动画)。

PlayAnimationSequence 仅客户端 ​

csharp
AnimationSequence? PlayAnimationSequence(IGameLink<GameDataAnimationSequence> link, float speed = 1f)

播放动画序列,使用游戏数据中的触发事件设置

  • link — 动画序列的游戏数据链接
  • speed — 播放速度,默认为1

返回: 创建的动画序列对象,如果失败则返回null

PlayAnimationSequence 仅客户端 ​

csharp
AnimationSequence? PlayAnimationSequence(IGameLink<GameDataAnimationSequence> link, bool triggerEvents, float speed = 1f)

播放动画序列,指定是否触发事件

  • link — 动画序列的游戏数据链接
  • triggerEvents — 是否触发动画序列中的事件
  • speed — 播放速度,默认为1

返回: 创建的动画序列对象,如果失败则返回null

PlayAnimation 仅客户端 ​

csharp
GameCore.ModelAnimation.Animation? PlayAnimation(GameCore.ResourceType.Animation animationFile, AnimationPlayParam? param = null)

播放动画文件

  • animationFile — 动画文件资源
  • param — 可选的动画播放参数

返回: 创建的动画对象,如果失败则返回null

PlayAnimation 仅客户端 ​

csharp
GameCore.ModelAnimation.Animation? PlayAnimation(IGameLink<GameDataAnimationSimple> link)

播放动画,使用游戏数据链接

  • link — 动画的游戏数据链接

返回: 创建的动画对象,如果失败则返回null

PlayAnimationBracket 仅客户端 ​

csharp
AnimationBracket? PlayAnimationBracket(IGameLink<GameDataAnimationBracket> link)

StopAnimationOfLayer 仅客户端 ​

csharp
bool StopAnimationOfLayer(AnimationLogicLayer logicLayer)

SetBirthStandDeathAnimation 仅客户端 ​

csharp
bool SetBirthStandDeathAnimation(UTF8String birth, UTF8String stand, UTF8String death)

SetAnimationMapping 仅客户端 ​

csharp
bool SetAnimationMapping(UTF8String alias, UTF8String animationRaw)

ClearAnimationMapping 仅客户端 ​

csharp
bool ClearAnimationMapping(UTF8String alias)

GetAnimationInstances 仅客户端 ​

csharp
IEnumerable<GameCore.ModelAnimation.Animation> GetAnimationInstances()

OnTimedEventTriggered 仅客户端 ​

csharp
void OnTimedEventTriggered(UTF8String msg, IViewAnimation animation, bool isStart)

GetSocketPosition 仅客户端 ​

csharp
ScenePoint GetSocketPosition(UTF8String socketName)

获取模型挂接点(Socket)的世界坐标位置

  • socketName — 挂接点名称(如 "socket_weapon_r" 表示右手武器挂接点,"socket_root" 表示根挂接点)

返回: 挂接点的世界坐标

备注

Socket(挂接点)是3D模型骨骼上预定义的特殊位置点,用于精确附加子对象到模型的特定部位。 挂接点通常在建模软件中定义,并跟随骨骼动画实时更新位置和旋转。 常见的挂接点用途: 武器挂载:将武器模型附加到角色的手部(如 socket_weapon_r, socket_weapon_l) 特效绑定:在特定部位播放粒子特效(如脚底、手掌、头顶) 子Actor附加:将其他Actor附加到模型的特定位置 位置追踪:获取模型特定部位的实时位置用于游戏逻辑

IActorAnimationPlayableExtensions 仅客户端 ​

命名空间 GameCore.ActorSystem

csharp
public static class IActorAnimationPlayableExtensions

IActorAnimationPlayable接口的扩展方法

方法 ​

PlayAnimationSequence 仅客户端 ​

csharp
public static AnimationSequence? PlayAnimationSequence(this IActorAnimationPlayable actor, IGameLink<GameDataAnimationSequence> link)

播放动画序列,使用游戏数据中的触发事件设置

  • actor — 可播放动画的Actor
  • link — 动画序列的游戏数据链接

返回: 创建的动画序列对象,如果失败则返回null

PlayAnimationSequence 仅客户端 ​

csharp
public static AnimationSequence? PlayAnimationSequence(this IActorAnimationPlayable actor, IGameLink<GameDataAnimationSequence> link, bool triggerEvents)

播放动画序列,指定是否触发事件

  • actor — 可播放动画的Actor
  • link — 动画序列的游戏数据链接
  • triggerEvents — 是否触发动画序列中的事件

返回: 创建的动画序列对象,如果失败则返回null

PlayAnimation 仅客户端 ​

csharp
public static GameCore.ModelAnimation.Animation? PlayAnimation(this IActorAnimationPlayable actor, GameCore.ResourceType.Animation animationFile, AnimationPlayParam? param = null)

播放动画文件

  • actor — 可播放动画的Actor
  • animationFile — 动画文件资源
  • param — 可选的动画播放参数

返回: 创建的动画对象,如果失败则返回null

PlayAnimation 仅客户端 ​

csharp
public static GameCore.ModelAnimation.Animation? PlayAnimation(this IActorAnimationPlayable actor, IGameLink<GameDataAnimationSimple> link)

播放动画,使用游戏数据链接

  • actor — 可播放动画的Actor
  • link — 动画的游戏数据链接

返回: 创建的动画对象,如果失败则返回null

StopAnimationOfLayer 仅客户端 ​

csharp
public static bool StopAnimationOfLayer(this IActorAnimationPlayable actor, AnimationLogicLayer logicLayer)

SetBirthStandDeathAnimation 仅客户端 ​

csharp
public static bool SetBirthStandDeathAnimation(this IActorAnimationPlayable actor, UTF8String birth, UTF8String stand, UTF8String death)

SetAnimationMapping 仅客户端 ​

csharp
public static bool SetAnimationMapping(this IActorAnimationPlayable actor, UTF8String alias, UTF8String animationRaw)

ClearAnimationMapping 仅客户端 ​

csharp
public static bool ClearAnimationMapping(this IActorAnimationPlayable actor, UTF8String alias)

GetAnimationInstances 仅客户端 ​

csharp
public static IEnumerable<GameCore.ModelAnimation.Animation> GetAnimationInstances(this IActorAnimationPlayable actor)

GetSocketPosition 仅客户端 ​

csharp
public static ScenePoint GetSocketPosition(this IActorAnimationPlayable actor, UTF8String socketName)

获取模型挂接点(Socket)的世界坐标位置

  • actor — 可播放动画的Actor
  • socketName — 挂接点名称(如 "socket_weapon_r" 表示右手武器挂接点,"socket_root" 表示根挂接点)

返回: 挂接点的世界坐标

备注

Socket(挂接点)是3D模型骨骼上预定义的特殊位置点,用于精确附加子对象到模型的特定部位。 挂接点通常在建模软件中定义,并跟随骨骼动画实时更新位置和旋转。 常见的挂接点用途: 武器挂载:将武器模型附加到角色的手部(如 socket_weapon_r, socket_weapon_l) 特效绑定:在特定部位播放粒子特效(如脚底、手掌、头顶) 子Actor附加:将其他Actor附加到模型的特定位置 位置追踪:获取模型特定部位的实时位置用于游戏逻辑

IActorColorizable 双端 ​

命名空间 GameCore.ActorSystem

csharp
public interface IActorColorizable

Defines the interface for actors that support color-based visual effects.

备注

IActorColorizable provides a standardized way to apply color effects to game actors, including temporary highlights and persistent tint colors. This supports selection indicators, status effects, damage indicators, spell effects, team colors, material adjustments, and other visual feedback mechanisms. The interface supports both static colors and animated color transitions, with the ability to layer multiple effects using weighted aggregation. All color effects use HDR (High Dynamic Range) colors for enhanced visual fidelity.

属性 ​

HighlightAggregator 双端 ​

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

Gets the arithmetic aggregator used to combine multiple highlight effects.

备注

The highlight aggregator combines multiple highlight effects using arithmetic blending operations. This allows for complex visual effects where multiple systems can contribute to the final highlight appearance simultaneously, such as selection + damage + spell effect highlights.

TintColorAggregators 双端 ​

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

Gets the arithmetic aggregators used to combine multiple tint color effects for different tint types.

备注

The tint color system supports multiple tint types, allowing different blending modes for various visual effects. Each tint type has its own arithmetic aggregator that combines multiple tint effects using arithmetic blending operations. Factor type provides multiplicative blending while Override type provides alpha-composited blending. This design allows for separate management of different visual effect categories.

方法 ​

AnimateHighlight 双端 ​

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

Creates an animated highlight transition between two specific colors.

  • from — The starting color of the highlight animation.
  • to — The ending color of the highlight animation.
  • blendTime — The duration of the color transition.
  • autoReverse — Whether to automatically reverse the animation back to the starting color.
  • repeatBehavior — The repeat behavior for the animation (e.g., loop count, infinite).
  • key — Optional identifier for this highlight effect, used for later removal or modification.
  • weight — The blending weight of this highlight relative to others (default: 1.0).

返回: The created animation object for controlling the highlight transition.

备注

This method creates a smooth color transition animation for visual effects like pulsing damage indicators, charging spell effects, or selection feedback. The animation can be configured to loop, reverse, or play once. Multiple animations can run simultaneously with different weights affecting the final appearance.

AnimateHighlight 双端 ​

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

Creates an animated highlight transition from the current color to a target color.

  • color — The target color for the highlight animation.
  • blendTime — The duration of the color transition.
  • autoReverse — Whether to automatically reverse the animation back to the starting color.
  • repeatBehavior — The repeat behavior for the animation (e.g., loop count, infinite).
  • key — Optional identifier for this highlight effect, used for later removal or modification.
  • weight — The blending weight of this highlight relative to others (default: 1.0).

返回: The created animation object for controlling the highlight transition.

备注

This is a convenience method that animates from the current highlight state to the specified color. It's particularly useful for creating highlight effects that build upon existing highlights rather than replacing them entirely.

ClearAllHighlights 双端 ​

csharp
void ClearAllHighlights()

Removes all highlight effects from this actor.

备注

This method clears all active highlight effects, including both static highlights and running animations. It effectively resets the actor to its default appearance. Use this when you need to completely clear all visual highlighting effects.

ClearHighlight 双端 ​

csharp
void ClearHighlight(object? key)

Removes a specific highlight effect identified by its key.

  • key — The identifier of the highlight effect to remove.
备注

This method removes only the highlight effect associated with the specified key, leaving other highlight effects intact. This allows for selective removal of specific effects while maintaining others, such as removing a damage indicator while keeping a selection highlight active.

InitializeHighlightAggregator 双端 ​

csharp
void InitializeHighlightAggregator()

Initializes the highlight aggregator system for this actor.

备注

This method must be called before using any highlight functionality. It sets up the internal systems needed to manage and blend multiple highlight effects. After calling this method, the HighlightAggregator property will be non-null and ready for use.

SetHighlight 双端 ​

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

Sets a static highlight color for this actor.

  • color — The highlight color to apply.
  • key — Optional identifier for this highlight effect.
  • weight — The blending weight of this highlight relative to others (default: 1.0).
备注

This method applies a static (non-animated) highlight color to the actor. Unlike animated highlights, static highlights remain constant until explicitly changed or removed. Multiple static highlights can be applied simultaneously and will be blended together based on their weights.

AnimateTintColor 双端 ​

csharp
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)

Creates an animated tint color transition from the current color to a target color using the specified tint type.

  • color — The target color for the tint animation.
  • tintColorType — The tint blending mode to use (default: Factor for multiplicative blending).
  • blendTime — The duration of the color transition.
  • autoReverse — Whether to automatically reverse the animation back to the starting color.
  • repeatBehavior — The repeat behavior for the animation (e.g., loop count, infinite).
  • key — Optional identifier for this tint effect, used for later removal or modification.
  • weight — The blending weight of this tint relative to others (default: 1.0).

返回: The created animation object for controlling the tint transition.

备注

This convenience method animates from the current tint state to the specified color using the specified blending mode. It's useful for creating smooth transitions when changing team colors, status indicators, or other persistent color effects. Different tint types provide various visual blending behaviors.

AnimateTintColor 双端 ​

csharp
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)

Creates an animated tint color transition between two specific colors using the specified tint type.

  • from — The starting color of the tint animation.
  • to — The ending color of the tint animation.
  • tintColorType — The tint blending mode to use (default: Factor for multiplicative blending).
  • blendTime — The duration of the color transition.
  • autoReverse — Whether to automatically reverse the animation back to the starting color.
  • repeatBehavior — The repeat behavior for the animation (e.g., loop count, infinite).
  • key — Optional identifier for this tint effect, used for later removal or modification.
  • weight — The blending weight of this tint relative to others (default: 1.0).

返回: The created animation object for controlling the tint transition.

备注

This method creates a smooth color transition animation between two specific colors using the specified blending mode. It's useful for creating complex visual effects like pulsing damage indicators, charging spell effects, or selection feedback with precise color control.

ClearTintColor 双端 ​

csharp
void ClearTintColor()

Completely disables all tint color effects for all tint types on this actor.

备注

This method clears all active tint color effects across all tint types, including both static tints and running animations. It completely resets the actor's tint colors to their default state. Use this when you need to completely clear all persistent color modifications across the entire model.

ResetTintColorByType 双端 ​

csharp
void ResetTintColorByType(TintColorType tintColorType = TintColorType.Factor)

Resets tint color effects for a specific tint type to their default state.

  • tintColorType — The tint type to reset (default: Factor).
备注

This method removes all tint color effects for the specified tint type, including both static tints and running animations, while leaving other tint types intact. This allows for selective reset of specific blending modes while maintaining other color effects on the model.

ClearTintColorByKey 双端 ​

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

Removes a specific tint color effect identified by its key from a specific tint type.

  • key — The identifier of the tint color effect to remove.
  • tintColorType — The tint type to modify (default: Factor).
备注

This method removes only the tint color effect associated with the specified key from the specified tint type, leaving other tint effects intact. This allows for selective removal of specific color modifications while maintaining others, such as removing a health status tint while keeping team color active.

InitializeTintColorAggregators 双端 ​

csharp
void InitializeTintColorAggregators()

Initializes the tint color aggregator system for this actor.

备注

This method must be called before using any tint color functionality. It sets up the internal systems needed to manage and blend multiple tint color effects across different tint types. After calling this method, the TintColorAggregators property will be non-null and ready for use.

SetTintColor 双端 ​

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

Sets a static tint color for this actor using the specified tint type.

  • color — The tint color to apply.
  • tintColorType — The tint blending mode to use (default: Factor for multiplicative blending).
  • key — Optional identifier for this tint effect.
  • weight — The blending weight of this tint relative to others (default: 1.0).
备注

This method applies a static (non-animated) tint color using the specified blending mode. Tint colors are persistent modifications that remain active until explicitly changed or removed. Multiple tint colors can be applied simultaneously and will be blended together based on their weights. Different tint types provide various visual blending behaviors. Common uses include team colors, health status indicators, and material property adjustments.

InitializeColorAggregators 双端 ​

csharp
void InitializeColorAggregators()

Initializes both highlight and tint color aggregator systems for this actor.

备注

This convenience method initializes both color effect systems in one call. It's equivalent to calling both InitializeHighlightAggregator() and InitializeTintColorAggregators(). After calling this method, both aggregator properties will be non-null and ready for use.

ClearAllColorEffects 双端 ​

csharp
void ClearAllColorEffects()

Removes all color effects from this actor, including both highlights and tint colors.

备注

This method clears all active color effects, resetting the actor to its default appearance. It's equivalent to calling both ClearAllHighlights() and ClearTintColor(). Use this for complete visual reset or when changing contexts that require clean state.

IActorDualEndPoints 双端 ​

命名空间 GameCore.ActorSystem

csharp
public interface IActorDualEndPoints : IActor, IGameObject<IGameDataActorDualEndPoints>, IGameObject

属性 ​

LaunchSiteContext 仅客户端 ​

csharp
public IActorEndPointContext? LaunchSiteContext { get; set; }

方法 ​

SetLaunchSite 仅客户端 ​

csharp
bool SetLaunchSite(IActorEndPointContext site)

IActorEndPointContext 双端 ​

命名空间 GameCore.ActorSystem

csharp
public interface IActorEndPointContext

属性 ​

WorldPosition 仅客户端 ​

csharp
public ScenePoint WorldPosition { get; }

方法 ​

AsLaunchSiteFor 仅客户端 ​

csharp
bool AsLaunchSiteFor(IActorDualEndPoints actor)

IActorPlayable 双端 ​

命名空间 GameCore.ActorSystem

csharp
public interface IActorPlayable : IActor

Defines an interface for actors that can be played, controlled, or have their playback speed adjusted.

备注

This interface extends basic actor functionality to support playback control, typically used for animations, effects, or other time-based actors that can be started, stopped, or have their timing modified. It's commonly implemented by actors that contain animations or sequences.

属性 ​

IsPaused 仅客户端 ​

csharp
public bool IsPaused { get; set; }

方法 ​

Play 仅客户端 ​

csharp
bool Play()

Starts playing the actor's animation, effect, or sequence.

返回: true if playback was successfully started; otherwise, false.

备注

This method initiates the actor's playback functionality, such as starting animations, sound effects, or other time-based sequences. The return value indicates whether the play operation was successful.

Stop 仅客户端 ​

csharp
bool Stop(bool fade = false)

IActorScope 双端 ​

命名空间 GameCore.ActorSystem

csharp
public interface IActorScope

定义 Actor 作用域接口,管理一组相关 Actor 的生命周期和行为

备注

Actor 作用域是一个容器,用于管理一组逻辑上相关的 Actor 对象。它提供了统一的 生命周期管理、可见性控制、动作执行等功能。作用域可以是瞬态的或持久的,并支持 在客户端和服务端之间的同步。

属性 ​

Id 双端 ​

csharp
public int Id { get; }

获取作用域的唯一标识符

Context 双端 ​

csharp
public IActorScopeContext Context { get; }

获取作用域的上下文信息

备注

上下文包含作用域的配置、父级信息、以及其他运行时状态。

MainActor 双端 ​

csharp
public IActorSync? MainActor { get; }

获取作用域的主要 Actor(如果存在)

备注

主要 Actor 通常是作用域的核心对象,其他 Actor 可能围绕它进行操作。 对于作用域拥有者,返回其自身作用域的同步 Actor。

Host 双端 ​

csharp
public IActorSync? Host { get; }

获取作用域的宿主 Actor

备注

宿主 Actor 是承载此作用域的父级 Actor,通常用于确定作用域的位置和变换。

IsTransient 双端 ​

csharp
public bool IsTransient { get; }

获取一个值,指示作用域是否为瞬态

备注

瞬态作用域通常用于临时效果,生命周期较短,而非瞬态作用域则用于持久对象。

ImpactActors 双端 ​

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

获取撞击时要创建的 Actor 数据链接列表

备注

当执行撞击操作时,这些 Actor 将被创建并添加到作用域中,通常用于视觉效果或音效。

AttachSite 仅客户端 ​

csharp
public IActor? AttachSite { get; }

获取附加点 Actor

备注

通常与主要 Actor 相同,用作其他 Actor 的附加目标。

SourceSite 仅客户端 ​

csharp
public IActor? SourceSite { get; }

获取源 Actor 的附加点,延迟创建

备注

源 Actor 附加点用于标识作用域的源头位置,只在需要时创建。

EnsuredSourceSite 仅客户端 ​

csharp
public IActor EnsuredSourceSite { get; }

获取确保有效的源 Actor 附加点

备注

与 SourceSite 不同,此属性保证返回有效的 Actor 实例,如果不存在则会创建。

ClientActors 仅客户端 ​

csharp
public HashSet<Actor>? ClientActors { get; }

获取客户端 Actor 集合

备注

包含当前作用域中所有客户端 Actor 的集合,用于管理和遍历。

方法 ​

Kill 双端 ​

csharp
void Kill()

终止作用域,播放死亡动画并执行清理

备注

与 Destroy 不同,此方法会播放适当的死亡动画和效果。

Destroy 双端 ​

csharp
void Destroy()

销毁作用域和其中的所有 Actor,不播放死亡动画

GetById 仅客户端 ​

csharp
static IActorScope? GetById(int id)

根据 ID 获取作用域实例

  • id — 作用域的唯一标识符

返回: 对应的作用域实例,如果未找到则返回 null

Add 仅客户端 ​

csharp
bool Add(Actor actor)

向作用域添加 Actor

  • actor — 要添加的 Actor

返回: 如果成功添加则返回 true;否则返回 false

备注

添加 Actor 时会处理附加、缩放、作用域分配等操作,并触发相应的事件回调。

Remove 仅客户端 ​

csharp
bool Remove(Actor actor)

从作用域移除 Actor

  • actor — 要移除的 Actor

返回: 如果成功移除则返回 true;否则返回 false

HandleAction 仅客户端 ​

csharp
void HandleAction(ScopeAction action)

处理作用域操作

  • action — 要处理的操作类型
备注

根据不同的操作类型执行相应的逻辑,如创建撞击效果 Actor 等。

IsVisibleTo 仅服务端 ​

csharp
bool IsVisibleTo(Player player)

检查作用域是否对指定玩家可见

  • player — 要检查的玩家

返回: 如果对玩家可见则返回 true;否则返回 false

IsVisibleToTransient 仅服务端 ​

csharp
bool IsVisibleToTransient(Player player)

检查瞬态作用域是否对指定玩家可见

  • player — 要检查的玩家

返回: 如果瞬态作用域对玩家可见则返回 true;否则返回 false

SendAction 仅服务端 ​

csharp
void SendAction(ScopeAction action)

向作用域发送指定的操作命令

  • action — 要执行的作用域操作
备注

此方法会将操作广播给所有可见的客户端,触发相应的视觉或行为效果。

PlayTransient 仅服务端 ​

csharp
bool PlayTransient(IGameLink<GameDataActor> actor, ActorScopeTransientPlayOptions? options = null)

IActorScopeContext 双端 ​

命名空间 GameCore.ActorSystem

csharp
public interface IActorScopeContext

定义 Actor 作用域上下文接口,提供作用域运行所需的环境信息和配置

备注

作用域上下文包含了作用域运行所需的所有环境信息,包括目标、来源、配置数据、 位置信息、缩放参数等。它为作用域的创建和管理提供了统一的数据访问接口。

属性 ​

IsValid 双端 ​

csharp
public bool IsValid { get; }

获取一个值,指示此上下文是否有效

备注

当目标和来源都不为 null 时,上下文被认为是有效的。 此属性使用 MemberNotNullWhen 特性来提供编译时的空值检查保证。

IsTransient 双端 ​

csharp
public bool IsTransient { get; }

获取一个值,指示此上下文是否为瞬态

备注

瞬态上下文通常用于临时效果和短期存在的作用域。 默认返回 false,派生类可以重写此属性以提供不同的行为。

Target 双端 ​

csharp
public ITarget? Target { get; }

获取作用域的目标对象

备注

目标对象是作用域操作的主要对象,通常决定了作用域的位置和行为。

Source 双端 ​

csharp
public ITarget? Source { get; }

获取作用域的来源对象

备注

默认情况下,来源对象与目标对象相同。派生类可以重写此属性以提供不同的来源。

csharp
public IGameLink<IGameDataActorScopeOwner>? Link { get; }

获取作用域拥有者的数据链接

备注

此链接指向定义作用域行为和配置的数据对象。

csharp
public IGameLink<IGameDataActorScopeOverride>? OverrideLink { get; }

获取作用域覆盖配置的数据链接

备注

覆盖链接可以提供特殊的配置来修改作用域的默认行为。 默认返回 null,表示没有覆盖配置。

Cache 双端 ​

csharp
public IGameDataActorScopeOwner? Cache { get; }

获取缓存的作用域拥有者数据

备注

从数据链接中获取的实际配置数据,用于作用域的行为定义。

Player 双端 ​

csharp
public Player Player { get; }

获取拥有此作用域的玩家

备注

用于确定作用域的所有权和权限管理。

Scale 双端 ​

csharp
public float? Scale { get; }

获取作用域的缩放因子

备注

用于调整作用域中 Actor 的整体大小。如果为 null,则使用默认缩放。

Volume 双端 ​

csharp
public Vector3? Volume { get; }

获取作用域的体积参数

备注

用于 3D 缩放计算,定义作用域在三个维度上的大小。

Radius 双端 ​

csharp
public float? Radius { get; }

获取作用域的半径参数

备注

用于径向缩放计算。默认返回 null,派生类可以重写以提供半径信息。

Position 双端 ​

csharp
public ScenePoint Position { get; }

获取作用域在场景中的位置

备注

基于目标对象的位置确定作用域的空间坐标。如果上下文无效,会抛出异常。

Host 双端 ​

csharp
public IActorSync? Host { get; }

获取作用域的宿主 Actor

备注

宿主 Actor 用于作用域的附加和位置同步。通常是目标对象的同步 Actor 接口。

Facing 双端 ​

csharp
public Angle? Facing { get; }

获取作用域的朝向角度

备注

定义作用域在空间中的旋转方向,影响其中 Actor 的排列和朝向。

ImpactActors 双端 ​

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

获取撞击时要创建的 Actor 列表

备注

优先使用覆盖配置中的撞击 Actor,如果没有覆盖则使用缓存配置中的撞击 Actor。 这些 Actor 会在执行撞击操作时被创建和管理。

IActorScopeOwner 双端 ​

命名空间 GameCore.ActorSystem

csharp
public interface IActorScopeOwner : IActorScopeContext

定义 Actor 作用域拥有者接口,管理和创建作用域实例

备注

作用域拥有者负责管理其关联的 Actor 作用域的生命周期,包括创建、初始化和维护作用域。 它决定何时需要创建作用域,以及创建何种类型的作用域(瞬态或持久)。

属性 ​

SelfScope 双端 ​

csharp
public IActorScope? SelfScope { get; }

获取自身作为作用域的实例

备注

当对象本身就是一个作用域时,返回自身的作用域接口;否则返回 null。

csharp
public IGameLink<GameDataActorScope>? StandaloneScopeLink { get; }

当对象本身不是作用域时,获取其独立的作用域链接

ActorScope 双端 ​

csharp
public IActorScope? ActorScope { get; set; }

获取或设置关联的 Actor 作用域

备注

存储由此拥有者创建和管理的作用域实例。内部设置器允许系统管理作用域的分配。

ShouldCreateScope 仅服务端 ​

csharp
public bool ShouldCreateScope { get; }

获取一个值,指示是否应该创建作用域

备注

当存在需要管理的 Actor 数组或撞击 Actor 时返回 true,表示需要创建作用域来管理这些对象。

方法 ​

CreateDefaultChildren 仅客户端 ​

csharp
void CreateDefaultChildren()

InitializeActorScope 仅服务端 ​

csharp
IActorScope? InitializeActorScope()

初始化 Actor 作用域,如果尚未存在则创建新的作用域

返回: 初始化后的作用域实例,如果初始化失败则返回 null

备注

此方法检查是否已存在作用域,如果不存在且需要创建,则会创建新的作用域实例。 它优先返回自身作用域,然后根据需要创建新的作用域。

CreateActorScope 仅服务端 ​

csharp
IActorScope? CreateActorScope()

创建新的 Actor 作用域实例

返回: 新创建的作用域实例

备注

根据作用域的类型(瞬态或持久)创建相应的作用域实例。 瞬态作用域用于临时的一次性效果,持久作用域用于长期存在的对象。

IActorScopePersist 双端 ​

命名空间 GameCore.ActorSystem

csharp
public interface IActorScopePersist : IActorScope

Marks an IActorScope that can host server-declared persistent actor slots.

备注

IActorScope also covers transient scopes and other short-lived actor contexts. Persistent actor slots are backed by replicated GameGraph nodes, so callers should depend on this narrower interface when they need durable server-authoritative visual declarations.

IActorScopeTransientPlayContext 双端 ​

命名空间 GameCore.ActorSystem

csharp
public interface IActorScopeTransientPlayContext

属性 ​

TransientActor 双端 ​

csharp
public IGameLink<GameDataActor>? TransientActor { get; }

TransientDuration 双端 ​

csharp
public TimeSpan? TransientDuration { get; }

TransientLocalOffset 双端 ​

csharp
public Vector3? TransientLocalOffset { get; }

TransientRotation 双端 ​

csharp
public Vector3? TransientRotation { get; }

TransientScale 双端 ​

csharp
public Vector3? TransientScale { get; }

TransientAutoPlay 双端 ​

csharp
public bool TransientAutoPlay { get; }

IActorTimelineAsset 双端 ​

命名空间 GameCore.ActorSystem

csharp
public interface IActorTimelineAsset : IActorPlayable, IActor

Stands for actors that have timeline lifespan, and can trigger timed events, such as sounds.

方法 ​

SetPlaySpeed 仅客户端 ​

csharp
bool SetPlaySpeed(float speed)

Sets the playback speed multiplier for the actor's animation or sequence.

  • speed — The speed multiplier (1.0 = normal speed, 0.5 = half speed, 2.0 = double speed).

返回: true if the speed was successfully set; otherwise, false.

备注

This method allows dynamic control of playback timing, enabling effects like slow motion or fast-forward. A speed of 1.0 represents normal playback, values less than 1.0 slow down playback, and values greater than 1.0 speed up playback.

OnTimedEventTriggered 仅客户端 ​

csharp
protected internal void OnTimedEventTriggered(UTF8String msg, bool isStart)

事件 ​

TimelineEventTriggered 仅客户端 ​

csharp
event Action<UTF8String, bool>? TimelineEventTriggered

Occurs when a timed event is triggered, providing the event name and a boolean indicating whether the event was just started or completed. true indicates start, false indicates completion.

备注

This event is raised whenever a specific timed action is completed. Subscribers can use the provided parameters to handle the event appropriately.

IActorVisual 双端 ​

命名空间 GameCore.ActorSystem

csharp
public interface IActorVisual : IActor

属性 ​

Scale 双端 ​

csharp
public Vector3 Scale { get; set; }

Rotation 双端 ​

csharp
public Vector3 Rotation { get; set; }

ShowShadow 双端 ​

csharp
public bool ShowShadow { get; set; }

方法 ​

SetOffset 双端 ​

csharp
void SetOffset(Vector3 offset)

GameDataActor 双端 ​

命名空间 GameCore.ActorSystem.Data

csharp
public abstract class GameDataActor : GameDataCategory<GameDataActor>, IGameDataNativeCacheRefreshable, IGameDataCategory<GameDataActor>, IGameData<GameDataActor>, IGameData

Represents the base data class for actor configurations, defining common properties and behaviors for all actor types. GameData normally generated from the Data Editor, but can also be created programmatically.

备注

This abstract class provides the foundation for all actor data types in the game, including visual elements, effects, models, and other interactive objects. It defines properties for positioning, scaling, attachment, and other common actor characteristics that are used by the actor system to create and manage actors.

构造函数 ​

GameDataActor 双端 ​

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

GameDataActor 双端 ​

csharp
public GameDataActor(IGameLink<GameDataActor> link)

属性 ​

IsTransient 双端 ​

csharp
public virtual bool IsTransient { get; }

Gets a value indicating whether actors created from this data are transient (temporary).

备注

Transient actors are typically short-lived effects or animations that don't persist and may be cleaned up more aggressively by the system.

Socket 双端 ​

csharp
public UTF8String? Socket { get; set; }

Gets or sets the socket name for attachment points on the parent actor.

备注

When specified, the actor will attach to a named socket on its parent actor, allowing for precise positioning relative to specific attachment points.

Rotation 双端 ​

csharp
public Vector3? Rotation { get; set; }

Gets or sets the rotation offset applied to the actor.

备注

This rotation is applied in addition to any inherited rotation from parent actors, unless InheritRotation is set to false.

InheritRotation 双端 ​

csharp
public bool InheritRotation { get; set; }

Gets or sets a value indicating whether the actor should inherit rotation from its parent.

备注

When true (default), the actor will apply its parent's rotation in addition to its own. When false, only the actor's local rotation is used.

Offset 双端 ​

csharp
public Vector3? Offset { get; set; }

Gets or sets the position offset applied to the actor relative to its attachment point.

备注

This offset is applied after any parent transformations and socket positioning.

InheritScale 双端 ​

csharp
public bool InheritScale { get; set; }

Gets or sets a value indicating whether the actor should inherit scale from its parent.

备注

When true, the actor will be affected by its parent's scale transformations.

AutoScale 双端 ​

csharp
public bool AutoScale { get; set; }

Gets or sets a value indicating whether the actor should automatically scale based on its scope.

备注

This is similar to InheritScale but specifically inherits scale from the actor scope rather than just the immediate parent.

Scale 双端 ​

csharp
public float? Scale { get; set; }

Gets or sets a uniform scale factor applied to the actor.

备注

This scale is applied to all dimensions of the actor. Use ScaleVector for non-uniform scaling along different axes.

ScaleVector 双端 ​

csharp
public Vector3? ScaleVector { get; set; }

Gets or sets a non-uniform scale vector applied to the actor.

备注

This allows different scaling factors for X, Y, and Z axes. If both Scale and ScaleVector are specified, they are multiplied.

AttachForwardOnce 双端 ​

csharp
public bool AttachForwardOnce { get; set; }

Gets or sets a value indicating whether the actor should use its parent only for the initial attachment transform.

备注

When true, the actor is attached, its position and rotation are initialized from the parent and socket, and it is immediately detached. It therefore stays at the captured world transform instead of continuing to follow the parent.

MiniMapIcon 双端 ​

csharp
public MiniMapIcon? MiniMapIcon { get; set; }

Gets or sets the minimap icon configuration for this actor, if any.

备注

When specified, the actor will appear on the minimap with the configured icon and properties.

ParentRemovalProcedure 双端 ​

csharp
public ParentRemovalProcedure ParentRemovalProcedure { get; set; }

Gets or sets the procedure to follow when the actor's parent is removed.

备注

This determines how the actor should behave when its parent actor is destroyed or removed, such as whether to also be destroyed, detached, or remain in place.

ReleaseOnGC 双端 ​

csharp
public bool ReleaseOnGC { get; set; }

Gets or sets a value indicating whether the actor should be released during garbage collection.

备注

When true, the actor's resources will be released during garbage collection cycles, which can help with memory management for frequently created and destroyed actors.

AssetVolume 双端 ​

csharp
public virtual Vector3? AssetVolume { get; }

Gets the volume dimensions of the actor's asset, if applicable.

备注

This represents the 3D bounding box of the actor's visual representation. Base implementation returns null; derived classes may override for specific asset types.

AssetRadius 双端 ​

csharp
public virtual float? AssetRadius { get; }

Gets the radius of the actor's asset, if applicable.

备注

This represents the spherical bounding radius of the actor's visual representation. Base implementation returns null; derived classes may override for specific asset types.

方法 ​

CreateActor 仅客户端 ​

csharp
public abstract Actor? CreateActor(IActorScope? scope = null, bool skipBirth = false, Scene? scene = null, ActorCreationOptions? creationOptions = null)

Creates an actor instance from this data configuration.

  • scope — The actor scope that will manage the created actor.
  • skipBirth — Whether to skip birth animations or effects.
  • scene — The scene to create the actor in, if different from the scope's scene.
  • creationOptions — Runtime creation options for the actor instance.

返回: A new actor instance, or null if creation failed.

备注

This method must be implemented by derived classes to define how specific actor types are instantiated from their data configurations.

SetNativeCacheRefresh 双端 ​

csharp
public void SetNativeCacheRefresh(bool refresh = true)

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

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

某些 GameDataActor 定义在运行时会被 native 层缓存。 如果你在游戏运行过程中修改了这类定义,后续新创建的 Actor 表现不一定会自动使用最新值。 调用此方法后,后续再次读取此定义的 native 逻辑会使用最新数据。 但已经创建并持有旧缓存结果的运行时对象,不保证立即更新。 未接通对应缓存链路的平台会安全忽略此请求。

GameDataActorAction 双端 ​

命名空间 GameCore.ActorSystem.Data

csharp
public class GameDataActorAction : GameDataActorHostModifier, IGameDataActorDualEndPoints, IGameData<IGameDataActorDualEndPoints>, IGameData, IGameData<GameDataActorAction>

动作表现 Actor,用于在场景中连接两个端点(发射点与命中点)的视觉动作效果。

构造函数 ​

GameDataActorAction 双端 ​

csharp
public GameDataActorAction(GameLink<GameDataActor, GameDataActorAction> link)

GameDataActorAction 双端 ​

csharp
public GameDataActorAction(IGameLink<GameDataActorAction> link)

属性 ​

LaunchSocket 双端 ​

csharp
public UTF8String? LaunchSocket { get; set; }

发射端挂载点名称,对应宿主模型上的骨骼或挂载点。

ImpactSocket 双端 ​

csharp
public UTF8String? ImpactSocket { get; set; }

命中端挂载点名称,对应宿主模型上的骨骼或挂载点。

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

方法 ​

CreateActor 仅客户端 ​

csharp
public override Actor? CreateActor(IActorScope? scope, bool skipBirth, Scene? scene = null, ActorCreationOptions? creationOptions = null)

GameDataActorAdditionModel 双端 ​

命名空间 GameCore.ActorSystem.Data

csharp
public class GameDataActorAdditionModel : GameDataActor, IGameData<GameDataActorAdditionModel>, IGameData

附加模型 Actor,在宿主上叠加显示额外模型(如披风、布料等)。

构造函数 ​

GameDataActorAdditionModel 双端 ​

csharp
public GameDataActorAdditionModel(GameLink<GameDataActor, GameDataActorAdditionModel> link)

GameDataActorAdditionModel 双端 ​

csharp
public GameDataActorAdditionModel(IGameLink<GameDataActorAdditionModel> link)

属性 ​

Model 双端 ​

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

CullHostMesh 双端 ​

csharp
public bool CullHostMesh { get; set; }

附加到宿主时是否剔除宿主网格。当附加模型完全遮挡宿主(如布料盖住单位)时设为 true,可避免重叠渲染问题。默认 false。

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

方法 ​

CreateActor 仅客户端 ​

csharp
public override Actor? CreateActor(IActorScope? scope, bool skipBirth, Scene? scene = null, ActorCreationOptions? creationOptions = null)

GameDataActorBeam 双端 ​

命名空间 GameCore.ActorSystem.Data

csharp
public class GameDataActorBeam : GameDataActor, IGameDataActorDualEndPoints, IGameData<IGameDataActorDualEndPoints>, IGameData, IGameData<GameDataActorBeam>

光束/激光 Actor,在发射点与命中点之间显示线性光束效果。

构造函数 ​

GameDataActorBeam 双端 ​

csharp
public GameDataActorBeam(GameLink<GameDataActor, GameDataActorBeam> link)

GameDataActorBeam 双端 ​

csharp
public GameDataActorBeam(IGameLink<GameDataActorBeam> link)

属性 ​

Beam 双端 ​

csharp
public IGameLink<GameDataParticle>? Beam { get; set; }

光束粒子资源,与 GameGraph ParticleSystem 的 Beam 发射器共享底层粒子能力。 ActorBeam 负责两端单位/挂点跟随及生命周期;此处引用 GameDataParticle,不直接接收运行时 Builder 对象。

LaunchSocket 双端 ​

csharp
public UTF8String? LaunchSocket { get; set; }

发射端挂载点名称。

ImpactSocket 双端 ​

csharp
public UTF8String? ImpactSocket { get; set; }

命中端挂载点名称。

Fade 双端 ​

csharp
public bool Fade { get; set; }

结束时是否淡出消失。

AutoPlay 双端 ​

csharp
public bool AutoPlay { get; set; }

创建后是否自动播放。默认 true。

Duration 双端 ​

csharp
public TimeSpan Duration { get; set; }

光束持续时间,到期后结束或淡出。

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

方法 ​

CreateActor 仅客户端 ​

csharp
public override Actor? CreateActor(IActorScope? scope, bool skipBirth, Scene? scene = null, ActorCreationOptions? creationOptions = null)

GameDataActorBSD 双端 ​

命名空间 GameCore.ActorSystem.Data

csharp
public abstract class GameDataActorBSD : GameDataActor, IGameData<GameDataActorBSD>, IGameData

构造函数 ​

GameDataActorBSD 双端 ​

csharp
public GameDataActorBSD(GameLink<GameDataActor, GameDataActorBSD> link)

GameDataActorBSD 双端 ​

csharp
public GameDataActorBSD(IGameLink<GameDataActorBSD> link)

属性 ​

IsTransient 双端 ​

csharp
public override bool IsTransient { get; }

ForceOneShot 双端 ​

csharp
public bool ForceOneShot { get; set; }

KillOnFinish 双端 ​

csharp
public bool KillOnFinish { get; set; }
csharp
public new IGameLink<GameDataActorBSD> Link { get; }

GameDataActorGrid 双端 ​

命名空间 GameCore.ActorSystem.Data

csharp
public class GameDataActorGrid : GameDataActor, IGameData<GameDataActorGrid>, IGameData

Defines the configuration data for grid actors, including visual appearance and behavioral settings.

备注

This class contains all the static configuration that determines how a grid actor behaves and appears in the game. Grid actors can be used for various purposes including building placement guides, area visualization, and tile-based game mechanics. The visual representation is controlled through state models that define different appearances for grid cells.

构造函数 ​

GameDataActorGrid 双端 ​

csharp
public GameDataActorGrid(GameLink<GameDataActor, GameDataActorGrid> link)

GameDataActorGrid 双端 ​

csharp
public GameDataActorGrid(IGameLink<GameDataActorGrid> link)

属性 ​

GridSize 双端 ​

csharp
public float GridSize { get; set; }

Gets or sets the default size of each grid cell in world units.

备注

This value defines the initial spacing between grid lines when the actor is created. The actual grid size can be dynamically adjusted after creation through the ActorGrid.Axis property. Larger values create more spaced-out grids, while smaller values create denser grids.

StateModels 双端 ​

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

Gets or sets the collection of 3D models used to represent different visual states of grid cells.

备注

Each element in the list represents a different visual state that grid cells can display. State values are used as indices into this collection: State 0: Uses StateModels[0] (or no model if null or empty) State 1: Uses StateModels[1] And so on... If a state value exceeds the collection size, no model will be displayed for that cell. Null entries are valid and result in invisible/empty cells for those states.

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

方法 ​

CreateActor 仅客户端 ​

csharp
public override Actor? CreateActor(IActorScope? scope = null, bool skipBirth = false, Scene? scene = null, ActorCreationOptions? creationOptions = null)

Creates a new ActorGrid instance based on this configuration data.

  • scope — The scope that will manage the created actor's lifecycle. Can be null.
  • skipBirth — If true, skips the actor's birth process during creation.
  • scene — The scene in which to create the actor. Can be null.
  • creationOptions — Runtime creation options for the actor instance.

返回: A new ActorGrid instance configured with this data, or null if creation fails.

备注

This method is only available on the client side where full grid functionality is supported. The created actor will use the settings defined in this configuration object.

GameDataActorHighlight 双端 ​

命名空间 GameCore.ActorSystem.Data

csharp
public class GameDataActorHighlight : GameDataActorHostModifier, IGameData<GameDataActorHighlight>, IGameData

高亮/选中 Actor,用于对宿主进行高亮或描边等视觉强调效果。

构造函数 ​

GameDataActorHighlight 双端 ​

csharp
public GameDataActorHighlight(GameLink<GameDataActor, GameDataActorHighlight> link)

GameDataActorHighlight 双端 ​

csharp
public GameDataActorHighlight(IGameLink<GameDataActorHighlight> link)

属性 ​

From 双端 ​

csharp
public ArithmeticMixer<HdrColor>? From { get; set; }

高亮起始颜色,null 时使用宿主当前颜色。

To 双端 ​

csharp
public ArithmeticMixer<HdrColor> To { get; set; }

高亮目标颜色。

AutoReverse 双端 ​

csharp
public bool AutoReverse { get; set; }

是否在到达目标后反向播放回起始颜色。

Duration 双端 ​

csharp
public TimeSpan Duration { get; set; }

高亮动画时长。

RepeatBehavior 双端 ​

csharp
public RepeatBehavior RepeatBehavior { get; set; }

重复次数,1 表示播放一次。

Weight 双端 ​

csharp
public double Weight { get; set; }

高亮混合权重,影响与宿主颜色的混合程度。默认 1。

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

方法 ​

CreateActor 仅客户端 ​

csharp
public override Actor? CreateActor(IActorScope? scope = null, bool skipBirth = false, Scene? scene = null, ActorCreationOptions? creationOptions = null)

GameDataActorHostModifier 双端 ​

命名空间 GameCore.ActorSystem.Data

csharp
public abstract class GameDataActorHostModifier : GameDataActor, IGameData<GameDataActorHostModifier>, IGameData

宿主修饰 Actor 基类,用于修饰宿主 Actor 的视觉或行为(如高亮、动作表现等)。

构造函数 ​

GameDataActorHostModifier 双端 ​

csharp
public GameDataActorHostModifier(GameLink<GameDataActor, GameDataActorHostModifier> link)

GameDataActorHostModifier 双端 ​

csharp
public GameDataActorHostModifier(IGameLink<GameDataActorHostModifier> link)

属性 ​

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

GameDataActorMaterial 双端 ​

命名空间 GameCore.ActorSystem.Data

csharp
public class GameDataActorMaterial : GameDataActorHostModifier, IGameData<GameDataActorMaterial>, IGameData

构造函数 ​

GameDataActorMaterial 双端 ​

csharp
public GameDataActorMaterial(GameLink<GameDataActor, GameDataActorMaterial> link)

GameDataActorMaterial 双端 ​

csharp
public GameDataActorMaterial(IGameLink<GameDataActorMaterial> link)

属性 ​

AutoPlay 双端 ​

csharp
public bool AutoPlay { get; set; }

Material 双端 ​

csharp
public Material Material { get; set; }

PropertyAnimations 双端 ​

csharp
public List<MaterialPropertyAnimation>? PropertyAnimations { get; set; }

Priority 双端 ​

csharp
public MaterialPriority Priority { get; set; }

IntroDuration 双端 ​

csharp
public TimeSpan IntroDuration { get; set; }

When the material is applied to a model, it will play the property animations from start to end within this duration.

OutroDuration 双端 ​

csharp
public TimeSpan OutroDuration { get; set; }

When the material is removed from a model, it will play the property animations from end to start within this duration.

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

方法 ​

CreateActor 仅客户端 ​

csharp
public override Actor? CreateActor(IActorScope? scope = null, bool skipBirth = false, Scene? scene = null, ActorCreationOptions? creationOptions = null)

GameDataActorModel 双端 ​

命名空间 GameCore.ActorSystem.Data

csharp
public class GameDataActorModel : GameDataActorBSD, IGameData<GameDataActorModel>, IGameData

模型 Actor,在场景中显示 3D 模型。

构造函数 ​

GameDataActorModel 双端 ​

csharp
public GameDataActorModel(GameLink<GameDataActor, GameDataActorModel> link)

GameDataActorModel 双端 ​

csharp
public GameDataActorModel(IGameLink<GameDataActorModel> link)

属性 ​

Model 双端 ​

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

AssetRadius 双端 ​

csharp
public override float? AssetRadius { get; }

AssetVolume 双端 ​

csharp
public override Vector3? AssetVolume { get; }
csharp
public new IGameLink<GameDataActorModel> Link { get; }

方法 ​

CreateActor 仅客户端 ​

csharp
public override Actor? CreateActor(IActorScope? scope, bool skipBirth, Scene? scene = null, ActorCreationOptions? creationOptions = null)

GameDataActorParticle 双端 ​

命名空间 GameCore.ActorSystem.Data

csharp
public class GameDataActorParticle : GameDataActorBSD, IGameData<GameDataActorParticle>, IGameData

粒子 Actor,在场景中播放粒子特效。

构造函数 ​

GameDataActorParticle 双端 ​

csharp
public GameDataActorParticle(GameLink<GameDataActor, GameDataActorParticle> link)

GameDataActorParticle 双端 ​

csharp
public GameDataActorParticle(IGameLink<GameDataActorParticle> link)

属性 ​

Particle 双端 ​

csharp
public IGameLink<GameDataParticle>? Particle { get; set; }

Fade 双端 ​

csharp
public bool Fade { get; set; }

结束时是否淡出消失。

PlaySpeed 双端 ​

csharp
public float? PlaySpeed { get; set; }

粒子播放速度倍率,null 时使用默认速度。

AutoPlay 双端 ​

csharp
public bool AutoPlay { get; set; }

创建后是否自动播放。默认 true。

CreationFilterLevel 双端 ​

csharp
public int CreationFilterLevel { get; set; }

创建过滤等级,低于当前场景过滤等级时不会创建此 Actor。默认 1。

AnimTrailSetting 双端 ​

csharp
public AnimTrailSetting? AnimTrailSetting { get; set; }

刀光/剑气等轨迹类粒子的附着点与宽度配置。

AssetRadius 双端 ​

csharp
public override float? AssetRadius { get; }

AssetVolume 双端 ​

csharp
public override Vector3? AssetVolume { get; }
csharp
public new IGameLink<GameDataActorParticle> Link { get; }

方法 ​

CreateActor 仅客户端 ​

csharp
public override Actor? CreateActor(IActorScope? scope, bool skipBirth, Scene? scene = null, ActorCreationOptions? creationOptions = null)

GameDataActorScope 双端 ​

命名空间 GameCore.ActorSystem.Data

csharp
public class GameDataActorScope : GameDataCategory<GameDataActorScope>, IGameDataActorScope, IGameDataNativeCacheRefreshable, IGameDataCategory<GameDataActorScope>, IGameData<GameDataActorScope>, IGameData

Actor 作用域配置,定义 Actor 的同步方式、地形高度处理及调试绘制等。

构造函数 ​

GameDataActorScope 双端 ​

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

GameDataActorScope 双端 ​

csharp
public GameDataActorScope(IGameLink<GameDataActorScope> link)

属性 ​

IgnoreTerrainHeight 双端 ​

csharp
public bool IgnoreTerrainHeight { get; set; }

是否忽略地形高度,将 Actor 放置在水平面上。

SyncType 双端 ​

csharp
public SyncType SyncType { get; set; }

同步类型,决定哪些客户端能看到此 Actor(如 Sight 表示视野内可见)。

DebugDrawSettings 双端 ​

csharp
public DebugDrawSettings? DebugDrawSettings { get; set; }

调试绘制配置,用于在编辑器中显示辅助线、范围等。

方法 ​

SetNativeCacheRefresh 双端 ​

csharp
public void SetNativeCacheRefresh(bool refresh = true)

请求刷新此 ActorScope 定义相关的 native 缓存。

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

GameDataActorScope 当前是通过单位定义的读取链路参与 native 缓存的, 因此此方法影响的是与该条目相关的后续单位定义读取结果。 这适用于运行时修改 ActorScope 定义后,希望后续新创建对象使用新值的场景。

GameDataActorSegmented 双端 ​

命名空间 GameCore.ActorSystem.Data

csharp
public abstract class GameDataActorSegmented : GameDataActor, IGameData<GameDataActorSegmented>, IGameData

分段/链条 Actor 基类,用于闪电链、冲击波等由多段组成的视觉效果。

构造函数 ​

GameDataActorSegmented 双端 ​

csharp
public GameDataActorSegmented(GameLink<GameDataActor, GameDataActorSegmented> link)

GameDataActorSegmented 双端 ​

csharp
public GameDataActorSegmented(IGameLink<GameDataActorSegmented> link)

属性 ​

SegmentedFlags 双端 ​

csharp
public ActorSegmentedFlags SegmentedFlags { get; set; }

分段显示选项,如正向播放动画、调试绘制等。

HeightTest 双端 ​

csharp
public ActorSegmentedHeight HeightTest { get; set; }

各分段的高度计算方式:使用发射点高度、发射点地面高度或每段贴地。

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

GameDataActorSegmentedRectangle 双端 ​

命名空间 GameCore.ActorSystem.Data

csharp
public class GameDataActorSegmentedRectangle : GameDataActorSegmented, IGameData<GameDataActorSegmentedRectangle>, IGameData

分段矩形 Actor,在发射端、命中端及可选的中间段之间生成分段矩形区域(如冲击波、地面裂缝等)。

构造函数 ​

GameDataActorSegmentedRectangle 双端 ​

csharp
public GameDataActorSegmentedRectangle(GameLink<GameDataActor, GameDataActorSegmentedRectangle> link)

GameDataActorSegmentedRectangle 双端 ​

csharp
public GameDataActorSegmentedRectangle(IGameLink<GameDataActorSegmentedRectangle> link)

属性 ​

LaunchActor 双端 ​

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

发射端 Actor,用于确定矩形起点及长度/宽度。

ImpactActor 双端 ​

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

命中端 Actor,用于确定矩形终点及长度/宽度。

CenterActor 双端 ​

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

中间段 Actor,可选,用于定义矩形中段的尺寸。

LaunchLength 双端 ​

csharp
public float LaunchLength { get; }

ImpactLength 双端 ​

csharp
public float ImpactLength { get; }

CenterLength 双端 ​

csharp
public float? CenterLength { get; }

LaunchWidth 双端 ​

csharp
public float? LaunchWidth { get; }

ImpactWidth 双端 ​

csharp
public float? ImpactWidth { get; }

CenterWidth 双端 ​

csharp
public float? CenterWidth { get; }
csharp
public new IGameLink<GameDataActorSegmentedRectangle> Link { get; }

方法 ​

CreateActor 仅客户端 ​

csharp
public override Actor? CreateActor(IActorScope? scope = null, bool skipBirth = false, Scene? scene = null, ActorCreationOptions? creationOptions = null)

GameDataActorSegmentedSector 双端 ​

命名空间 GameCore.ActorSystem.Data

csharp
public class GameDataActorSegmentedSector : GameDataActorSegmented, IGameData<GameDataActorSegmentedSector>, IGameData

分段扇形 Actor,只沿扇形两条边生成分段表现。 弧线部分通常由范围圈等其他指示器负责显示。

构造函数 ​

GameDataActorSegmentedSector 双端 ​

csharp
public GameDataActorSegmentedSector(GameLink<GameDataActor, GameDataActorSegmentedSector> link)

GameDataActorSegmentedSector 双端 ​

csharp
public GameDataActorSegmentedSector(IGameLink<GameDataActorSegmentedSector> link)

属性 ​

EdgeActor 双端 ​

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

扇形边缘单段 Actor,沿扇形两条边重复铺设。

EdgeWidth 双端 ​

csharp
public float? EdgeWidth { get; }

EdgeLength 双端 ​

csharp
public float? EdgeLength { get; }
csharp
public new IGameLink<GameDataActorSegmentedSector> Link { get; }

方法 ​

CreateActor 仅客户端 ​

csharp
public override Actor? CreateActor(IActorScope? scope = null, bool skipBirth = false, Scene? scene = null, ActorCreationOptions? creationOptions = null)

GameDataActorSite 双端 ​

命名空间 GameCore.ActorSystem.Data

csharp
public class GameDataActorSite : GameDataActor, IGameData<GameDataActorSite>, IGameData

地点/位置标记 Actor,用于在场景中标记一个位置点(无可见模型)。

构造函数 ​

GameDataActorSite 双端 ​

csharp
public GameDataActorSite(GameLink<GameDataActor, GameDataActorSite> link)

GameDataActorSite 双端 ​

csharp
public GameDataActorSite(IGameLink<GameDataActorSite> link)

属性 ​

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

方法 ​

CreateActor 仅客户端 ​

csharp
public override Actor? CreateActor(IActorScope? scope, bool skipBirth, Scene? scene = null, ActorCreationOptions? creationOptions = null)

GameDataActorSound 双端 ​

命名空间 GameCore.ActorSystem.Data

csharp
public class GameDataActorSound : GameDataActorBSD, IGameData<GameDataActorSound>, IGameData

音效 Actor,在场景中播放音效,支持 2D/3D、循环、多实例等配置。

构造函数 ​

GameDataActorSound 双端 ​

csharp
public GameDataActorSound(GameLink<GameDataActor, GameDataActorSound> link)

GameDataActorSound 双端 ​

csharp
public GameDataActorSound(IGameLink<GameDataActorSound> link)

属性 ​

Sound 双端 ​

csharp
public required List<WeightedLink<IGameLink<GameDataSound>?>> Sound { get; set; }

TraceLatency 双端 ​

csharp
public new bool TraceLatency { get; set; }

播放时输出音频延迟追踪日志。

LoopCount 双端 ​

csharp
public uint? LoopCount { get; set; }

循环次数,null 表示无限循环。

Is2D 双端 ​

csharp
public bool Is2D { get; set; }

是否以 2D 方式播放,不受相机位置影响。

PlayMode 双端 ​

csharp
public SoundPlayMode PlayMode { get; set; }

AutoPlay 双端 ​

csharp
public bool AutoPlay { get; set; }

创建后是否自动播放。默认 true。

RolloffFactor 双端 ​

csharp
public float RolloffFactor { get; set; }

3D 音效随距离衰减的陡峭程度,值越大衰减越快。仅 Is2D 为 false 时生效。

CutoffDistance 双端 ​

csharp
public float CutoffDistance { get; set; }

3D 音效完全静音的距离。仅 Is2D 为 false 时生效。

MaxInstanceCount 双端 ​

csharp
public uint MaxInstanceCount { get; set; }

同一音效链接允许的最大实例数,超出时新实例不播放,KillOnFinish 时会被终止。

MaxAudibleCount 双端 ​

csharp
public uint MaxAudibleCount { get; set; }

同一音效链接允许的最大可听实例数,超出时仍会播放但不可听。

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

方法 ​

CreateActor 仅客户端 ​

csharp
public override Actor? CreateActor(IActorScope? scope = null, bool skipBirth = false, Scene? scene = null, ActorCreationOptions? creationOptions = null)

GameDataActorText 双端 ​

命名空间 GameCore.ActorSystem.Data

csharp
public class GameDataActorText : GameDataActor, IGameData<GameDataActorText>, IGameData

文本 Actor,在场景中显示文字(如伤害数字、提示等)。

构造函数 ​

GameDataActorText 双端 ​

csharp
public GameDataActorText(GameLink<GameDataActor, GameDataActorText> link)

GameDataActorText 双端 ​

csharp
public GameDataActorText(IGameLink<GameDataActorText> link)

属性 ​

Font 双端 ​

csharp
public Font Font { get; set; }

FontSize 双端 ​

csharp
public float FontSize { get; set; }

Text 双端 ​

csharp
public string Text { get; set; }

Color 双端 ​

csharp
public Color Color { get; set; }

WrapWidth 双端 ​

csharp
public float? WrapWidth { get; set; }

自动换行宽度,null 表示不换行。

HorizontalAlignment 双端 ​

csharp
public TextHorizontalAlignment HorizontalAlignment { get; set; }

VerticalAlignment 双端 ​

csharp
public TextVerticalAlignment VerticalAlignment { get; set; }
csharp
public new IGameLink<GameDataActorText> Link { get; }

方法 ​

CreateActor 仅客户端 ​

csharp
public override Actor? CreateActor(IActorScope? scope = null, bool skipBirth = false, Scene? scene = null, ActorCreationOptions? creationOptions = null)

IGameDataActorDualEndPoints 双端 ​

命名空间 GameCore.ActorSystem.Data

csharp
public interface IGameDataActorDualEndPoints : IGameData<IGameDataActorDualEndPoints>, IGameData

属性 ​

LaunchSocket 双端 ​

csharp
public UTF8String? LaunchSocket { get; set; }

IGameDataActorScope 双端 ​

命名空间 GameCore.ActorSystem.Data

csharp
public interface IGameDataActorScope

属性 ​

SyncType 双端 ​

csharp
public SyncType SyncType { get; }

DebugDrawSettings 双端 ​

csharp
public DebugDrawSettings? DebugDrawSettings { get; }

IGameDataActorScopeOverride 双端 ​

命名空间 GameCore.ActorSystem.Data

csharp
public interface IGameDataActorScopeOverride : IGameData<IGameDataActorScopeOverride>, IGameData

属性 ​

ImpactActorsOverride 双端 ​

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

IGameDataActorScopeOwner 双端 ​

命名空间 GameCore.ActorSystem.Data

csharp
public interface IGameDataActorScopeOwner : IGameData<IGameDataActorScopeOwner>, IGameData

属性 ​

ActorArray 双端 ​

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

ImpactActors 双端 ​

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

ActorSegmentedFlags 双端 ​

命名空间 GameCore.ActorSystem.Data.Enum

csharp
public class ActorSegmentedFlags

构造函数 ​

ActorSegmentedFlags 双端 ​

csharp
public ActorSegmentedFlags()

属性 ​

ForwardAnimPlay 双端 ​

csharp
public bool ForwardAnimPlay { get; set; }

DebugDraw 双端 ​

csharp
public bool DebugDraw { get; set; }

ActorSegmentedHeight 双端 ​

命名空间 GameCore.ActorSystem.Data.Enum

csharp
public enum ActorSegmentedHeight

定义 Actor 分段高度的配置选项,控制 Actor 链条中各部分的垂直位置分布

备注

此枚举用于配置由多个分段组成的 Actor(如激光束、闪电链等)的高度分布模式。 不同的高度模式会影响分段 Actor 的视觉表现和空间定位。

枚举值 ​

  • LaunchSite — 启动点高度 - 所有分段使用启动点的高度
  • LaunchSiteGround — 启动点地面高度 - 使用启动点的地面高度
  • AllGrounded — 全部贴地 - 每个分段都调整到其所在位置的地面高度

AnimTrailMode 双端 ​

命名空间 GameCore.ActorSystem.Data.Enum

csharp
public enum AnimTrailMode

定义动画轨迹的渲染模式,控制轨迹效果在不同附着点之间的绘制方式

备注

动画轨迹模式用于配置如刀光、剑气粒子等拥有多个端点的粒子效果的渲染方向和起终点。 不同的模式决定了轨迹从哪个点开始,到哪个点结束,以及是否有中心点参与。

枚举值 ​

  • FromCenterToSocketAB — 从中心点到附着点 A 和 B - 创建从中心分叉到两个端点的轨迹
  • FromSocketAToSocketB — 从附着点 A 到附着点 B - 创建直接连接两个附着点的轨迹
  • FromSocketBToSocketA — 从附着点 B 到附着点 A - 创建从 B 到 A 方向的轨迹

MaterialPriority 双端 ​

命名空间 GameCore.ActorSystem.Data.Enum

csharp
public enum MaterialPriority

定义材质的渲染优先级,控制材质在渲染管线中的处理顺序

备注

材质优先级用于解决渲染顺序冲突,确保重要的视觉效果能够正确显示。 较高优先级的材质会在较低优先级之后渲染,从而覆盖在其上方。 这对于 UI 元素、特效和透明物体的正确显示非常重要。

枚举值 ​

  • Priority1 = 1 — 优先级 1 - 最低优先级,最先渲染
  • Priority2 — 优先级 2 - 较低优先级
  • Priority3 — 优先级 3 - 中等优先级
  • Priority4 — 优先级 4 - 较高优先级
  • Priority5 — 优先级 5 - 最高优先级,最后渲染

ParentRemovalProcedure 双端 ​

命名空间 GameCore.ActorSystem.Data.Enum

csharp
public enum ParentRemovalProcedure

定义当父级 Actor 被移除时,子 Actor 的处理程序

备注

此枚举控制 Actor 层级关系中,当父级对象被销毁或移除时, 其子级对象应该如何响应。不同的处理方式适用于不同类型的 Actor 关系和使用场景。

枚举值 ​

  • Default — 默认处理 - 如果是单位 Actor 则分离,否则移除
  • Remove — 移除处理 - Actor 会在父级移除时自动移除自身
  • Detach — 分离处理 - Actor 会从父级分离但不会被自动移除

SoundPlayMode 双端 ​

命名空间 GameCore.ActorSystem.Data.Enum

csharp
public enum SoundPlayMode

定义音频播放的模式,控制多个音频文件的播放顺序和选择方式

备注

当一个 Actor 包含多个音频文件时,播放模式决定了系统如何选择和播放这些音频。 不同的播放模式可以创建不同的音频体验,如按顺序播放或随机播放。

枚举值 ​

  • Sequential — 顺序播放 - 按照预定义的顺序依次播放音频文件
  • Random — 随机播放 - 随机选择音频文件进行播放

TextHorizontalAlignment 双端 ​

命名空间 GameCore.ActorSystem.Data.Enum

csharp
public enum TextHorizontalAlignment

Defines the horizontal alignment options for text rendering.

枚举值 ​

  • Left — Aligns text to the left edge of the container.
  • Center — Centers text horizontally within the container.
  • Right — Aligns text to the right edge of the container.

TextVerticalAlignment 双端 ​

命名空间 GameCore.ActorSystem.Data.Enum

csharp
public enum TextVerticalAlignment

定义文本渲染的垂直对齐选项

备注

垂直对齐选项控制文本在容器或边界框内的垂直位置。 这些选项通常与水平对齐配合使用,以精确控制文本的显示位置。

枚举值 ​

  • Top — 顶部对齐 - 文本与容器的顶部边缘对齐
  • Center — 居中对齐 - 文本在容器内垂直居中
  • Bottom — 底部对齐 - 文本与容器的底部边缘对齐

AnimTrailSetting 双端 ​

命名空间 GameCore.ActorSystem.Data.Struct

csharp
public class AnimTrailSetting

定义动画轨迹的配置设置,控制轨迹效果的外观和行为

备注

AnimTrailSetting 类用于配置各种轨迹类型的视觉效果,如刀光、剑气粒子等。 它定义了轨迹的起始和结束附着点、宽度以及渲染模式,为创建丰富的视觉效果提供了灵活的配置选项。

构造函数 ​

AnimTrailSetting 双端 ​

csharp
public AnimTrailSetting()

属性 ​

SocketA 双端 ​

csharp
public UTF8String SocketA { get; set; }

获取或设置轨迹的第一个附着点名称

备注

附着点 A 通常作为轨迹的起始点或其中一个端点。 附着点名称对应于 3D 模型中定义的骨骼或挂载点。

SocketB 双端 ​

csharp
public UTF8String SocketB { get; set; }

获取或设置轨迹的第二个附着点名称

备注

附着点 B 通常作为轨迹的结束点或另一个端点。 与附着点 A 配合,定义了轨迹的空间范围和方向。

Width 双端 ​

csharp
public float Width { get; set; }

获取或设置轨迹的宽度

备注

定义轨迹效果的视觉宽度,影响轨迹在屏幕上的粗细程度。 较大的值会创建更粗的轨迹效果,较小的值则创建更细的轨迹。

Mode 双端 ​

csharp
public AnimTrailMode Mode { get; set; }

获取或设置轨迹的渲染模式

备注

控制轨迹在附着点之间的绘制方式和方向。 默认模式为从附着点 A 到附着点 B 的直线轨迹。

DebugDrawSettings 双端 ​

命名空间 GameCore.ActorSystem.Data.Struct

csharp
public class DebugDrawSettings

构造函数 ​

DebugDrawSettings 双端 ​

csharp
public DebugDrawSettings()

属性 ​

PreferredColor 双端 ​

csharp
public Color PreferredColor { get; set; }

Enabled 双端 ​

csharp
public bool Enabled { get; set; }

Determines whether debug drawing is enabled by default. If true, debug shapes will be drawn in the game scene for debugging purposes. Actors and ActorScopes can still draw debug shapes manually even if this is false.

MaterialPropertyAnimation 双端 ​

命名空间 GameCore.ActorSystem.Data.Struct

csharp
public class MaterialPropertyAnimation

构造函数 ​

MaterialPropertyAnimation 双端 ​

csharp
public MaterialPropertyAnimation()

属性 ​

PropertyName 双端 ​

csharp
public UTF8String PropertyName { get; set; }

StartValue 双端 ​

csharp
public Variant StartValue { get; set; }

EndValue 双端 ​

csharp
public Variant EndValue { get; set; }

MiniMapIcon 双端 ​

命名空间 GameCore.ActorSystem.Data.Struct

csharp
public class MiniMapIcon

定义小地图图标的配置,包含不同状态和朝向下的图标资源

备注

MiniMapIcon 类用于配置 Actor 在小地图上的显示方式。它支持多种图标状态, 包括友方、敌方、旋转等不同情况下的图标显示,以及层级控制。 这样可以为玩家提供清晰的小地图视觉信息。

构造函数 ​

MiniMapIcon 双端 ​

csharp
public MiniMapIcon()

属性 ​

Icon 双端 ​

csharp
public Icon Icon { get; set; }

获取或设置默认的小地图图标

备注

这是最基本的图标,在没有特殊状态时显示。 通常用于中性或友方单位的默认表示。

IconRotated 双端 ​

csharp
public Icon IconRotated { get; set; }

获取或设置带有旋转方向的小地图图标

备注

当需要显示单位朝向时使用的图标,通常包含箭头或方向指示器。 可以根据单位的实际朝向进行旋转显示。

IconEnemy 双端 ​

csharp
public Icon IconEnemy { get; set; }

获取或设置敌方单位的小地图图标

备注

专门用于显示敌方单位的图标,通常使用不同的颜色或样式来区分敌友。 帮助玩家快速识别小地图上的威胁。

IconEnemyRotated 双端 ​

csharp
public Icon IconEnemyRotated { get; set; }

获取或设置敌方单位带有旋转方向的小地图图标

备注

敌方单位的朝向图标,结合了敌方标识和方向指示。 让玩家既能识别敌方单位,又能了解其朝向。

IconSelfRotated 双端 ​

csharp
public Icon IconSelfRotated { get; set; }

获取或设置玩家自身单位带有旋转方向的小地图图标

备注

专门用于显示玩家控制的单位的朝向图标,通常具有特殊的视觉样式。 帮助玩家快速定位和识别自己的单位。

ZIndex 双端 ​

csharp
public int ZIndex { get; set; }

获取或设置图标的 Z 轴顺序,决定其相对于其他元素的堆叠顺序

备注

数值越高的图标会渲染在上层,覆盖数值较低的图标。 用于控制不同类型图标在小地图上的显示优先级。

PropertyActorScopePersist 双端 ​

命名空间 GameCore.ActorSystem.Enum

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

方法 ​

ToString 双端 ​

csharp
public override string? ToString()

operator == 双端 ​

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

operator != 双端 ​

csharp
public static bool operator !=(PropertyActorScopePersist left, PropertyActorScopePersist 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
csharp
public static readonly PropertyActorScopePersist Link

Source 双端 ​

csharp
public static readonly PropertyActorScopePersist Source

Target 双端 ​

csharp
public static readonly PropertyActorScopePersist Target

Host 双端 ​

csharp
public static readonly PropertyActorScopePersist Host
csharp
public static readonly PropertyActorScopePersist OverrideLink

Scale 双端 ​

csharp
public static readonly PropertyActorScopePersist Scale

Volume 双端 ​

csharp
public static readonly PropertyActorScopePersist Volume

Radius 双端 ​

csharp
public static readonly PropertyActorScopePersist Radius

Facing 双端 ​

csharp
public static readonly PropertyActorScopePersist Facing

ActorSlotVersion 双端 ​

csharp
public static readonly PropertyActorScopePersist ActorSlotVersion

ScopeAction 双端 ​

命名空间 GameCore.ActorSystem.Enum

csharp
public enum ScopeAction

定义 Actor 作用域可以执行的操作类型

备注

这个枚举用于标识不同类型的作用域操作,这些操作影响作用域内 Actor 的行为和表现。 作用域操作通常在特定游戏事件或触发条件下执行。

枚举值 ​

  • Normal — 这是干啥的?忘记了。
  • Impact — 撞击操作 - 触发撞击效果和相关 Actor

TintColorType 双端 ​

命名空间 GameCore.ActorSystem.Enum

csharp
public enum TintColorType

Defines the blending mode for applying tint colors to actor models.

备注

This enumeration determines how tint colors interact with the actor's original texture colors. Different blending modes provide various visual effects for team colors, status indicators, material adjustments, and other color-based visual feedback systems.

枚举值 ​

  • Factor — Multiplies the tint color with the actor's base color.
  • Override — Blends the tint color over the actor's base color using alpha compositing.

GridAxis 双端 ​

命名空间 GameCore.ActorSystem.Struct

csharp
public readonly struct GridAxis : IEquatable<GridAxis>

Represents the axis vectors that define the orientation and scale of a grid in 3D space.

构造函数 ​

GridAxis 双端 ​

csharp
public GridAxis(Vector3 x, Vector3 y)

Initializes a new instance of the GridAxis struct.

  • x — The X-axis vector defining the direction and scale of the grid's X dimension.
  • y — The Y-axis vector defining the direction and scale of the grid's Y dimension.

属性 ​

X 双端 ​

csharp
public Vector3 X { get; init; }

Gets the X-axis vector that defines the direction and scale of the grid's X dimension.

Y 双端 ​

csharp
public Vector3 Y { get; init; }

Gets the Y-axis vector that defines the direction and scale of the grid's Y dimension.

方法 ​

ToString 双端 ​

csharp
public override string ToString()

operator != 双端 ​

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

operator == 双端 ​

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

GetHashCode 双端 ​

csharp
public override int GetHashCode()

Equals 双端 ​

csharp
public override bool Equals(object obj)

Equals 双端 ​

csharp
public bool Equals(GridAxis other)

GridBounds 双端 ​

命名空间 GameCore.ActorSystem.Struct

csharp
public readonly struct GridBounds : IEquatable<GridBounds>

Represents a grid bounds with X and Y dimensions in grid cell units.

构造函数 ​

GridBounds 双端 ​

csharp
public GridBounds(int x, int y, int dimensionX, int dimensionY)

Initializes a new instance of the GridBounds struct.

  • x — The X offset of the grid bounds origin in world coordinates.
  • y — The Y offset of the grid bounds origin in world coordinates.
  • dimensionX — The size of the grid bounds in X direction in grid cells.
  • dimensionY — The size of the grid bounds in Y direction in grid cells.

GridBounds 双端 ​

csharp
public GridBounds(Rectangle rect)

Initializes a new instance of the GridBounds struct from a Rectangle.

  • rect — The rectangle to convert from.

属性 ​

OffsetX 双端 ​

csharp
public int OffsetX { get; init; }

Gets the X offset of the grid bounds origin in world coordinates.

OffsetY 双端 ​

csharp
public int OffsetY { get; init; }

Gets the Y offset of the grid bounds origin in world coordinates.

DimensionX 双端 ​

csharp
public int DimensionX { get; init; }

Gets the size of the grid bounds in X direction in grid cells.

DimensionY 双端 ​

csharp
public int DimensionY { get; init; }

Gets the size of the grid bounds in Y direction in grid cells.

方法 ​

Contains 双端 ​

csharp
public bool Contains(GridIndex index)

Checks if the specified grid index is within this bounds.

  • index — The grid index to check.

返回: True if the index is within the bounds; otherwise, false.

Contains 双端 ​

csharp
public bool Contains(int indexX, int indexY)

Checks if the specified coordinates are within this bounds.

  • indexX — The X coordinate to check.
  • indexY — The Y coordinate to check.

返回: True if the coordinates are within the bounds; otherwise, false.

implicit operator 双端 ​

csharp
public static Rectangle implicit operator(GridBounds bounds)

Implicitly converts a GridBounds to a Rectangle.

  • bounds — The grid bounds to convert.

返回: A rectangle with the same coordinates and dimensions.

implicit operator 双端 ​

csharp
public static GridBounds implicit operator(Rectangle rect)

Implicitly converts a Rectangle to a GridBounds.

  • rect — The rectangle to convert.

返回: A grid bounds with the same coordinates and dimensions.

ToString 双端 ​

csharp
public override string ToString()

Returns a string representation of the grid bounds.

返回: A string in the format "GridBounds(OffsetX, OffsetY, DimensionX, DimensionY)".

operator != 双端 ​

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

operator == 双端 ​

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

GetHashCode 双端 ​

csharp
public override int GetHashCode()

Equals 双端 ​

csharp
public override bool Equals(object obj)

Equals 双端 ​

csharp
public bool Equals(GridBounds other)

GridIndex 双端 ​

命名空间 GameCore.ActorSystem.Struct

csharp
public readonly struct GridIndex : IEquatable<GridIndex>

Represents a grid index with X and Y coordinates for addressing grid cells.

构造函数 ​

GridIndex 双端 ​

csharp
public GridIndex(int x, int y)

Initializes a new instance of the GridIndex struct.

  • x — The X coordinate of the grid index.
  • y — The Y coordinate of the grid index.

属性 ​

X 双端 ​

csharp
public int X { get; init; }

Gets the X coordinate of the grid index.

Y 双端 ​

csharp
public int Y { get; init; }

Gets the Y coordinate of the grid index.

方法 ​

ToString 双端 ​

csharp
public override string ToString()

implicit operator 双端 ​

csharp
public static Point implicit operator(GridIndex index)

Implicitly converts a GridIndex to a Point.

  • index — The grid index to convert.

返回: A point with the same X and Y coordinates.

implicit operator 双端 ​

csharp
public static GridIndex implicit operator(Point point)

Implicitly converts a Point to a GridIndex.

  • point — The point to convert.

返回: A grid index with the same X and Y coordinates.

operator != 双端 ​

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

operator == 双端 ​

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

GetHashCode 双端 ​

csharp
public override int GetHashCode()

Equals 双端 ​

csharp
public override bool Equals(object obj)

Equals 双端 ​

csharp
public bool Equals(GridIndex other)

GridState 双端 ​

命名空间 GameCore.ActorSystem.Struct

csharp
public class GridState : IGridStateManager

Manages the state of grid cells for an ActorGrid.

构造函数 ​

GridState 双端 ​

csharp
public GridState(ActorGrid actorGrid)

Initializes a new instance of the GridState class.

  • actorGrid — The actor grid that owns this state manager.

GridState 双端 ​

csharp
public GridState(Func<GridIndex, int, bool> updateCallback, Func<GridIndex, bool>? validationCallback = null)

Initializes a new instance of the GridState class with custom callbacks.

  • updateCallback — Callback function to update the visual representation.
  • validationCallback — Optional callback function to validate grid indices.

方法 ​

IsValidIndex 双端 ​

csharp
public bool IsValidIndex(GridIndex index)

Clear 双端 ​

csharp
public void Clear()

索引器 ​

this[] 双端 ​

csharp

this[] 双端 ​

csharp

Gets or sets the state of a specific grid cell.

  • x — The x index of the cell.
  • y — The y index of the cell.

返回: The state value of the cell, or 0 if not set.

IGridStateManager 双端 ​

命名空间 GameCore.ActorSystem.Struct

csharp
public interface IGridStateManager

Interface for managing grid cell states.

方法 ​

IsValidIndex 双端 ​

csharp
bool IsValidIndex(GridIndex index)

Checks if the specified grid index is valid.

  • index — The grid index to validate.

返回: True if the index is valid; otherwise, false.

Clear 双端 ​

csharp
void Clear()

Clears all grid states by resetting them to default value (0) and clearing the internal collection.

索引器 ​

this[] 双端 ​

csharp

Gets or sets the state of a specific grid cell.

  • index — The grid index of the cell.

返回: The state value of the cell, or 0 if not set.