主题
GameGraph.NodeSystem
ActorScopeNodeActorSlotAttachMode 双端
命名空间 GameGraph.NodeSystem
csharp
public enum ActorScopeNodeActorSlotAttachModeActor slot 的客户端附着目标。
枚举值
ScopeAttachSite— 兼容旧行为:附着到 ActorScopePersist.AttachSite。DeclaringNode— 附着到声明该 slot 的绑定 Node。BindingNode— 附着到同一 ActorScopePersist 下指定 role/key 的绑定 Node。
ActorScopeNodeActorSlotOptions 双端
命名空间 GameGraph.NodeSystem
csharp
public sealed class ActorScopeNodeActorSlotOptions : IEquatable<ActorScopeNodeActorSlotOptions>ActorScope 绑定 Node 上的持久 actor slot 配置。
备注
Slot 是服务端写入的可同步表现声明;客户端在收到绑定 Node 后按声明创建本地 Actor。 Slot 语义要求 actor 数据本身是非 transient。
构造函数
ActorScopeNodeActorSlotOptions 双端
csharp
public ActorScopeNodeActorSlotOptions()属性
Key 双端
csharp
public string Key { get; init; }Slot 内 Actor 的稳定 key,同一绑定 Node 下唯一。
SkipBirth 双端
csharp
public bool SkipBirth { get; init; }是否跳过 birth 表现。
AutoPlay 双端
csharp
public bool AutoPlay { get; init; }创建后若 Actor 支持播放接口,是否立即 Play。
Socket 双端
csharp
public string? Socket { get; init; }覆盖 Actor 数据中配置的 socket。null 表示沿用 Actor 数据配置。
AttachMode 双端
csharp
public ActorScopeNodeActorSlotAttachMode AttachMode { get; init; }客户端 Actor 的附着目标。默认附着到声明该 slot 的绑定 Node。
AttachBindingRole 双端
csharp
public ActorScopeNodeBindingRole AttachBindingRole { get; init; }AttachMode 为 BindingNode 时使用的目标绑定用途。
AttachBindingKey 双端
csharp
public string? AttachBindingKey { get; init; }AttachMode 为 BindingNode 时使用的目标绑定 key。
LocalOffset 双端
csharp
public Vector3 LocalOffset { get; init; }相对附着目标的本地偏移。
IncludeBindingLocalOffset 双端
csharp
public bool IncludeBindingLocalOffset { get; init; }AttachMode 为 ScopeAttachSite 时,是否叠加声明绑定的 ActorScopeNodeBinding.LocalOffset。
Rotation 双端
csharp
public Vector3? Rotation { get; init; }覆盖 Actor 创建后的本地欧拉角。
Scale 双端
csharp
public Vector3? Scale { get; init; }覆盖 Actor 创建后的本地缩放。
方法
ToString 双端
csharp
public override string ToString()operator != 双端
csharp
public static bool operator !=(ActorScopeNodeActorSlotOptions? left, ActorScopeNodeActorSlotOptions? right)operator == 双端
csharp
public static bool operator ==(ActorScopeNodeActorSlotOptions? left, ActorScopeNodeActorSlotOptions? right)GetHashCode 双端
csharp
public override int GetHashCode()Equals 双端
csharp
public override bool Equals(object? obj)Equals 双端
csharp
public bool Equals(ActorScopeNodeActorSlotOptions? other)ActorScopeNodeBinding 双端
命名空间 GameGraph.NodeSystem
csharp
public sealed class ActorScopeNodeBinding描述一个 ActorScopePersist 与一个 GameGraph Node 之间的绑定关系。
备注
绑定到 ActorScopePersist 的 replicated Node 会复用底层 light-unit 视野过滤: 当前作用域对某客户端不可见时,该客户端不会收到绑定 Node 的同步信息。
属性
Scope 双端
csharp
public IActorScopePersist Scope { get; }Node 双端
csharp
public Node Node { get; }Role 双端
csharp
public ActorScopeNodeBindingRole Role { get; }Key 双端
csharp
public string Key { get; }Mode 双端
csharp
public ActorScopeNodeBindingMode Mode { get; set; }当前绑定的权威同步模式。
LocalOffset 双端
csharp
public Vector3 LocalOffset { get; set; }以作用域朝向为基准的本地偏移。XY 为地面平面,Z 为高度。
LocalRotation 双端
csharp
public Quaternion LocalRotation { get; set; }以作用域朝向为基准的本地旋转。
方法
SyncFromScope 双端
csharp
public void SyncFromScope()使用 ActorScope 当前的位置和朝向强制刷新绑定 Node。
ActorScopeNodeBindingExtensions 双端
命名空间 GameGraph.NodeSystem
csharp
public static class ActorScopeNodeBindingExtensions方法
BindNode 双端
csharp
public static ActorScopeNodeBinding BindNode(this IActorScopePersist scope, Node node, ActorScopeNodeBindingRole role = ActorScopeNodeBindingRole.Root, string? key = null, ActorScopeNodeBindingMode mode = ActorScopeNodeBindingMode.Manual, Vector3? localOffset = null, Quaternion? localRotation = null, bool destroyNodeOnUnbind = false)将已有 Node 绑定到持久 ActorScope。默认不接管外部 Node 生命周期。
备注
如果被绑定的 Node 是 SCE 场景中的 replicated Node,它会随绑定作用域的视野可见性对各客户端创建或移除。
EnsureNodeBinding 双端
csharp
public static ActorScopeNodeBinding? EnsureNodeBinding(this IActorScopePersist scope, ActorScopeNodeBindingRole role = ActorScopeNodeBindingRole.Root, string? key = null, NodeReplication replication = NodeReplication.Replicated, ActorScopeNodeBindingMode mode = ActorScopeNodeBindingMode.ScopeDriven, Vector3? localOffset = null, Quaternion? localRotation = null)获取或创建持久 ActorScope 的指定用途绑定 Node。
备注
创建出的 replicated Node 挂在当前 SCE 场景同步根下,并随绑定作用域的视野可见性对各客户端创建或移除。
GetNode 双端
csharp
public static Node? GetNode(this IActorScopePersist scope, ActorScopeNodeBindingRole role, string? key = null, bool createIfMissing = false)查询持久 ActorScope 的指定用途绑定 Node。createIfMissing 为 true 时会在 SCE 同步根下创建。
GetNodeBinding 双端
csharp
public static ActorScopeNodeBinding? GetNodeBinding(this IActorScopePersist scope, ActorScopeNodeBindingRole role = ActorScopeNodeBindingRole.Root, string? key = null)GetNodeBindings 双端
csharp
public static ActorScopeNodeBinding[] GetNodeBindings(this IActorScopePersist scope, ActorScopeNodeBindingRole? role = null)SyncNodeBindingsFromScope 双端
csharp
public static void SyncNodeBindingsFromScope(this IActorScopePersist scope, ActorScopeNodeBindingRole? role = null)UnbindNode 双端
csharp
public static bool UnbindNode(this IActorScopePersist scope, ActorScopeNodeBindingRole role = ActorScopeNodeBindingRole.Root, string? key = null, bool destroyOwnedNode = true)UnbindAllNodes 双端
csharp
public static void UnbindAllNodes(this IActorScopePersist scope, bool destroyOwnedNodes = true)GetActorScopeNodeBinding 双端
csharp
public static ActorScopeNodeBinding? GetActorScopeNodeBinding(this Node node)GetBoundActorScope 双端
csharp
public static IActorScopePersist? GetBoundActorScope(this Node node)UnbindActorScope 双端
csharp
public static bool UnbindActorScope(this Node node, bool destroyOwnedNode = true)RefreshActorSlots 仅客户端
csharp
public static void RefreshActorSlots(this ActorScopeNodeBinding binding)刷新客户端当前绑定 Node 上由 slot 声明创建的本地 Actor。
GetActorSlotActor 仅客户端
csharp
public static Actor? GetActorSlotActor(this ActorScopeNodeBinding binding, string? key = null)获取客户端当前绑定 Node 上指定 slot 创建出的本地 Actor。
GetActorSlotActors 仅客户端
csharp
public static Actor[] GetActorSlotActors(this ActorScopeNodeBinding binding)获取客户端当前绑定 Node 上全部 slot 创建出的本地 Actor。
SetActorSlot 仅服务端
csharp
public static bool SetActorSlot(this IActorScopePersist scope, IGameLink<GameDataActor> actorLink, string? key = null, ActorScopeNodeActorSlotOptions? options = null)在持久 ActorScope 上声明一个普通持久 Actor slot。声明会同步到可见客户端并由客户端本地创建 Actor。
备注
这是服务端创建普通持久表现的推荐入口。它会内部使用默认 root binding 承载同步声明。 有宿主的 scope(如单位、技能、Buff)默认附着到 scope 自身的 AttachSite; 没有宿主的独立位置 scope 默认附着到声明该 slot 的 replicated Node。 需要真实 replicated Node、Node SyncVar 或 GameGraph 组件时,再直接使用 ActorScopeNodeBinding。
ClearActorSlot 仅服务端
csharp
public static bool ClearActorSlot(this IActorScopePersist scope, string? key = null)清除持久 ActorScope 默认 slot 承载点上的指定普通持久 Actor slot。
ClearActorSlots 仅服务端
csharp
public static void ClearActorSlots(this IActorScopePersist scope)清除持久 ActorScope 默认 slot 承载点上的全部普通持久 Actor slot。
SetActorSlot 仅服务端
csharp
public static void SetActorSlot(this ActorScopeNodeBinding binding, IGameLink<GameDataActor> actorLink, string? key = null, ActorScopeNodeActorSlotOptions? options = null)在绑定 Node 上声明一个持久子 Actor slot。声明会同步到可见客户端并由客户端本地创建 Actor。
ClearActorSlot 仅服务端
csharp
public static bool ClearActorSlot(this ActorScopeNodeBinding binding, string? key = null)清除绑定 Node 上的指定持久子 Actor slot。
ClearActorSlots 仅服务端
csharp
public static void ClearActorSlots(this ActorScopeNodeBinding binding)清除绑定 Node 上的全部持久子 Actor slot。
ActorScopeNodeBindingMode 双端
命名空间 GameGraph.NodeSystem
csharp
public enum ActorScopeNodeBindingModeActorScopePersist 与 GameGraph Node 的权威同步模式。
枚举值
ScopeDriven— ActorScopePersist 位置/朝向是权威源,绑定 Node 跟随作用域。Manual— 只建立绑定、metadata 和反查关系,不做自动 transform 同步。
ActorScopeNodeBindingRole 双端
命名空间 GameGraph.NodeSystem
csharp
public enum ActorScopeNodeBindingRoleActorScopePersist 与 GameGraph Node 的绑定用途。
枚举值
RootAnchorCustom
ComponentReplication 双端
命名空间 GameGraph.NodeSystem
csharp
public enum ComponentReplication枚举值
InheritLocalReplicated
ExtensionMethod 双端
命名空间 GameGraph.NodeSystem
csharp
public static class ExtensionMethod方法
GetNode 双端
csharp
public static Node? GetNode(this Unit unit)获取根Node
返回: Node对象
TryGetClientVisualNode 仅客户端
csharp
public static bool TryGetClientVisualNode(this IActor actor, out Node? node)尝试获取客户端表现层 Actor 根 Node。
备注
该方法只表达客户端 visual actor node;不代表服务端权威 Node,也不回退 UnitNodeBinding。
GetOwnerPhysicsWorld 双端
csharp
public static PhysicsWorld? GetOwnerPhysicsWorld(this Unit unit)获取所属的物理世界
返回: 物理世界对象
GetNavigation 双端
csharp
public static SceneNavigation? GetNavigation(this Scene scene)获取当前 SCE 场景绑定的导航查询接口。
备注
这是从高层 Scene 访问 GameGraph 导航查询的便捷入口。只有服务端场景已绑定 SceneGraph 且加载了 Nav3D 数据时才会返回实例;否则返回 null。
GetRigidBody 双端
csharp
public static RigidBody? GetRigidBody(this PhysicsRaycastResult raycastResult)GetDynamicRootNode 仅客户端
csharp
public static Node? GetDynamicRootNode(this Scene scene)GetSceneGraph 双端
csharp
public static SceneGraph? GetSceneGraph(this Scene scene)GetSyncRoot 双端
csharp
public static Node? GetSyncRoot(this Scene scene)获取当前 SCE 场景的同步挂载根。第一阶段返回底层 Urho Scene 根节点。
AddSyncNode 双端
csharp
public static void AddSyncNode(this Scene scene, Node node, NodeReplication replication = NodeReplication.Replicated)将节点作为当前 SCE 场景的同步节点加入。底层挂载语义由场景同步入口统一维护。
GetParticleEmitters 仅客户端
csharp
public static ParticleEmitter[]? GetParticleEmitters(this ActorParticle actor)获取 ActorParticle 底层节点上所有粒子发射器组件。 可用于对 Actor 层粒子效果进行发射器级精细控制(速度、缩放、生成率等)。
GetParticleEmitterCount 仅客户端
csharp
public static int GetParticleEmitterCount(this ActorParticle actor)获取 ActorParticle 底层节点上 粒子发射器的数量。
GetParticleEmitter 仅客户端
csharp
public static ParticleEmitter? GetParticleEmitter(this ActorParticle actor, int index)获取 ActorParticle 底层节点上第 index 个 粒子发射器。
GetSoundSource 仅客户端
csharp
public static SoundSourceComponent? GetSoundSource(this ActorSound actor)获取 ActorSound 底层的 SoundSourceComponent,可用于精细控制音频参数 (Frequency、Panning、Attenuation、MixOutput 等)。
GetText3D 仅客户端
csharp
public static Text3DComponent? GetText3D(this ActorText actor)获取 ActorText 客户端表现层实际使用的 Text3DComponent。
备注
返回 null 表示客户端表现节点尚未创建或已经销毁。通过该组件修改的属性可能在 ActorText 重建,或高层 ActorText 再次写入对应状态时被覆盖。
GetAnimatedModel 仅客户端
csharp
public static AnimatedModelComponent? GetAnimatedModel(this IActorAnimationPlayable actor)获取 Actor 底层的 AnimatedModelComponent。
备注
用于在 Actor 体系之外通过 GameGraph 公共 API 直接控制角色模型 (蒙皮方式开关、LOD 偏置、根运动等)。Actor 自身的 PlayAnimation 等接口 走的就是同一个底层组件,双向控制等价。
GetAnimationController 仅客户端
csharp
public static AnimationController? GetAnimationController(this IActorAnimationPlayable actor)获取 Actor 底层的 AnimationController。
备注
用于在 Actor 体系之外通过 GameGraph 公共 API 直接控制动画播放 (层级混合、淡入淡出、状态查询、精细 Time/Weight 控制等)。 Actor 自身的 PlayAnimation / StopAnimationOfLayer 等接口 操作的就是同一个底层动画控制器,双向控制等价。 注:Actor 的 ModelAnimation 体系还会做优先级压制等额外逻辑,绕过它直接 操作底层 controller 可能与 Actor 层的状态机产生冲突。建议只在已经脱离 Actor 体系(如纯 GameGraph 模式)或确实需要精细访问时使用。
GetAnimationState 仅客户端
csharp
public static AnimationState? GetAnimationState(this Animation animation)获取 Actor 层 Animation 对应的底层 AnimationState。返回 null 表示该 Actor 节点 上未挂 AnimationController 或动画不在播放中。
备注
通过动画资源路径在底层 controller 查找匹配的 state 实例: actor.GetAnimationController().GetAnimationState(AnimationHandle.For(animation.AnimationResource))。 边界条件:若同一节点上以 allowDuplicates = true 加载了多个同名动画, 此方法只返回首个匹配。常规播放(allowDuplicates = false 默认值)下不会出现该情况。
GameGraphComponentRegistration 双端
命名空间 GameGraph.NodeSystem
csharp
public sealed class GameGraphComponentRegistration : IGameClass构造函数
GameGraphComponentRegistration 双端
csharp
public GameGraphComponentRegistration()方法
OnRegisterGameClass 双端
csharp
public static void OnRegisterGameClass()Node 双端
命名空间 GameGraph.NodeSystem
csharp
public sealed class Node : DisposableObject场景图节点,对应引擎的 Node 对象,管理位置、旋转、缩放和子组件。
构造函数
Node 双端
csharp
public Node()属性
ObjectAnimation 仅客户端
csharp
public ObjectAnimation? ObjectAnimation { get; set; }AnimationEnabled 双端
csharp
public bool AnimationEnabled { get; set; }是否自动更新该节点已配置的属性动画。
Id 双端
csharp
public uint Id { get; }引擎节点 ID。未加入场景或已失效时为 0。
IsReplicated 双端
csharp
public bool IsReplicated { get; }节点是否使用 replicated ID,参与引擎网络复制。
IsEnabled 双端
csharp
public bool IsEnabled { get; set; }是否启用
Position 双端
csharp
public Vector3 Position { get; set; }世界空间下的位置
Rotation 双端
csharp
public Quaternion Rotation { get; set; }世界空间下的旋转
LocalPosition 双端
csharp
public Vector3 LocalPosition { get; set; }本地空间下的位置
LocalRotation 双端
csharp
public Quaternion LocalRotation { get; set; }本地空间下的旋转
LocalScale 双端
csharp
public Vector3 LocalScale { get; set; }本地空间下的缩放
SceneGraph 双端
csharp
public SceneGraph? SceneGraph { get; }所属场景
Name 双端
csharp
public UTF8String Name { get; set; }节点名称。
Parent 双端
csharp
public Node? Parent { get; set; }父节点
Children 双端
csharp
public NodeList Children { get; }子节点列表,支持索引访问和 foreach 遍历
Tags 双端
csharp
public UTF8String[] Tags { get; }获取节点标签快照。
Forward 双端
csharp
public Vector3 Forward { get; }节点的前方方向(世界空间)。引擎使用 Z 轴正方向为前方。
Up 双端
csharp
public Vector3 Up { get; }节点的上方方向(世界空间)
Right 双端
csharp
public Vector3 Right { get; }节点的右方方向(世界空间)
AllowDuplicateContactEvents 双端
csharp
public bool AllowDuplicateContactEvents { get; set; }获取或设置是否允许重复的碰撞事件(同时控制2D和3D碰撞)。
备注
如果碰撞的两个物体都注册了碰撞事件,设置为 true 时两个Node都会收到碰撞事件, 设置为 false(默认)时只会触发一次碰撞事件,有助于减少重复的碰撞事件处理。 同一个Node不会同时使用2D和3D物理,因此此属性同时控制两者。
IsTemporary 双端
csharp
public bool IsTemporary { get; }是否在引擎场景序列化中将该 Node 视为临时对象。
备注
本文件中的 Serializable/Variant API 操作的是引擎对象注册属性,不替代 Unit 属性、PropertyObject 或 PropertyObjectHostComponent 的业务状态同步。
NumAttributes 双端
csharp
public uint NumAttributes { get; }NumNetworkAttributes 双端
csharp
public uint NumNetworkAttributes { get; }NameHash 双端
csharp
public uint NameHash { get; }节点名称的引擎哈希值。
IsEnabledSelf 双端
csharp
public bool IsEnabledSelf { get; }节点自身在调用 DeepEnabled 前记住的启用状态。
IsPaused 双端
csharp
public bool IsPaused { get; set; }节点是否暂停更新。
IsTransformDirty 双端
csharp
public bool IsTransformDirty { get; }当前世界变换是否需要重新计算。
LocalForward 双端
csharp
public Vector3 LocalForward { get; set; }本地空间前方向。
LocalUp 双端
csharp
public Vector3 LocalUp { get; }本地空间上方向。
LocalRight 双端
csharp
public Vector3 LocalRight { get; }本地空间右方向。
Position2D 双端
csharp
public Vector2 Position2D { get; set; }本地空间二维位置、旋转和缩放。
Rotation2D 双端
csharp
public float Rotation2D { get; set; }Scale2D 双端
csharp
public Vector2 Scale2D { get; set; }Transform 双端
csharp
public Matrix4x4 Transform { get; set; }本地和世界空间的完整 3D 变换矩阵。
WorldForward 双端
csharp
public Vector3 WorldForward { get; set; }世界空间前方向。设置时会更新世界旋转。
WorldUp 双端
csharp
public Vector3 WorldUp { get; }世界空间上方向。
WorldRight 双端
csharp
public Vector3 WorldRight { get; }世界空间右方向。
WorldScale 双端
csharp
public Vector3 WorldScale { get; set; }世界空间缩放。
SignedWorldScale 双端
csharp
public Vector3 SignedWorldScale { get; }保留镜像符号的世界空间缩放。
WorldPosition2D 双端
csharp
public Vector2 WorldPosition2D { get; set; }WorldRotation2D 双端
csharp
public float WorldRotation2D { get; set; }WorldScale2D 双端
csharp
public Vector2 WorldScale2D { get; set; }WorldTransform 双端
csharp
public Matrix4x4 WorldTransform { get; }NumComponents 双端
csharp
public uint NumComponents { get; }NumNetworkComponents 双端
csharp
public uint NumNetworkComponents { get; }方法
RemoveObjectAnimation 仅客户端
csharp
public void RemoveObjectAnimation()SetAttributeAnimation 仅客户端
csharp
public void SetAttributeAnimation(string name, ValueAnimation? animation, ObjectAnimationWrapMode wrapMode = ObjectAnimationWrapMode.Loop, float speed = 1f)GetAttributeAnimation 仅客户端
csharp
public ValueAnimation? GetAttributeAnimation(string name)RemoveAttributeAnimation 仅客户端
csharp
public void RemoveAttributeAnimation(string name)GetAttributeAnimationWrapMode 仅客户端
csharp
public ObjectAnimationWrapMode GetAttributeAnimationWrapMode(string name)SetAttributeAnimationWrapMode 仅客户端
csharp
public void SetAttributeAnimationWrapMode(string name, ObjectAnimationWrapMode wrapMode)GetAttributeAnimationSpeed 仅客户端
csharp
public float GetAttributeAnimationSpeed(string name)SetAttributeAnimationSpeed 仅客户端
csharp
public void SetAttributeAnimationSpeed(string name, float speed)GetAttributeAnimationTime 仅客户端
csharp
public float GetAttributeAnimationTime(string name)SetAttributeAnimationTime 仅客户端
csharp
public void SetAttributeAnimationTime(string name, float time)SetAnimationTime 双端
csharp
public void SetAnimationTime(float time)手动设置该节点所有属性动画的时间位置。
GetChildren 双端
csharp
public Node[] GetChildren(bool recursive = false, bool replicatedOnly = false)获取当前节点的子节点快照。默认只返回直接子节点;recursive 为 true 时递归遍历整棵子树。
GetReplicatedChildren 双端
csharp
public Node[] GetReplicatedChildren(bool recursive = false)获取当前节点下的 replicated 子节点快照。
CreateComponent 双端
csharp
public T? CreateComponent<T>(ComponentReplication replication = ComponentReplication.Local) where T : INodeComponent, new()创建组件
返回: 创建的组件
AddComponent 双端
csharp
public void AddComponent<T>(T comp, ComponentReplication replication = ComponentReplication.Local) where T : INodeComponent增加组件
comp— 组件对象replication— 组件同步语义
RemoveComponent 双端
csharp
public void RemoveComponent<T>(T comp) where T : INodeComponent移除组件
comp— 组件对象
GetComponent 双端
csharp
public T? GetComponent<T>() where T : class, INodeComponent获取组件
返回: 组件对象
GetComponents 双端
csharp
public NodeComponentSnapshot[] GetComponents(bool recursive = false, bool replicatedOnly = false)获取当前节点上的组件快照。recursive 为 true 时也包含子树中的组件。
GetReplicatedComponents 双端
csharp
public NodeComponentSnapshot[] GetReplicatedComponents(bool recursive = false)获取当前节点下的 replicated 组件快照。
GetComponentInChildren 双端
csharp
public T? GetComponentInChildren<T>(bool includeSelf = true) where T : class, INodeComponent在本节点及其子树(深度优先)里找首个挂有指定 Component 的实例。
includeSelf— 是否先在本节点上检查;默认true。 传false时跳过本节点,仅从子节点开始查找。
返回: 找到的组件实例;找不到返回 null。
备注
典型用途:从 GameGraph.ResourceSystem.Prefab 实例化产出的树里定位组件 —— prefab 实例化经常产出"PrefabInstance 根 + 子 ArchetypeInstance"的多层结构, 组件挂在子节点上而不是根上。直接在根上调 GetComponent``1 会拿到 null。 想拿组件所在的 Node,访问返回值的 Node 属性。
AddChild 双端
csharp
public void AddChild(Node child, NodeReplication replication = NodeReplication.Local)添加子节点
child— 要添加的子节点replication— 节点同步语义
AddChild 双端
csharp
public void AddChild(Node child, uint index)按底层 Urho 子节点数组索引插入子节点。
CreateChild 双端
csharp
public Node? CreateChild(NodeReplication replication = NodeReplication.Local)创建子节点
返回: 创建的子节点
CreateChild 双端
csharp
public Node? CreateChild(UTF8String name, NodeReplication replication = NodeReplication.Local)创建子节点
name— 子节点名称replication— 节点同步语义
返回: 创建的子节点
CreateChild 双端
csharp
public Node? CreateChild(UTF8String name, NodeReplication replication, uint id, bool temporary = false)使用显式 ID 和 temporary 标记创建子节点。
CreateTemporaryChild 双端
csharp
public Node? CreateTemporaryChild(UTF8String name = default(UTF8String), NodeReplication replication = NodeReplication.Local, uint id = 0u)创建不会保存到场景数据的临时子节点。
RemoveChild 双端
csharp
public void RemoveChild(Node child)移除子节点
child— 要移除的子节点
FindChildByName 双端
csharp
public Node? FindChildByName(UTF8String name, bool recursive)根据名称查找子节点
name— 子节点名称recursive— 是否递归查找
返回: 子节点
FindChildByNameHash 双端
csharp
public Node? FindChildByNameHash(uint nameHash, bool recursive = false)按名称哈希查找子节点。
AddTags 双端
csharp
public void AddTags(UTF8String tags, byte separator = 59)使用指定分隔符批量添加标签。
GetChildrenWithTag 双端
csharp
public Node[] GetChildrenWithTag(UTF8String tag, bool recursive = false)按标签获取子节点。
GetChildrenWithComponent 双端
csharp
public Node[] GetChildrenWithComponent(uint componentTypeHash, bool recursive = false)按组件类型哈希获取子节点。
LookAt 双端
csharp
public bool LookAt(Vector3 target, Vector3? up = null)使节点朝向目标位置(世界空间)
target— 目标位置up— 上方向参考,默认 (0,1,0)
返回: 是否成功
Translate 双端
csharp
public void Translate(Vector3 delta, TransformSpace space = TransformSpace.Local)在指定变换空间内平移节点
Rotate 双端
csharp
public void Rotate(Quaternion delta, TransformSpace space = TransformSpace.Local)在指定变换空间内旋转节点
SetWorldTransform 双端
csharp
public void SetWorldTransform(Vector3 position, Quaternion rotation, Vector3 scale)原子设置世界空间变换(位置+旋转+缩放)
LocalToWorld 双端
csharp
public Vector3 LocalToWorld(Vector3 localPosition)将本地空间坐标转为世界空间坐标
WorldToLocal 双端
csharp
public Vector3 WorldToLocal(Vector3 worldPosition)将世界空间坐标转为本地空间坐标
Clone 双端
csharp
public Node? Clone()深拷贝节点(含组件和子节点)
RemoveAllChildren 双端
csharp
public void RemoveAllChildren()移除所有子节点
RemoveChildren 双端
csharp
public void RemoveChildren(bool removeReplicated, bool removeLocal, bool recursive = true)按 replicated/local 类型选择性移除子节点。
LoadXML 仅客户端
csharp
public bool LoadXML(string resourcePath)从 XML 资源文件加载节点数据(组件、子节点)。 用于加载 LightGroup 等预设,例如 "LightGroup/Daytime.xml"。 资源加载只存在于客户端运行时。
DisposeManaged 双端
csharp
protected override void DisposeManaged()DisposeUnmanaged 双端
csharp
protected override void DisposeUnmanaged(bool finalizing)SetTemporary 双端
csharp
public void SetTemporary(bool enable)ApplyAttributes 双端
csharp
public void ApplyAttributes()ResetAttributesToDefault 双端
csharp
public void ResetAttributesToDefault()RemoveInstanceAttributeDefaults 双端
csharp
public void RemoveInstanceAttributeDefaults()GetInterceptNetworkUpdate 双端
csharp
public bool GetInterceptNetworkUpdate(UTF8String attributeName)SetInterceptNetworkUpdate 双端
csharp
public void SetInterceptNetworkUpdate(UTF8String attributeName, bool enable)SetAttribute 双端
csharp
public bool SetAttribute(uint index, Variant value)SetAttribute 双端
csharp
public bool SetAttribute(UTF8String name, Variant value)GetAttribute 双端
csharp
public Variant GetAttribute(uint index)GetAttribute 双端
csharp
public Variant GetAttribute(UTF8String name)GetAttributeDefault 双端
csharp
public Variant GetAttributeDefault(uint index)GetAttributeDefault 双端
csharp
public Variant GetAttributeDefault(UTF8String name)GetSyncVarType 双端
csharp
public NodeSyncVarType GetSyncVarType(uint key)通过预计算的 Urho StringHash 值获取同步变量的实际类型。
key— UrhoStringHash值,适合生成代码、常量或已缓存 hash 的热路径;不能为 0,也不应当直接使用任意业务数字 id。
返回: 不存在或类型不在 GameGraph 支持范围内时返回 None。
GetSyncVarType 双端
csharp
public NodeSyncVarType GetSyncVarType(string key)通过可读变量名获取同步变量的实际类型,变量名会按 Urho StringHash 规则转换为 hash。
key— 同步变量名,适合普通脚本和业务代码使用;不能为 null 或空字符串。
返回: 不存在或类型不在 GameGraph 支持范围内时返回 None。
HasSyncVar 双端
csharp
public bool HasSyncVar(uint key)当前节点是否包含指定同步变量。
key— UrhoStringHash值,适合生成代码、常量或已缓存 hash 的热路径;不能为 0,也不应当直接使用任意业务数字 id。
HasSyncVar 双端
csharp
public bool HasSyncVar(string key)当前节点是否包含指定同步变量。
key— 同步变量名,适合普通脚本和业务代码使用;不能为 null 或空字符串。
TryGetSyncVar 双端
csharp
public bool TryGetSyncVar(uint key, out int value)通过预计算的 Urho StringHash 值读取整数同步变量。
key— UrhoStringHash值,适合生成代码、常量或已缓存 hash 的热路径;不能为 0,也不应当直接使用任意业务数字 id。value— 读取到的整数值;变量不存在或类型不匹配时为默认值。
返回: 变量存在且类型为整数时返回 true。
TryGetSyncVar 双端
csharp
public bool TryGetSyncVar(string key, out int value)通过可读变量名读取整数同步变量,变量名会按 Urho StringHash 规则转换为 hash。
key— 同步变量名,适合普通脚本和业务代码使用;不能为 null 或空字符串。value— 读取到的整数值;变量不存在或类型不匹配时为默认值。
返回: 变量存在且类型为整数时返回 true。
TryGetSyncVar 双端
csharp
public bool TryGetSyncVar(uint key, out bool value)通过预计算的 Urho StringHash 值读取布尔同步变量。
key— UrhoStringHash值,适合生成代码、常量或已缓存 hash 的热路径;不能为 0,也不应当直接使用任意业务数字 id。value— 读取到的布尔值;变量不存在或类型不匹配时为默认值。
返回: 变量存在且类型为布尔值时返回 true。
TryGetSyncVar 双端
csharp
public bool TryGetSyncVar(string key, out bool value)通过可读变量名读取布尔同步变量,变量名会按 Urho StringHash 规则转换为 hash。
key— 同步变量名,适合普通脚本和业务代码使用;不能为 null 或空字符串。value— 读取到的布尔值;变量不存在或类型不匹配时为默认值。
返回: 变量存在且类型为布尔值时返回 true。
TryGetSyncVar 双端
csharp
public bool TryGetSyncVar(uint key, out float value)通过预计算的 Urho StringHash 值读取浮点同步变量。
key— UrhoStringHash值,适合生成代码、常量或已缓存 hash 的热路径;不能为 0,也不应当直接使用任意业务数字 id。value— 读取到的浮点值;变量不存在或类型不匹配时为默认值。
返回: 变量存在且类型为浮点值时返回 true。
TryGetSyncVar 双端
csharp
public bool TryGetSyncVar(string key, out float value)通过可读变量名读取浮点同步变量,变量名会按 Urho StringHash 规则转换为 hash。
key— 同步变量名,适合普通脚本和业务代码使用;不能为 null 或空字符串。value— 读取到的浮点值;变量不存在或类型不匹配时为默认值。
返回: 变量存在且类型为浮点值时返回 true。
TryGetSyncVar 双端
csharp
public bool TryGetSyncVar(uint key, out string value)通过预计算的 Urho StringHash 值读取字符串同步变量。
key— UrhoStringHash值,适合生成代码、常量或已缓存 hash 的热路径;不能为 0,也不应当直接使用任意业务数字 id。value— 读取到的字符串值;变量不存在或类型不匹配时为空字符串。
返回: 变量存在且类型为字符串时返回 true。
TryGetSyncVar 双端
csharp
public bool TryGetSyncVar(string key, out string value)通过可读变量名读取字符串同步变量,变量名会按 Urho StringHash 规则转换为 hash。
key— 同步变量名,适合普通脚本和业务代码使用;不能为 null 或空字符串。value— 读取到的字符串值;变量不存在或类型不匹配时为空字符串。
返回: 变量存在且类型为字符串时返回 true。
TryGetSyncVar 双端
csharp
public bool TryGetSyncVar(uint key, out Vector2 value)通过预计算的 Urho StringHash 值读取二维向量同步变量。
key— UrhoStringHash值,适合生成代码、常量或已缓存 hash 的热路径;不能为 0,也不应当直接使用任意业务数字 id。value— 读取到的二维向量值;变量不存在或类型不匹配时为默认值。
返回: 变量存在且类型为二维向量时返回 true。
TryGetSyncVar 双端
csharp
public bool TryGetSyncVar(string key, out Vector2 value)通过可读变量名读取二维向量同步变量,变量名会按 Urho StringHash 规则转换为 hash。
key— 同步变量名,适合普通脚本和业务代码使用;不能为 null 或空字符串。value— 读取到的二维向量值;变量不存在或类型不匹配时为默认值。
返回: 变量存在且类型为二维向量时返回 true。
TryGetSyncVar 双端
csharp
public bool TryGetSyncVar(uint key, out Vector3 value)通过预计算的 Urho StringHash 值读取三维向量同步变量。
key— UrhoStringHash值,适合生成代码、常量或已缓存 hash 的热路径;不能为 0,也不应当直接使用任意业务数字 id。value— 读取到的三维向量值;变量不存在或类型不匹配时为默认值。
返回: 变量存在且类型为三维向量时返回 true。
TryGetSyncVar 双端
csharp
public bool TryGetSyncVar(string key, out Vector3 value)通过可读变量名读取三维向量同步变量,变量名会按 Urho StringHash 规则转换为 hash。
key— 同步变量名,适合普通脚本和业务代码使用;不能为 null 或空字符串。value— 读取到的三维向量值;变量不存在或类型不匹配时为默认值。
返回: 变量存在且类型为三维向量时返回 true。
TryGetSyncVar 双端
csharp
public bool TryGetSyncVar(uint key, out Quaternion value)通过预计算的 Urho StringHash 值读取旋转同步变量。
key— UrhoStringHash值,适合生成代码、常量或已缓存 hash 的热路径;不能为 0,也不应当直接使用任意业务数字 id。value— 读取到的旋转值;变量不存在或类型不匹配时为单位旋转。
返回: 变量存在且类型为旋转时返回 true。
TryGetSyncVar 双端
csharp
public bool TryGetSyncVar(string key, out Quaternion value)通过可读变量名读取旋转同步变量,变量名会按 Urho StringHash 规则转换为 hash。
key— 同步变量名,适合普通脚本和业务代码使用;不能为 null 或空字符串。value— 读取到的旋转值;变量不存在或类型不匹配时为单位旋转。
返回: 变量存在且类型为旋转时返回 true。
AddTag 双端
csharp
public void AddTag(string tag)RemoveTag 双端
csharp
public bool RemoveTag(string tag)RemoveAllTags 双端
csharp
public void RemoveAllTags()HasTag 双端
csharp
public bool HasTag(string tag)IsChildOf 双端
csharp
public bool IsChildOf(Node ancestor)返回当前节点是否是指定节点的直接或间接后代。
SetDeepEnabled 双端
csharp
public void SetDeepEnabled(bool enable)临时覆盖自身与所有后代的有效启用状态,同时保留各节点原先的自身状态。
ResetDeepEnabled 双端
csharp
public void ResetDeepEnabled()恢复调用 SetDeepEnabled 前记住的自身启用状态。
SetEnabledRecursive 双端
csharp
public void SetEnabledRecursive(bool enable)覆盖自身与所有后代的自身启用状态。
MarkTransformDirty 双端
csharp
public void MarkTransformDirty()强制当前节点及监听组件重新计算世界变换。
SetLocalTransform 双端
csharp
public void SetLocalTransform(Vector3 position, Quaternion rotation)SetLocalTransform 双端
csharp
public void SetLocalTransform(Vector3 position, Quaternion rotation, float uniformScale)SetLocalTransform 双端
csharp
public void SetLocalTransform(Vector3 position, Quaternion rotation, Vector3 scale)SetWorldTransform 双端
csharp
public void SetWorldTransform(Vector3 position, Quaternion rotation)SetWorldTransform 双端
csharp
public void SetWorldTransform(Vector3 position, Quaternion rotation, float uniformScale)SetWorldTransform 双端
csharp
public void SetWorldTransform(Matrix4x4 transform)SetWorldScale 双端
csharp
public void SetWorldScale(float uniformScale)RotateAround 双端
csharp
public void RotateAround(Vector3 point, Quaternion delta, TransformSpace space = TransformSpace.Local)Translate2D 双端
csharp
public void Translate2D(Vector2 delta, TransformSpace space = TransformSpace.Local)Rotate2D 双端
csharp
public void Rotate2D(float delta, TransformSpace space = TransformSpace.Local)RotateAround2D 双端
csharp
public void RotateAround2D(Vector2 point, float delta, TransformSpace space = TransformSpace.Local)Pitch 双端
csharp
public void Pitch(float angle, TransformSpace space = TransformSpace.Local)Yaw 双端
csharp
public void Yaw(float angle, TransformSpace space = TransformSpace.Local)Roll 双端
csharp
public void Roll(float angle, TransformSpace space = TransformSpace.Local)LookAtInSpace 双端
csharp
public bool LookAtInSpace(Vector3 target, TransformSpace space, Vector3? up = null)LookAtDirection 双端
csharp
public bool LookAtDirection(Vector3 direction, Vector3? up = null)Scale 双端
csharp
public void Scale(float uniformScale)Scale 双端
csharp
public void Scale(Vector3 scale)Scale2DBy 双端
csharp
public void Scale2DBy(Vector2 scale)LocalToWorld 双端
csharp
public Vector3 LocalToWorld(Vector4 localVector)LocalToWorld2D 双端
csharp
public Vector2 LocalToWorld2D(Vector2 localVector)WorldToLocal 双端
csharp
public Vector3 WorldToLocal(Vector4 worldVector)WorldToLocal2D 双端
csharp
public Vector2 WorldToLocal2D(Vector2 worldVector)GetNumChildren 双端
csharp
public uint GetNumChildren(bool recursive = false)HasComponent 双端
csharp
public bool HasComponent(uint componentTypeHash)HasComponent 双端
csharp
public bool HasComponent(UTF8String componentTypeName)GetParentComponent 双端
csharp
public T? GetParentComponent<T>(bool fullTraversal = false) where T : class, INodeComponentReorderComponent 双端
csharp
public void ReorderComponent<T>(T component, uint index) where T : INodeComponentGetAttributeInfo 双端
csharp
public SerializableAttributeInfo GetAttributeInfo(uint index)SetSyncVar 仅服务端
csharp
public void SetSyncVar(uint key, int value)设置轻量同步整数变量。仅服务器端可写,且只有 replicated node 会通过 Urho replication 同步给客户端。
key— UrhoStringHash值,适合生成代码、常量或已缓存 hash 的热路径;不能为 0,也不应当直接使用任意业务数字 id。value— 要同步的整数值。
SetSyncVar 仅服务端
csharp
public void SetSyncVar(string key, int value)设置轻量同步整数变量。仅服务器端可写,且只有 replicated node 会通过 Urho replication 同步给客户端。
key— 同步变量名,适合普通脚本和业务代码使用;不能为 null 或空字符串,内部会按 UrhoStringHash规则转换为 hash。value— 要同步的整数值。
SetSyncVar 仅服务端
csharp
public void SetSyncVar(uint key, bool value)设置轻量同步布尔变量。仅服务器端可写,且只有 replicated node 会通过 Urho replication 同步给客户端。
key— UrhoStringHash值,适合生成代码、常量或已缓存 hash 的热路径;不能为 0,也不应当直接使用任意业务数字 id。value— 要同步的布尔值。
SetSyncVar 仅服务端
csharp
public void SetSyncVar(string key, bool value)设置轻量同步布尔变量。仅服务器端可写,且只有 replicated node 会通过 Urho replication 同步给客户端。
key— 同步变量名,适合普通脚本和业务代码使用;不能为 null 或空字符串,内部会按 UrhoStringHash规则转换为 hash。value— 要同步的布尔值。
SetSyncVar 仅服务端
csharp
public void SetSyncVar(uint key, float value)设置轻量同步浮点变量。仅服务器端可写,且只有 replicated node 会通过 Urho replication 同步给客户端。
key— UrhoStringHash值,适合生成代码、常量或已缓存 hash 的热路径;不能为 0,也不应当直接使用任意业务数字 id。value— 要同步的浮点值。
SetSyncVar 仅服务端
csharp
public void SetSyncVar(string key, float value)设置轻量同步浮点变量。仅服务器端可写,且只有 replicated node 会通过 Urho replication 同步给客户端。
key— 同步变量名,适合普通脚本和业务代码使用;不能为 null 或空字符串,内部会按 UrhoStringHash规则转换为 hash。value— 要同步的浮点值。
SetSyncVar 仅服务端
csharp
public void SetSyncVar(uint key, string value)设置轻量同步字符串变量。仅服务器端可写,且只有 replicated node 会通过 Urho replication 同步给客户端。
key— UrhoStringHash值,适合生成代码、常量或已缓存 hash 的热路径;不能为 0,也不应当直接使用任意业务数字 id。value— 要同步的字符串值;null 会按空字符串写入。
SetSyncVar 仅服务端
csharp
public void SetSyncVar(string key, string value)设置轻量同步字符串变量。仅服务器端可写,且只有 replicated node 会通过 Urho replication 同步给客户端。
key— 同步变量名,适合普通脚本和业务代码使用;不能为 null 或空字符串,内部会按 UrhoStringHash规则转换为 hash。value— 要同步的字符串值;null 会按空字符串写入。
SetSyncVar 仅服务端
csharp
public void SetSyncVar(uint key, Vector2 value)设置轻量同步二维向量变量。仅服务器端可写,且只有 replicated node 会通过 Urho replication 同步给客户端。
key— UrhoStringHash值,适合生成代码、常量或已缓存 hash 的热路径;不能为 0,也不应当直接使用任意业务数字 id。value— 要同步的二维向量值。
SetSyncVar 仅服务端
csharp
public void SetSyncVar(string key, Vector2 value)设置轻量同步二维向量变量。仅服务器端可写,且只有 replicated node 会通过 Urho replication 同步给客户端。
key— 同步变量名,适合普通脚本和业务代码使用;不能为 null 或空字符串,内部会按 UrhoStringHash规则转换为 hash。value— 要同步的二维向量值。
SetSyncVar 仅服务端
csharp
public void SetSyncVar(uint key, Vector3 value)设置轻量同步三维向量变量。仅服务器端可写,且只有 replicated node 会通过 Urho replication 同步给客户端。
key— UrhoStringHash值,适合生成代码、常量或已缓存 hash 的热路径;不能为 0,也不应当直接使用任意业务数字 id。value— 要同步的三维向量值。
SetSyncVar 仅服务端
csharp
public void SetSyncVar(string key, Vector3 value)设置轻量同步三维向量变量。仅服务器端可写,且只有 replicated node 会通过 Urho replication 同步给客户端。
key— 同步变量名,适合普通脚本和业务代码使用;不能为 null 或空字符串,内部会按 UrhoStringHash规则转换为 hash。value— 要同步的三维向量值。
SetSyncVar 仅服务端
csharp
public void SetSyncVar(uint key, Quaternion value)设置轻量同步旋转变量。仅服务器端可写,且只有 replicated node 会通过 Urho replication 同步给客户端。
key— UrhoStringHash值,适合生成代码、常量或已缓存 hash 的热路径;不能为 0,也不应当直接使用任意业务数字 id。value— 要同步的旋转值。
SetSyncVar 仅服务端
csharp
public void SetSyncVar(string key, Quaternion value)设置轻量同步旋转变量。仅服务器端可写,且只有 replicated node 会通过 Urho replication 同步给客户端。
key— 同步变量名,适合普通脚本和业务代码使用;不能为 null 或空字符串,内部会按 UrhoStringHash规则转换为 hash。value— 要同步的旋转值。
事件
OnCollisionBegin2D 双端
csharp
public event Action<CollisionContact2D>? OnCollisionBegin2D当2D物理碰撞开始时触发的事件。
备注
订阅此事件会自动启用碰撞开始事件的监听,取消所有订阅会自动禁用监听。
OnCollisionPreSolve2D 双端
csharp
public event CollisionPreSolve2DDelegate? OnCollisionPreSolve2D当2D物理碰撞进入预求解阶段时触发的事件。
备注
此事件在碰撞响应计算之前触发,可以通过设置 isActive 参数为 false 来禁用此次碰撞响应。 订阅此事件会自动启用碰撞更新事件的监听,取消所有订阅会自动禁用监听。
OnCollisionEnd2D 双端
csharp
public event Action<CollisionContact2D>? OnCollisionEnd2D当2D物理碰撞结束时触发的事件。
备注
订阅此事件会自动启用碰撞结束事件的监听,取消所有订阅会自动禁用监听。
OnCollisionBegin 双端
csharp
public event Action<CollisionContact>? OnCollisionBegin当3D物理碰撞开始时触发的事件。
备注
提供完整的碰撞接触信息,包括接触点位置、法线方向、穿透深度和碰撞冲量。 订阅此事件会自动启用碰撞开始事件的监听,取消所有订阅会自动禁用监听。
OnCollisionStay 双端
csharp
public event Action<CollisionContact>? OnCollisionStay当3D物理碰撞持续时每物理帧触发的事件。
备注
订阅此事件会自动启用碰撞持续事件的监听,取消所有订阅会自动禁用监听。
OnCollisionEnd 双端
csharp
public event Action<CollisionContact>? OnCollisionEnd当3D物理碰撞结束时触发的事件。
备注
碰撞结束事件不包含接触点信息(ContactPoints 为 null)。 订阅此事件会自动启用碰撞结束事件的监听,取消所有订阅会自动禁用监听。
NodeReplication 双端
命名空间 GameGraph.NodeSystem
csharp
public enum NodeReplication枚举值
InheritLocalReplicated
NodeSyncVarType 双端
命名空间 GameGraph.NodeSystem
csharp
public enum NodeSyncVarTypeNode 同步变量类型,对应 Urho VariantType 中允许作为 GameGraph sync var 的子集。
枚举值
None = 0Int = 1Bool = 2Float = 3Vector2 = 4Vector3 = 5Quaternion = 7String = 9
PhysicalCharacterMovement 双端
命名空间 GameGraph.NodeSystem
csharp
public sealed class PhysicalCharacterMovementA Unit-level handle for physics character movement.
属性
Unit 双端
csharp
public Unit Unit { get; }Binding 双端
csharp
public UnitNodeBinding Binding { get; }Node 双端
csharp
public Node Node { get; }Motor 双端
csharp
public KinematicCharacterMotor Motor { get; }IsActive 双端
csharp
public bool IsActive { get; }Whether this physical character is currently the movement authority for the Unit.
IsGrounded 双端
csharp
public bool IsGrounded { get; }Velocity 双端
csharp
public Vector3 Velocity { get; }方法
Activate 双端
csharp
public void Activate()Let the physics character node drive the Unit transform and server vector movement route.
Deactivate 双端
csharp
public void Deactivate(bool syncUnitPosition = true)Stop the physics character and return Unit transform authority to the Unit.
Move 双端
csharp
public void Move(Vector3 desiredVelocity)Stop 双端
csharp
public void Stop()Jump 双端
csharp
public void Jump(float launchSpeed)Warp 双端
csharp
public void Warp(Vector3 position)PhysicalCharacterMovementExtensions 双端
命名空间 GameGraph.NodeSystem
csharp
public static class PhysicalCharacterMovementExtensions方法
UsePhysicalCharacterMovement 双端
csharp
public static PhysicalCharacterMovement UsePhysicalCharacterMovement(this Unit unit, PhysicalCharacterMovementOptions? options = null)Enables physics character movement for this Unit and routes vector movement through a Node-driven character capsule.
GetPhysicalCharacterMovement 双端
csharp
public static PhysicalCharacterMovement? GetPhysicalCharacterMovement(this Unit unit, string? key = null)Gets the physics character movement handle for this Unit, if one has been configured.
DisablePhysicalCharacterMovement 双端
csharp
public static bool DisablePhysicalCharacterMovement(this Unit unit, string? key = null, bool destroyNode = true)Disables physics character movement and optionally destroys the owned binding node.
ActivatePhysicalCharacterMovement 双端
csharp
public static PhysicalCharacterMovement ActivatePhysicalCharacterMovement(this Unit unit, string? key = null)Activates the configured physical character movement, creating it with default options when missing.
DeactivatePhysicalCharacterMovement 双端
csharp
public static bool DeactivatePhysicalCharacterMovement(this Unit unit, string? key = null, bool syncUnitPosition = true)Deactivates the configured physical character movement without destroying its node or motor.
PhysicalCharacterMovementOptions 双端
命名空间 GameGraph.NodeSystem
csharp
public sealed class PhysicalCharacterMovementOptionsConfigures a Unit to be driven by a physics character node.
构造函数
PhysicalCharacterMovementOptions 双端
csharp
public PhysicalCharacterMovementOptions()属性
Key 双端
csharp
public string? Key { get; set; }Optional binding key. Use this only when one Unit needs multiple physical character bindings.
Radius 双端
csharp
public float Radius { get; set; }Capsule radius in scene units.
Height 双端
csharp
public float Height { get; set; }Capsule total height in scene units.
StepHeight 双端
csharp
public float StepHeight { get; set; }Maximum step height the character can climb.
MaxSlopeDegrees 双端
csharp
public float MaxSlopeDegrees { get; set; }Maximum walkable slope angle in degrees.
Gravity 双端
csharp
public Vector3? Gravity { get; set; }Optional custom gravity. When null, the motor follows the scene physics world's gravity.
CollisionLayer 双端
csharp
public uint CollisionLayer { get; set; }Collision layer used by the character capsule.
CollisionMask 双端
csharp
public uint CollisionMask { get; set; }Collision mask used by the character capsule.
UseCharacterCollisionRoles 双端
csharp
public bool UseCharacterCollisionRoles { get; set; }When enabled, the native character motor uses static collider role metadata to choose ground and blockers. Defaults to legacy behavior while role metadata is being validated.
LocalOffset 双端
csharp
public Vector3 LocalOffset { get; set; }Local offset from the Unit transform to the physics character node. Defaults to half capsule height on Z, so the Unit origin stays at the character feet.
LocalRotation 双端
csharp
public Quaternion LocalRotation { get; set; }Local rotation from the Unit transform to the physics character node.
Replication 双端
csharp
public NodeReplication Replication { get; set; }Replication mode for the binding node. Replicated is recommended for gameplay Units.
PlaneClippingBody 双端
命名空间 GameGraph.NodeSystem
csharp
public class PlaneClippingBody : EngineNodeComponentPlaneClippingShape 双端
命名空间 GameGraph.NodeSystem
csharp
public class PlaneClippingShape : EngineNodeComponent方法
SetCircle 双端
csharp
public void SetCircle(Vector3 center, float radius)设置圆形裁剪
center— 圆形中心点radius— 半径
SetRect 双端
csharp
public void SetRect(Vector3 min, Vector3 max)设置矩形裁剪
min— 矩形最小位置max— 矩形最大位置
PropertyObjectSceneGraphBinding 仅服务端
命名空间 GameGraph.NodeSystem
csharp
public static class PropertyObjectSceneGraphBinding把 PropertyObject 绑定到 SceneGraph 的便捷扩展。
备注
绑定后,PropertyObject(底层 LightUnit)的复制受众会与该场景当前订阅集求交: 孤立发布图 => 与该图 Player) 的玩家集求交; SCE 场景下钻图 => 与「当前 Scene == 该场景」的玩家集求交。 配合位置走 node(客户端原生平滑)、数据走 PropertyObject(按 SyncType 分级), 实现「数据不会发给没有该 node 的客户端」。仅服务端可用。
方法
BindToSceneGraph 仅服务端
csharp
public static void BindToSceneGraph(this PropertyObject propertyObject, SceneGraph sceneGraph)把 PropertyObject 绑定到指定 SceneGraph(孤立发布图或 SCE 场景下钻图皆可)。
备注
推荐的无竞态创建姿势(避免本体闪现给非订阅者): var data = new PropertyObject(player, SyncType.None); // ① None 创建:本体 appear 受众为空集 data.BindToSceneGraph(graph); // ② 绑定 graph.Publish(player1); // ③ 发布给目标玩家 data.SetSyncType(SyncType.All); // ④ 放开 SyncType:受众 = All ∩ {player1} 之所以这样:本体存在性 + 初始快照走 appear 分发,其受众在「创建那一刻」即定。若以目标 SyncType 直接创建, 创建瞬间(尚未绑定)会把本体发给 SyncType 全体,下一 tick 才由场景订阅集收窄、对非订阅者补发消失—— 存在一次闪现抖动。以 None 创建则本体一开始就不发给任何人,待绑定+发布就位后再放开,全程对非订阅者不可见。 绑定后受众的后续变化(Publish/Unpublish/UnbindSceneGraph)由服务端每 tick 自动对账: 新纳入受众回补 appear(含当前快照),移出受众发消失,无需手动调用。
UnbindSceneGraph 仅服务端
csharp
public static void UnbindSceneGraph(this PropertyObject propertyObject)解除场景绑定,恢复纯 SyncType 受众。
Renderer 仅客户端
命名空间 GameGraph.NodeSystem
csharp
public static class RendererUrho3D Renderer 子系统的静态封装,管理视口(Viewport)
属性
IsEditorDebugViewportActive 仅客户端
csharp
public static bool IsEditorDebugViewportActive { get; }当前游戏主视口是否渲染到编辑器内嵌调试画布。 该画布在线性颜色空间中渲染,由编辑器 UI 完成最终 Gamma 转换; 独立客户端返回 false,即使它由编辑器启动。
NumViewports 仅客户端
csharp
public static uint NumViewports { get; set; }获取或设置视口数量
DefaultRenderPath 仅客户端
csharp
public static RenderPath? DefaultRenderPath { get; set; }HDRRendering 仅客户端
csharp
public static bool HDRRendering { get; set; }SpecularLighting 仅客户端
csharp
public static bool SpecularLighting { get; set; }TextureAnisotropy 仅客户端
csharp
public static int TextureAnisotropy { get; set; }TextureFilterMode 仅客户端
csharp
public static TextureFilterMode TextureFilterMode { get; set; }TextureQuality 仅客户端
csharp
public static MaterialQuality TextureQuality { get; set; }MaterialQuality 仅客户端
csharp
public static MaterialQuality MaterialQuality { get; set; }DrawShadows 仅客户端
csharp
public static bool DrawShadows { get; set; }ShadowMapSize 仅客户端
csharp
public static int ShadowMapSize { get; set; }ShadowQuality 仅客户端
csharp
public static ShadowQuality ShadowQuality { get; set; }ShadowSoftness 仅客户端
csharp
public static float ShadowSoftness { get; set; }VSMShadowParameters 仅客户端
csharp
public static Vector2 VSMShadowParameters { get; set; }VSMMultiSample 仅客户端
csharp
public static int VSMMultiSample { get; set; }ReuseShadowMaps 仅客户端
csharp
public static bool ReuseShadowMaps { get; set; }MaxShadowMaps 仅客户端
csharp
public static int MaxShadowMaps { get; set; }DynamicInstancing 仅客户端
csharp
public static bool DynamicInstancing { get; set; }NumExtraInstancingBufferElements 仅客户端
csharp
public static int NumExtraInstancingBufferElements { get; set; }MinInstances 仅客户端
csharp
public static int MinInstances { get; set; }MaxSortedInstances 仅客户端
csharp
public static int MaxSortedInstances { get; set; }MaxOccluderTriangles 仅客户端
csharp
public static int MaxOccluderTriangles { get; set; }OcclusionBufferSize 仅客户端
csharp
public static int OcclusionBufferSize { get; set; }OccluderSizeThreshold 仅客户端
csharp
public static float OccluderSizeThreshold { get; set; }ThreadedOcclusion 仅客户端
csharp
public static bool ThreadedOcclusion { get; set; }MobileShadowBiasMul 仅客户端
csharp
public static float MobileShadowBiasMul { get; set; }MobileShadowBiasAdd 仅客户端
csharp
public static float MobileShadowBiasAdd { get; set; }MobileNormalOffsetMul 仅客户端
csharp
public static float MobileNormalOffsetMul { get; set; }NumViews 仅客户端
csharp
public static uint NumViews { get; }NumPrimitives 仅客户端
csharp
public static uint NumPrimitives { get; }NumBatches 仅客户端
csharp
public static uint NumBatches { get; }DefaultMaterial 仅客户端
csharp
public static Material? DefaultMaterial { get; }DefaultZone 仅客户端
csharp
public static Zone? DefaultZone { get; }方法
CreateViewport 仅客户端
csharp
public static Viewport CreateViewport(SceneGraph scene, CameraComponent camera)创建一个新的 Viewport,绑定指定场景和摄像机
SetViewport 仅客户端
csharp
public static void SetViewport(uint index, Viewport? viewport)设置指定索引处的视口。索引 0 是主视口。 编辑器内调试模式下,此方法会写入游戏画布对应的 RenderTarget surface,而不是编辑器窗口 backbuffer。 因此附加 viewport 的 Int32) 坐标以游戏画布/RenderTarget 为基准。 附加 viewport 不保证在编辑器内嵌调试和独立客户端中获得相同的默认 RenderPath; 设置前应先调用 UTF8String) 明确雾效和后处理行为。
GetViewport 仅客户端
csharp
public static Viewport? GetViewport(uint index)获取指定索引处的视口。 编辑器内调试模式下返回游戏画布 RenderTarget surface 上的 viewport。
GetOccupiedViewportIndices 仅客户端
csharp
public static IReadOnlyList<uint> GetOccupiedViewportIndices()获取当前已占用的 viewport 编号。 编辑器内调试模式下统计的是游戏画布 RenderTarget surface 上的 viewport 编号。
GetNextFreeViewportIndex 仅客户端
csharp
public static uint GetNextFreeViewportIndex(uint startIndex = 1u)获取下一个未占用的 viewport 编号。 默认从 1 开始查找,避免占用主视口 0;需要包含主视口时传入 0。
SetupMainViewport 仅客户端
csharp
public static void SetupMainViewport(SceneGraph scene, CameraComponent camera)配置主视口的场景和摄像机。 自动适配独立游戏模式和编辑器内调试模式:
- 独立游戏:创建 Viewport 并设置到 Renderer 索引 0
- 编辑器内:将 Scene/Camera 设置到编辑器管理的游戏视口上 对于 GameGraph 纯 3D 游戏,推荐使用此方法替代手动 CreateViewport + SetViewport。
备注
本方法不设置 renderpath——视口承接的渲染管线(SSAO、雾效、Deferred vs Forward 等) 由底层默认值决定。编辑器内嵌调试通常使用默认不呈现场景雾效的 EditorMapSSAOBloomHDR.xml,独立客户端通常使用会呈现雾效的 CEMapSSAO.xml; 因此编辑器内看到的效果不能直接代表客户端。调用本方法后应紧接着通过 GetMainViewport().SetRenderPath(...) 明确渲染管线,详见 UTF8String)。
GetMainViewport 仅客户端
csharp
public static Viewport? GetMainViewport()取主视口。编辑器模式拿 GamePlayInEditor 管理的游戏视口,独立模式拿 Renderer 索引 0 视口。 与 CameraComponent) 的视口选择逻辑镜像 —— UInt32)(0) 编辑器模式下同样会返回 GamePlayInEditor 管理的游戏视口。
返回: 主视口对象;不存在时返回 null
备注
典型用法:CameraComponent) 之后调用本方法拿 viewport,再调 UTF8String) 指定渲染管线(启用 SSAO / Bloom / HDR 等后处理)。
SetDefaultRenderPath 仅客户端
csharp
public static bool SetDefaultRenderPath(UTF8String path)GetNumGeometries 仅客户端
csharp
public static uint GetNumGeometries(bool allViews = false)GetNumLights 仅客户端
csharp
public static uint GetNumLights(bool allViews = false)GetNumShadowMaps 仅客户端
csharp
public static uint GetNumShadowMaps(bool allViews = false)GetNumOccluders 仅客户端
csharp
public static uint GetNumOccluders(bool allViews = false)GetNumDrawTagPrimitives 仅客户端
csharp
public static uint GetNumDrawTagPrimitives(DrawTag drawTag)GetNumDrawTagBatches 仅客户端
csharp
public static uint GetNumDrawTagBatches(DrawTag drawTag)GetViewportForScene 仅客户端
csharp
public static Viewport? GetViewportForScene(SceneGraph scene, uint index = 0u)ReloadShaders 仅客户端
csharp
public static void ReloadShaders()DrawDebugGeometry 仅客户端
csharp
public static void DrawDebugGeometry(bool depthTest = true)SceneBuiltinNodeExtensions 双端
命名空间 GameGraph.NodeSystem
csharp
public static class SceneBuiltinNodeExtensionsSCE 场景内置节点访问扩展。
备注
这些扩展方法以 Scene 为入口,是因为 SCE 场景加载流程会为 Scene 对应的底层 SceneGraph 创建固定命名的内置节点;普通 SceneGraph 则不保证存在这些节点。 在场景尚未加载完成、当前不是 SCE 场景或运行端没有对应对象时,相关 API 会返回 null 或 false。
方法
GetBuiltinNode 双端
csharp
public static Node? GetBuiltinNode(this Scene scene, SceneBuiltinNodeKind kind)获取指定类型的 SCE 场景内置节点。
scene— SCE 场景。kind— 要获取的内置节点类型。
返回: 找到的节点;场景尚未加载、当前运行端没有该节点或节点类型不适用时返回 null。
TryGetBuiltinNode 双端
csharp
public static bool TryGetBuiltinNode(this Scene scene, SceneBuiltinNodeKind kind, out Node? node)尝试获取指定类型的 SCE 场景内置节点。
scene— SCE 场景。kind— 要获取的内置节点类型。node— 找到的节点;未找到时为null。
返回: 找到节点时返回 true;否则返回 false。
GetBuiltinNodes 双端
csharp
public static Node[] GetBuiltinNodes(this Scene scene, SceneBuiltinNodeKind kind)获取指定类型的 SCE 场景内置节点快照。
scene— SCE 场景。kind— 要获取的内置节点类型。
返回: 指定类型的内置节点快照;没有节点时返回空数组。
备注
第一阶段多数 kind 返回 0 或 1 个入口节点;该 API 为后续一个 kind 映射多个内置节点 (例如多套天气或多组灯光)预留稳定形态。
TryGetTerrainNode 双端
csharp
public static Node? TryGetTerrainNode(this Scene scene)尝试获取当前 SCE 场景的地形根节点。
返回: 找到地形根节点时返回该节点;否则返回 null。
TryGetTerrainNode 双端
csharp
public static bool TryGetTerrainNode(this Scene scene, out Node? node)尝试获取当前 SCE 场景的地形根节点。
scene— SCE 场景。node— 找到的地形根节点;未找到时为null。
返回: 找到地形根节点时返回 true;否则返回 false。
TryGetWeatherNode 双端
csharp
public static Node? TryGetWeatherNode(this Scene scene)尝试获取当前 SCE 场景的天气/雾效入口节点。
返回: 找到天气/雾效入口节点时返回该节点;否则返回 null。
备注
当前优先返回名为 Weather 的内置节点,找不到时回退到 LightGroup。普通 SceneGraph 不保证存在这些固定节点。
TryGetWeatherNode 双端
csharp
public static bool TryGetWeatherNode(this Scene scene, out Node? node)尝试获取当前 SCE 场景的天气/雾效入口节点。
scene— SCE 场景。node— 找到的天气/雾效入口节点;未找到时为null。
返回: 找到天气/雾效入口节点时返回 true;否则返回 false。
TryGetLightingNode 双端
csharp
public static Node? TryGetLightingNode(this Scene scene)尝试获取当前 SCE 场景的光照入口节点。
返回: 找到光照入口节点时返回该节点;否则返回 null。
备注
当前优先返回 LightGroup,找不到时回退到默认 DirectionalLight。普通 SceneGraph 不保证存在这些固定节点。
TryGetLightingNode 双端
csharp
public static bool TryGetLightingNode(this Scene scene, out Node? node)尝试获取当前 SCE 场景的光照入口节点。
scene— SCE 场景。node— 找到的光照入口节点;未找到时为null。
返回: 找到光照入口节点时返回 true;否则返回 false。
TryGetTerrainController 双端
csharp
public static SceneTerrainController? TryGetTerrainController(this Scene scene)尝试获取当前 SCE 场景的地形控制器。
返回: 找到地形根节点时返回控制器;否则返回 null。
TryGetTerrainController 双端
csharp
public static bool TryGetTerrainController(this Scene scene, out SceneTerrainController? controller)尝试获取当前 SCE 场景的地形控制器。
scene— SCE 场景。controller— 找到的地形控制器;未找到时为null。
返回: 找到地形控制器时返回 true;否则返回 false。
TryGetWeatherController 仅客户端
csharp
public static SceneWeatherController? TryGetWeatherController(this Scene scene)尝试获取当前 SCE 场景的天气/雾效控制器。
返回: 找到天气/雾效入口节点时返回控制器;否则返回 null。
备注
控制器只在客户端公开,所有修改都是 runtime-only、client-only,不会同步服务器或写回地图资源。
TryGetWeatherController 仅客户端
csharp
public static bool TryGetWeatherController(this Scene scene, out SceneWeatherController? controller)尝试获取当前 SCE 场景的天气/雾效控制器。
scene— SCE 场景。controller— 找到的天气/雾效控制器;未找到时为null。
返回: 找到天气/雾效控制器时返回 true;否则返回 false。
TryGetLightingController 仅客户端
csharp
public static SceneLightingController? TryGetLightingController(this Scene scene)尝试获取当前 SCE 场景的光照控制器。
返回: 找到光照入口节点时返回控制器;否则返回 null。
备注
控制器只在客户端公开,所有修改都是 runtime-only、client-only,不会同步服务器或写回地图资源。
TryGetLightingController 仅客户端
csharp
public static bool TryGetLightingController(this Scene scene, out SceneLightingController? controller)尝试获取当前 SCE 场景的光照控制器。
scene— SCE 场景。controller— 找到的光照控制器;未找到时为null。
返回: 找到光照控制器时返回 true;否则返回 false。
SceneBuiltinNodeKind 双端
命名空间 GameGraph.NodeSystem
csharp
public enum SceneBuiltinNodeKindSCE 场景内置节点类型。
备注
这些类型只描述由 SCE 地图/场景加载流程创建的内置节点,不描述脚本手动创建的普通 SceneGraph。普通 SceneGraph 可能没有这些节点。
枚举值
SceneGraphRoot— 底层 Urho Scene 根节点。SyncRoot— 当前 SCE 场景的同步挂载根,等价于 。DynamicRoot— 客户端动态对象根节点,承载 Actor/Unit 表现层节点。SceneRoot— 当前 SCE 场景组根节点,承载地图静态内容根和动态对象根。BuiltSceneRoot— 地图构建出的静态内容根节点,当前 native 名称为 "BUILT_SCENE"。Terrain— 地形根节点,当前 native 名称为 "SCE_TERRAIN"。LightGroup— 光照组节点,当前 native 名称为 "LightGroup"。Lighting— 场景光照入口。当前优先返回 ,回退到默认 DirectionalLight。Weather— 场景天气/雾效入口。当前天气参数挂在 LightGroup/Zone/Light 和地形数据上,因此优先返回 LightGroup。PointLights— 点光源集合根节点,当前 native 名称为 "PointLights"。DirectionalLight— 默认方向光节点,当前 native 名称为 "DirectionalLight"。
SceneEnvironmentMapSize 仅客户端
命名空间 GameGraph.NodeSystem
csharp
public readonly struct SceneEnvironmentMapSize : IEquatable<SceneEnvironmentMapSize>地图型环境贴图或迷雾贴图的像素尺寸。
Width— 贴图宽度。Height— 贴图高度。
构造函数
SceneEnvironmentMapSize 仅客户端
csharp
public SceneEnvironmentMapSize(int Width, int Height)地图型环境贴图或迷雾贴图的像素尺寸。
Width— 贴图宽度。Height— 贴图高度。
属性
Width 仅客户端
csharp
public int Width { get; init; }贴图宽度。
Height 仅客户端
csharp
public int Height { get; init; }贴图高度。
方法
ToString 仅客户端
csharp
public override string ToString()operator != 仅客户端
csharp
public static bool operator !=(SceneEnvironmentMapSize left, SceneEnvironmentMapSize right)operator == 仅客户端
csharp
public static bool operator ==(SceneEnvironmentMapSize left, SceneEnvironmentMapSize right)GetHashCode 仅客户端
csharp
public override int GetHashCode()Equals 仅客户端
csharp
public override bool Equals(object obj)Equals 仅客户端
csharp
public bool Equals(SceneEnvironmentMapSize other)Deconstruct 仅客户端
csharp
public void Deconstruct(out int Width, out int Height)SceneFogOfWarSettings 仅客户端
命名空间 GameGraph.NodeSystem
csharp
public readonly struct SceneFogOfWarSettings : IEquatable<SceneFogOfWarSettings>SCE 场景战争迷雾的运行时渲染参数快照。
Blend— 战争迷雾层混合系数。OpenSpeed— 迷雾打开速度。Brightness— 迷雾亮度。FogColor— 迷雾颜色。RangeColor— 迷雾边缘范围颜色。
备注
该类型只描述当前客户端 TerrainData 战争迷雾的显示参数。战争迷雾权重、刷新和开关 均属于本地运行时视觉控制,不会自动作为玩法视野同步。
构造函数
SceneFogOfWarSettings 仅客户端
csharp
public SceneFogOfWarSettings(float Blend, float OpenSpeed, float Brightness, Color FogColor, Color RangeColor)SCE 场景战争迷雾的运行时渲染参数快照。
Blend— 战争迷雾层混合系数。OpenSpeed— 迷雾打开速度。Brightness— 迷雾亮度。FogColor— 迷雾颜色。RangeColor— 迷雾边缘范围颜色。
备注
该类型只描述当前客户端 TerrainData 战争迷雾的显示参数。战争迷雾权重、刷新和开关 均属于本地运行时视觉控制,不会自动作为玩法视野同步。
属性
Blend 仅客户端
csharp
public float Blend { get; init; }战争迷雾层混合系数。
OpenSpeed 仅客户端
csharp
public float OpenSpeed { get; init; }迷雾打开速度。
Brightness 仅客户端
csharp
public float Brightness { get; init; }迷雾亮度。
FogColor 仅客户端
csharp
public Color FogColor { get; init; }迷雾颜色。
RangeColor 仅客户端
csharp
public Color RangeColor { get; init; }迷雾边缘范围颜色。
方法
ToString 仅客户端
csharp
public override string ToString()operator != 仅客户端
csharp
public static bool operator !=(SceneFogOfWarSettings left, SceneFogOfWarSettings right)operator == 仅客户端
csharp
public static bool operator ==(SceneFogOfWarSettings left, SceneFogOfWarSettings right)GetHashCode 仅客户端
csharp
public override int GetHashCode()Equals 仅客户端
csharp
public override bool Equals(object obj)Equals 仅客户端
csharp
public bool Equals(SceneFogOfWarSettings other)Deconstruct 仅客户端
csharp
public void Deconstruct(out float Blend, out float OpenSpeed, out float Brightness, out Color FogColor, out Color RangeColor)SceneGraph 双端
命名空间 GameGraph.NodeSystem
csharp
public sealed class SceneGraph : EngineObject场景图,管理场景中的节点,相当于Urho3D的Scene。 用于渲染的 SceneGraph 必须包含 Octree 组件(Urho3D 渲染器依赖 Octree 索引 Drawable)。 构造时通过 createOctree 参数控制是否自动创建,也可以后续调用 EnsureOctree()。
构造函数
SceneGraph 双端
csharp
public SceneGraph(SceneGraphReplication replication = SceneGraphReplication.Local, bool createOctree = true)创建新的场景图。
createOctree— 是否自动创建渲染必需的场景级组件。默认 true,会创建 Octree(场景空间索引) 和骨骼蒙皮所需的内部组件。仅客户端渲染用:服务端这些组件是 no-op(不渲染), 不影响玩法——服务端的空间查询走 PhysicsWorld 物理 / 服务端 World3D 碰撞 / 单位系统,均不依赖此 Octree。replication— 场景图同步语义。默认 local,不参与网络同步;ReplicatedUnpublished 表示可发布但尚未发布给客户端。
SceneGraph 双端
csharp
public SceneGraph(bool createOctree)属性
AnimationEnabled 双端
csharp
public bool AnimationEnabled { get; set; }是否自动更新该场景图已配置的属性动画。
RootNode 双端
csharp
public Node? RootNode { get; }真实 Urho Scene 根节点。对它添加子节点等价于操作底层 Scene 根。
SceneGraphId 双端
csharp
public int SceneGraphId { get; }服务端发布给客户端时使用的 SceneGraph 路由 ID。Local 场景图固定为 0。
IsReplicated 双端
csharp
public bool IsReplicated { get; }该 SceneGraph 是否按 GameGraph replicated 语义运行。
TransformSmoothingConstant 双端
csharp
public float TransformSmoothingConstant { get; set; }Replicated transform 的视觉平滑常量。值越大越快接近最新同步目标;Urho 默认值为 50。 该设置属于底层 Scene,本身不会作为网络状态同步;通常应在客户端图注册后配置。
TransformSnapThreshold 双端
csharp
public float TransformSnapThreshold { get; set; }Replicated transform 平滑的瞬移阈值。当前位置与最新同步目标距离超过该值时直接贴合目标; Urho 默认值为 5。该设置属于底层 Scene,本身不会作为网络状态同步。
Navigation 双端
csharp
public SceneNavigation? Navigation { get; }获取当前 SceneGraph 绑定的 SCE 场景导航查询接口。
备注
只有服务端、并且该 SceneGraph 来自已加载 Nav3D 的 SCE 场景时才会返回实例。 客户端、脚本独立创建的 SceneGraph、或未加载导航数据的场景返回 null。
IsUpdateEnabled 双端
csharp
public bool IsUpdateEnabled { get; set; }是否允许场景执行常规更新。
TimeScale 双端
csharp
public float TimeScale { get; set; }场景更新时间缩放。
ElapsedTime 双端
csharp
public float ElapsedTime { get; set; }场景累计运行时间。
Checksum 双端
csharp
public uint Checksum { get; }当前场景序列化内容的校验和。
IsThreadedUpdate 双端
csharp
public bool IsThreadedUpdate { get; }场景是否正在执行线程化更新阶段。
VarNamesAttribute 双端
csharp
public UTF8String VarNamesAttribute { get; set; }IsTemporary 双端
csharp
public bool IsTemporary { get; }是否在引擎场景序列化中将该 SceneGraph 视为临时对象。
备注
本文件中的 Serializable/Variant API 操作的是引擎场景注册属性,不替代 GameCore Scene、Unit 属性或 PropertyObject 的业务状态同步。
NumAttributes 双端
csharp
public uint NumAttributes { get; }NumNetworkAttributes 双端
csharp
public uint NumNetworkAttributes { get; }方法
SetAnimationTime 双端
csharp
public void SetAnimationTime(float time)手动设置该场景图所有属性动画的时间位置。
GetRegisteredSceneGraphs 仅客户端
csharp
public static SceneGraph[] GetRegisteredSceneGraphs()获取服务端显式发布给当前客户端的额外脚本 SceneGraph 快照。
备注
结果不包含框架维护的当前 SCE 场景。普通客户端需要访问 SCE 场景内的 replicated node 时, 应从 Player.LocalPlayer.Scene.GetSceneGraph() 获取该图,并直接使用 OnNodeReplicated / OnNodeUnreplicated 与 Boolean)。
ObserveReplicatedNodes 仅客户端
csharp
public static IDisposable ObserveReplicatedNodes(Action<Node> onAdded, Action<Node>? onRemoved = null, bool includeRootNodes = false)观察「当前及之后由服务端额外发布的所有脚本 SceneGraph」里出现 / 消失的 replicated Node, 用回调通知,返回 IDisposable——调用其 Dispose 即解除全部订阅。
onAdded— 一个 replicated node 首次出现在本机时调用(已跳过根节点、已去重)。onRemoved— 一个已跟踪的 node 被反注册(实体销毁 / 整图注销 / 重连清场)时调用。可选。includeRootNodes— 是否把各图的根节点也纳入(默认false——根节点通常无业务语义)。
返回: 解除全部订阅用的句柄。
备注
此便利方法只覆盖 OnRegistered / GetRegisteredSceneGraphs 管理的额外发布图, 不覆盖框架维护的当前 SCE 场景。观察 SCE 场景时,应从 Player.LocalPlayer.Scene.GetSceneGraph() 获取图,先订阅该实例的 node 事件,再调用 Boolean) 回灌已有节点。 把混合同步(位置走 node、数据走 PropertyHostComponent)客户端反复要写的发现样板收成一行:订阅 OnRegistered + 回灌 GetRegisteredSceneGraphs(含之后注册的图)+ 对每图挂 OnNodeReplicated/OnNodeUnreplicated + 回灌 Boolean)
- 跳过场景根节点 + 去重 +
Dispose解除全部订阅 + 整图注销时补发。 分类交给调用方:在 里按 node.Name区分实体类型即可——Node 名是AM_NET复制属性、随 node 创建快照一同到达,不必等独立到达的属性组件,故分类无错判窗口。属性组件可能晚于 node 到达, 取用须用node.OnPropertyHostReady<T>(...)/node.TryGetPropertyHost<T>(out ...)容忍未就绪。
GetReplicatedNodes 双端
csharp
public Node[] GetReplicatedNodes(bool recursive = true)获取该图中 replicated 子节点快照,不包含 SceneGraph 根节点本身。
GetReplicatedComponents 双端
csharp
public NodeComponentSnapshot[] GetReplicatedComponents(bool recursive = true)获取该图中 replicated 组件快照。
ConfigureTransformSmoothing 双端
csharp
public void ConfigureTransformSmoothing(float smoothingConstant, float snapThreshold)配置 replicated transform 的客户端视觉平滑参数。
GetSessionSceneGraphs 双端
csharp
public static SceneGraph[] GetSessionSceneGraphs()获取本次脚本会话创建并由 WasiCore 托管生命周期的 SceneGraph 快照。 主要用于本地调试工具枚举纯客户端 local SceneGraph。
GetOctree 仅客户端
csharp
public OctreeComponent? GetOctree()获取场景根节点上的 Urho Octree。不存在时返回 null,不会隐式创建。
EnsureOctreeComponent 仅客户端
csharp
public OctreeComponent EnsureOctreeComponent()获取或创建场景根节点上的 Urho Octree,并返回可用于空间查询的包装对象。
EnsureOctree 仅客户端
csharp
public void EnsureOctree()确保场景包含 Octree 组件。如果已存在则不重复创建。 Octree 是 Urho3D 渲染器定位 Drawable 对象的空间索引,没有它场景将无法渲染。
EnsureSkinTextureBuffer 仅客户端
csharp
public void EnsureSkinTextureBuffer()确保场景包含骨骼蒙皮所需的场景级组件。AnimatedModelComponent 在场景中渲染时依赖此组件把骨骼矩阵上传到 GPU;缺少时骨骼模型的顶点会被 错误地变换到零矩阵,最终渲染成"完全消失"。通过 Actor 体系加载的场景已 包含此组件,纯 GameGraph 自建场景需要这里补上。
AddChild 双端
csharp
public void AddChild(Node node, NodeReplication replication = NodeReplication.Inherit)CreateChild 双端
csharp
public Node? CreateChild(string name = "", NodeReplication replication = NodeReplication.Inherit)CreateComponent 双端
csharp
public T? CreateComponent<T>(ComponentReplication replication = ComponentReplication.Local) where T : INodeComponent, new()创建组件
返回: 创建的组件
AddComponent 双端
csharp
public void AddComponent<T>(T comp, ComponentReplication replication = ComponentReplication.Local) where T : INodeComponent增加组件
comp— 组件对象replication— 组件同步语义
RemoveComponent 双端
csharp
public void RemoveComponent<T>(T comp) where T : INodeComponent移除组件
comp— 组件对象
GetComponent 双端
csharp
public T? GetComponent<T>() where T : class, INodeComponent获取组件
返回: 组件对象
DisposeManaged 双端
csharp
protected override void DisposeManaged()GetFreeNodeID 双端
csharp
public uint GetFreeNodeID(NodeReplication replication = NodeReplication.Local)GetFreeComponentID 双端
csharp
public uint GetFreeComponentID(ComponentReplication replication = ComponentReplication.Local)GetNodesWithTag 双端
csharp
public Node[] GetNodesWithTag(UTF8String tag)获取场景中所有带指定标签的节点。
GetVarName 双端
csharp
public UTF8String GetVarName(uint hash)IsReplicatedID 双端
csharp
public static bool IsReplicatedID(uint id)Update 双端
csharp
public void Update(float timeStep)手动推进一次底层 Scene 更新。通常应由引擎生命周期调用。
Clear 双端
csharp
public void Clear(bool clearReplicated = true, bool clearLocal = true)清空场景中的 replicated 与/或 local 内容。
GetNode 双端
csharp
public Node? GetNode(uint id)按引擎场景 ID 查找节点。
GetComponent 双端
csharp
public T? GetComponent<T>(uint id) where T : class, INodeComponent按引擎场景 ID 和原生类型名查找组件;ID 不存在或类型不匹配时返回 null。
备注
使用 Node.GetComponent<T>() 原生查询所用的 INodeComponent.NativeTypeName (未指定时使用托管类型名)精确匹配,不将 ID 查询结果强制解释为任意类型或基类。
SetTemporary 双端
csharp
public void SetTemporary(bool enable)ApplyAttributes 双端
csharp
public void ApplyAttributes()ResetAttributesToDefault 双端
csharp
public void ResetAttributesToDefault()RemoveInstanceAttributeDefaults 双端
csharp
public void RemoveInstanceAttributeDefaults()GetInterceptNetworkUpdate 双端
csharp
public bool GetInterceptNetworkUpdate(UTF8String attributeName)SetInterceptNetworkUpdate 双端
csharp
public void SetInterceptNetworkUpdate(UTF8String attributeName, bool enable)SetAttribute 双端
csharp
public bool SetAttribute(uint index, Variant value)SetAttribute 双端
csharp
public bool SetAttribute(UTF8String name, Variant value)GetAttribute 双端
csharp
public Variant GetAttribute(uint index)GetAttribute 双端
csharp
public Variant GetAttribute(UTF8String name)GetAttributeDefault 双端
csharp
public Variant GetAttributeDefault(uint index)GetAttributeDefault 双端
csharp
public Variant GetAttributeDefault(UTF8String name)GetAttributeInfo 双端
csharp
public SerializableAttributeInfo GetAttributeInfo(uint index)Publish 仅服务端
csharp
public bool Publish(Player player)将脚本创建的独立 SceneGraph 发布给指定玩家。
Unpublish 仅服务端
csharp
public bool Unpublish(Player player)取消指定玩家对该 SceneGraph 的订阅。
Unpublish 仅服务端
csharp
public void Unpublish()取消该 SceneGraph 的所有订阅。
事件
OnRegistered 仅客户端
csharp
public static event Action<SceneGraph>? OnRegistered服务端通过 Publish(Player) 向当前客户端额外发布的脚本 SceneGraph 注册时触发。
备注
不包含框架维护的当前 SCE 场景。访问当前 SCE 场景图时,应从 Player.LocalPlayer.Scene.GetSceneGraph() 获取。
OnUnregistered 仅客户端
csharp
public static event Action<SceneGraph>? OnUnregistered服务端向当前客户端额外发布的脚本 SceneGraph 被取消发布或销毁时触发。
备注
不表示当前 SCE 场景切换或卸载。
OnNodeReplicated 仅客户端
csharp
public event Action<Node>? OnNodeReplicated该 SceneGraph 收到 replicated Node 创建消息时触发。
OnNodeUnreplicated 仅客户端
csharp
public event Action<Node>? OnNodeUnreplicated该 SceneGraph 收到 replicated Node 删除消息、节点即将从客户端场景移除时触发。
SceneGraphMainViewportController 仅客户端
命名空间 GameGraph.NodeSystem
csharp
public sealed class SceneGraphMainViewportController : DisposableObject管理一组独立 SceneGraph 对主视口的临时接管。
备注
该类型面向服务端发布图、纯 GameGraph 调试图等“不是当前 SCE 场景但需要直接显示”的场景。 它是可选 helper,不会被框架自动注入到 SceneGraph 同步或 SCE 场景生命周期中。 如果发布图只作为同步数据源使用,例如客户端读取节点状态后绘制到 Canvas 或其他 UI, 不需要使用本类型,也不需要创建摄像机或接管主视口。 调用 Boolean) 时会保存原主视口,绑定目标 SceneGraph;调用 SceneGraph) 或收到发布图注销事件时,会切回最近绑定的剩余图,若没有剩余图则恢复原主视口。 本类型只负责 viewport 生命周期,不创建模型、材质、灯光或摄像机节点。项目仍应在客户端自行创建 local 表现组件和 CameraComponent。
构造函数
SceneGraphMainViewportController 仅客户端
csharp
public SceneGraphMainViewportController(bool unbindOnSceneGraphUnregistered = true, bool disposeOnGameEnd = true, bool restoreOnDispose = true)创建主视口接管 controller。
unbindOnSceneGraphUnregistered— 是否在客户端收到OnUnregistered时自动移除对应绑定。 对服务端发布图建议保持默认 true。disposeOnGameEnd— 是否在OnGameEnd时自动 Dispose。建议保持默认 true,避免调试图占用主视口跨越游戏生命周期。restoreOnDispose— Dispose 时是否恢复第一次绑定前的主视口。建议保持默认 true。
属性
ActiveSceneGraph 仅客户端
csharp
public SceneGraph? ActiveSceneGraph { get; }当前由本 controller 接管的 SceneGraph;未接管主视口时为 null。
ActiveCamera 仅客户端
csharp
public CameraComponent? ActiveCamera { get; }当前主视口使用的摄像机;未接管主视口时为 null。
Count 仅客户端
csharp
public int Count { get; }当前记录的 SceneGraph 绑定数量。
IsOriginalViewportCaptured 仅客户端
csharp
public bool IsOriginalViewportCaptured { get; }是否已保存原主视口。第一次 Boolean) 时自动保存。
方法
GetBoundSceneGraphs 仅客户端
csharp
public SceneGraph[] GetBoundSceneGraphs()返回当前记录的 SceneGraph 快照,顺序为绑定顺序。
Bind 仅客户端
csharp
public void Bind(SceneGraph sceneGraph, CameraComponent camera, bool ensureOctree = true)将指定 SceneGraph 绑定到主视口。重复绑定同一图会更新摄像机并把它提升为当前活跃图。
sceneGraph— 要显示的 SceneGraph。camera— 用于渲染该 SceneGraph 的摄像机组件。ensureOctree— 是否在绑定前调用EnsureOctree。
Unbind 仅客户端
csharp
public bool Unbind(SceneGraph sceneGraph)移除指定 SceneGraph 的主视口绑定。 若移除的是当前活跃图,会切到最近绑定的剩余图;没有剩余图时恢复原主视口。
返回: 找到并移除了绑定时返回 true;否则返回 false。
UnbindAll 仅客户端
csharp
public void UnbindAll(bool restoreOriginalViewport = true)移除所有 SceneGraph 绑定,并按需恢复原主视口。
RestoreOriginalMainViewport 仅客户端
csharp
public void RestoreOriginalMainViewport()恢复第一次绑定前保存的主视口。不会清空已记录的 SceneGraph 绑定。
DisposeManaged 仅客户端
csharp
protected override void DisposeManaged()SceneGraphReplication 双端
命名空间 GameGraph.NodeSystem
csharp
public enum SceneGraphReplication枚举值
LocalReplicatedUnpublished
SceneLightingController 仅客户端
命名空间 GameGraph.NodeSystem
csharp
public sealed class SceneLightingController当前 SCE 场景的光照、Zone 环境参数和 LightGroup 预设运行时控制器。
备注
该控制器只能在客户端使用,且只面向由 SCE 场景加载流程创建的内置 LightGroup、 DirectionalLight、PointLights 和 Zone 结构。普通 SceneGraph 不保证存在这些固定命名节点; 因此请通过 Scene) 从 Scene 获取控制器,并处理返回 null 的情况。 所有操作都是 runtime-only、client-only;不会同步服务器,也不会写回地图资源。需要跨端或持久化时, 应在项目自己的玩法数据中记录意图,并在客户端按意图重新应用这些视觉参数。
属性
Scene 仅客户端
csharp
public Scene Scene { get; }所属 SCE 场景。
Node 仅客户端
csharp
public Node Node { get; }光照入口节点。当前通常是 LightGroup,回退时为 DirectionalLight。
备注
节点来自 SCE 场景内置结构;不要把它作为项目自定义普通 SceneGraph 的通用约定。
LightGroupNode 仅客户端
csharp
public Node? LightGroupNode { get; }SCE LightGroup 节点。
备注
在非 SCE 场景、场景尚未加载完成或资源结构不完整时可能为 null。
DirectionalLightNode 仅客户端
csharp
public Node? DirectionalLightNode { get; }SCE 默认方向光节点。
备注
在非 SCE 场景、场景尚未加载完成或资源结构不完整时可能为 null。
PointLightsNode 仅客户端
csharp
public Node? PointLightsNode { get; }SCE 点光源集合节点。
备注
没有点光源集合或场景结构不可用时为 null。
Zone 仅客户端
csharp
public Zone? Zone { get; }光照关联的 Zone 组件。
备注
若当前 SCE 场景没有可访问的 Zone 组件,读取或写入雾效/环境参数的 API 会返回 null 或 false。
MainLight 仅客户端
csharp
public LightComponent? MainLight { get; }当前 SCE 场景主光源组件。
备注
主光源优先从 LightGroup 查找,找不到时回退到默认 DirectionalLight。
Lights 仅客户端
csharp
public LightComponent[] Lights { get; }光照相关的全部 Light 组件数组快照。
备注
返回数组是调用瞬间的快照;之后场景节点增删不会自动反映到已返回的数组中。
PointLights 仅客户端
csharp
public LightComponent[] PointLights { get; }当前 SCE 场景点光源组件数组快照。
IsPresetFading 仅客户端
csharp
public bool IsPresetFading { get; }当前是否处于 LightGroup 预设渐变中。
方法
GetMainLightSettings 仅客户端
csharp
public SceneLightSettings? GetMainLightSettings()读取当前 SCE 场景主光源参数。
返回: 找到主光源时返回参数快照;否则返回 null。
ApplyMainLightSettings 仅客户端
csharp
public bool ApplyMainLightSettings(SceneLightSettings settings)写入当前 SCE 场景主光源参数。
settings— 要应用到主光源的参数。
返回: 成功找到主光源并写入时返回 true;否则返回 false。
CaptureLightSettings 仅客户端
csharp
public SceneLightSettings CaptureLightSettings(LightComponent light)读取指定 LightComponent 的参数。
light— 要读取的 Light 组件。
返回: 该 Light 组件当前参数的快照。
ApplyLightSettings 仅客户端
csharp
public void ApplyLightSettings(LightComponent light, SceneLightSettings settings)写入指定 LightComponent 的参数。
light— 要写入的 Light 组件。settings— 要应用到该 Light 组件的参数。
GetFogSettings 仅客户端
csharp
public SceneZoneFogSettings? GetFogSettings()读取当前 SCE 场景 Zone 的雾效参数。
返回: 找到 Zone 时返回雾效参数快照;否则返回 null。
ApplyFogSettings 仅客户端
csharp
public bool ApplyFogSettings(SceneZoneFogSettings settings)写入当前 SCE 场景 Zone 的雾效参数。
settings— 要应用到 Zone 的雾效参数。
返回: 成功找到 Zone 并写入时返回 true;否则返回 false。
GetEnvironmentSettings 仅客户端
csharp
public SceneZoneEnvironmentSettings? GetEnvironmentSettings()读取当前 SCE 场景 Zone 的环境光照和后处理参数。
返回: 找到 Zone 时返回环境参数快照;否则返回 null。
ApplyEnvironmentSettings 仅客户端
csharp
public bool ApplyEnvironmentSettings(SceneZoneEnvironmentSettings settings)写入当前 SCE 场景 Zone 的环境光照和后处理参数。
settings— 要应用到 Zone 的环境参数。
返回: 成功找到 Zone 并写入时返回 true;否则返回 false。
LoadPreset 仅客户端
csharp
public bool LoadPreset(string resourcePath)直接将 LightGroup 节点加载为指定 XML 预设,例如 "LightGroup/Daytime.xml"。
resourcePath— LightGroup XML 资源路径。
返回: 资源路径有效且 LightGroup 节点加载成功时返回 true。
备注
这是立即加载,不带渐变。需要平滑切换时请使用 Boolean)。
StartPresetFade 仅客户端
csharp
public bool StartPresetFade(string resourcePath, float fadeInTime, bool bakeShadowMap = false)以渐变方式切换 LightGroup XML 预设,例如 "LightGroup/Daytime.xml"。
resourcePath— LightGroup XML 资源路径。fadeInTime— 渐变时长,单位为秒;小于 0 的值会按 0 处理。bakeShadowMap— 切换过程中是否重新烘焙阴影贴图。
返回: 资源路径有效且成功启动渐变时返回 true。
备注
渐变状态属于当前客户端运行时状态。可以通过 IsPresetFading 查询是否仍在渐变, 或通过 ResetPresetFade 终止并清理渐变工作状态。
ResetPresetFade 仅客户端
csharp
public void ResetPresetFade()终止 LightGroup 预设渐变并清理工作状态。
SceneLightSettings 仅客户端
命名空间 GameGraph.NodeSystem
csharp
public readonly struct SceneLightSettings : IEquatable<SceneLightSettings>SCE 场景中单个 LightComponent 的运行时参数快照。
Type— 灯光类型,例如方向光、点光源或聚光灯。Color— 灯光基础颜色。Brightness— 灯光基础亮度。Range— 点光源或聚光灯的影响范围。SpecularIntensity— 高光反射强度。Fov— 聚光灯视锥角度。PerVertex— 是否使用逐顶点光照。ShadowIntensity— 阴影强度。ShadowResolution— 阴影贴图分辨率。ShadowMaxExtrusion— 方向光阴影最大挤出距离。UseWeatherValues— 是否让天气参数参与该灯光最终颜色/亮度计算。WeatherColor— 天气系统作用到该灯光上的颜色。WeatherBrightness— 天气系统作用到该灯光上的亮度。
备注
该类型用于读取后修改少量字段,再通过 SceneLightSettings) 或 SceneLightSettings) 写回当前客户端场景。 写回只影响本次运行时视觉表现,不会同步到服务器,也不会保存到地图资源。
构造函数
SceneLightSettings 仅客户端
csharp
public SceneLightSettings(LightType Type, Color Color, float Brightness, float Range, float SpecularIntensity, float Fov, bool PerVertex, float ShadowIntensity, float ShadowResolution, float ShadowMaxExtrusion, bool UseWeatherValues, Color WeatherColor, float WeatherBrightness)SCE 场景中单个 LightComponent 的运行时参数快照。
Type— 灯光类型,例如方向光、点光源或聚光灯。Color— 灯光基础颜色。Brightness— 灯光基础亮度。Range— 点光源或聚光灯的影响范围。SpecularIntensity— 高光反射强度。Fov— 聚光灯视锥角度。PerVertex— 是否使用逐顶点光照。ShadowIntensity— 阴影强度。ShadowResolution— 阴影贴图分辨率。ShadowMaxExtrusion— 方向光阴影最大挤出距离。UseWeatherValues— 是否让天气参数参与该灯光最终颜色/亮度计算。WeatherColor— 天气系统作用到该灯光上的颜色。WeatherBrightness— 天气系统作用到该灯光上的亮度。
备注
该类型用于读取后修改少量字段,再通过 SceneLightSettings) 或 SceneLightSettings) 写回当前客户端场景。 写回只影响本次运行时视觉表现,不会同步到服务器,也不会保存到地图资源。
属性
Type 仅客户端
csharp
public LightType Type { get; init; }灯光类型,例如方向光、点光源或聚光灯。
Color 仅客户端
csharp
public Color Color { get; init; }灯光基础颜色。
Brightness 仅客户端
csharp
public float Brightness { get; init; }灯光基础亮度。
Range 仅客户端
csharp
public float Range { get; init; }点光源或聚光灯的影响范围。
SpecularIntensity 仅客户端
csharp
public float SpecularIntensity { get; init; }高光反射强度。
Fov 仅客户端
csharp
public float Fov { get; init; }聚光灯视锥角度。
PerVertex 仅客户端
csharp
public bool PerVertex { get; init; }是否使用逐顶点光照。
ShadowIntensity 仅客户端
csharp
public float ShadowIntensity { get; init; }阴影强度。
ShadowResolution 仅客户端
csharp
public float ShadowResolution { get; init; }阴影贴图分辨率。
ShadowMaxExtrusion 仅客户端
csharp
public float ShadowMaxExtrusion { get; init; }方向光阴影最大挤出距离。
UseWeatherValues 仅客户端
csharp
public bool UseWeatherValues { get; init; }是否让天气参数参与该灯光最终颜色/亮度计算。
WeatherColor 仅客户端
csharp
public Color WeatherColor { get; init; }天气系统作用到该灯光上的颜色。
WeatherBrightness 仅客户端
csharp
public float WeatherBrightness { get; init; }天气系统作用到该灯光上的亮度。
方法
ToString 仅客户端
csharp
public override string ToString()operator != 仅客户端
csharp
public static bool operator !=(SceneLightSettings left, SceneLightSettings right)operator == 仅客户端
csharp
public static bool operator ==(SceneLightSettings left, SceneLightSettings right)GetHashCode 仅客户端
csharp
public override int GetHashCode()Equals 仅客户端
csharp
public override bool Equals(object obj)Equals 仅客户端
csharp
public bool Equals(SceneLightSettings other)Deconstruct 仅客户端
csharp
public void Deconstruct(out LightType Type, out Color Color, out float Brightness, out float Range, out float SpecularIntensity, out float Fov, out bool PerVertex, out float ShadowIntensity, out float ShadowResolution, out float ShadowMaxExtrusion, out bool UseWeatherValues, out Color WeatherColor, out float WeatherBrightness)SceneTerrainController 双端
命名空间 GameGraph.NodeSystem
csharp
public sealed class SceneTerrainControllerSCE 场景地形入口控制器。
备注
提供地形材质、离散瓦片纹理权重以及连续高度场混合配置入口。 离散瓦片运行时纹理编辑需要在场景加载前启用 GameDataScene.EnableRuntimeTerrainTextureEditing,并使用支持该能力的客户端。
属性
Scene 双端
csharp
public Scene Scene { get; }所属 SCE 场景。
Node 双端
csharp
public Node Node { get; }SCE 地形根节点。
MaterialCount 仅客户端
csharp
public int MaterialCount { get; }当前客户端可访问的地形材质数量。
LandscapePatchCount 仅客户端
csharp
public TerrainTexturePoint LandscapePatchCount { get; }当前 Landscape patch 数量。
LandscapeWeightMapSize 仅客户端
csharp
public TerrainTexturePoint LandscapeWeightMapSize { get; }当前 Landscape weight map 尺寸。
方法
GetMaterials 仅客户端
csharp
public GameGraph.MaterialSystem.Material[] GetMaterials()获取当前客户端地形材质实例。
GetMaterial 仅客户端
csharp
public GameGraph.MaterialSystem.Material? GetMaterial(uint index)获取指定索引的当前客户端地形材质实例。
TryGetMaterial 仅客户端
csharp
public bool TryGetMaterial(uint index, out GameGraph.MaterialSystem.Material? material)尝试获取指定索引的当前客户端地形材质实例。
GetMaterialTexture 仅客户端
csharp
public GameGraph.ResourceSystem.Texture? GetMaterialTexture(uint materialIndex, TextureUnit unit)获取指定地形材质上的贴图槽位。
SetMaterialTexture 仅客户端
csharp
public bool SetMaterialTexture(uint materialIndex, TextureUnit unit, GameGraph.ResourceSystem.Texture? texture)设置指定地形材质上的贴图槽位。
备注
这是 runtime-only、client-only 的视觉修改;它只替换材质实例上的纹理, 不会修改地表 texture weight、landscape weight map 或场景数据。
SetMaterialTexture 仅客户端
csharp
public bool SetMaterialTexture(uint materialIndex, TextureUnit unit, GameCore.ResourceType.Texture texturePath)加载纹理资源并设置到指定地形材质的贴图槽位。
返回: 材质索引有效且纹理加载成功时返回 true。
WorldPositionToTextureWeightPoint 仅客户端
csharp
public TerrainTexturePoint WorldPositionToTextureWeightPoint(ScenePoint position)将场景世界坐标转换为普通 tile 地表 texture weight 采样点坐标。
TryGetTextureWeights 仅客户端
csharp
public bool TryGetTextureWeights(int x, int y, out TerrainTextureWeights weights)尝试读取普通 tile 地表的 texture weight。
GetTextureWeights 仅客户端
csharp
public TerrainTextureWeights? GetTextureWeights(int x, int y)读取普通 tile 地表的 texture weight。
TryGetTextureWeights 仅客户端
csharp
public bool TryGetTextureWeights(ScenePoint position, out TerrainTextureWeights weights)尝试读取指定世界坐标处的普通 tile 地表 texture weight。
GetTextureWeights 仅客户端
csharp
public TerrainTextureWeights? GetTextureWeights(ScenePoint position)读取指定世界坐标处的普通 tile 地表 texture weight。
SetTextureWeights 仅客户端
csharp
public bool SetTextureWeights(int x, int y, TerrainTextureWeights weights, bool refresh = true)设置普通 tile 地表的 texture weight。
SetTextureWeights 仅客户端
csharp
public bool SetTextureWeights(ScenePoint position, TerrainTextureWeights weights, bool refresh = true)设置指定世界坐标处的普通 tile 地表 texture weight。
TryGetTextureLabel 仅客户端
csharp
public bool TryGetTextureLabel(int x, int y, out TerrainTextureLabel label)尝试读取普通 tile 地表采样点当前主导贴图的名称和标签。
GetTextureLabel 仅客户端
csharp
public TerrainTextureLabel? GetTextureLabel(int x, int y)读取普通 tile 地表采样点当前主导贴图的名称和标签。
TryGetTextureLabel 仅客户端
csharp
public bool TryGetTextureLabel(ScenePoint position, out TerrainTextureLabel label)尝试读取指定世界坐标处当前主导贴图的名称和标签。
GetTextureLabel 仅客户端
csharp
public TerrainTextureLabel? GetTextureLabel(ScenePoint position)读取指定世界坐标处当前主导贴图的名称和标签。
RefreshDirtyTerrain 仅客户端
csharp
public void RefreshDirtyTerrain()刷新普通 tile 地表 dirty mesh。
TryGetLandscapePatchBlend 仅客户端
csharp
public bool TryGetLandscapePatchBlend(int patchX, int patchY, out LandscapePatchBlend blend)尝试读取 Landscape patch 的地表贴图组合。
GetLandscapePatchBlend 仅客户端
csharp
public LandscapePatchBlend? GetLandscapePatchBlend(int patchX, int patchY)读取 Landscape patch 的地表贴图组合。
SetLandscapePatchBlend 仅客户端
csharp
public bool SetLandscapePatchBlend(int patchX, int patchY, LandscapePatchBlend blend)设置 Landscape patch 的地表贴图组合。
TryGetLandscapeWeightMapPixel 仅客户端
csharp
public bool TryGetLandscapeWeightMapPixel(int x, int y, out Vector4 weights)尝试读取 Landscape weight map 像素。
GetLandscapeWeightMapPixel 仅客户端
csharp
public Vector4? GetLandscapeWeightMapPixel(int x, int y)读取 Landscape weight map 像素。
SetLandscapeWeightMapPixel 仅客户端
csharp
public bool SetLandscapeWeightMapPixel(int x, int y, Vector4 weights)设置 Landscape weight map 像素。
PaintLandscapeWeights 仅客户端
csharp
public bool PaintLandscapeWeights(TerrainPixelRect area, TerrainWeightPaintOptions options)在 Landscape weight map 上按矩形区域涂刷权重。
SceneWeatherController 仅客户端
命名空间 GameGraph.NodeSystem
csharp
public sealed class SceneWeatherController当前 SCE 场景的天气、TerrainData 雾效和战争迷雾运行时控制器。
备注
该控制器只能在客户端使用,且只面向由 SCE 场景加载流程创建的内置节点。普通 SceneGraph 不保证存在固定命名的 Weather、LightGroup 或 TerrainData 节点; 因此请通过 Scene) 从 Scene 获取控制器,并处理返回 null 的情况。 所有操作都是 runtime-only、client-only;不会同步服务器,也不会写回地图资源。需要跨端或持久化时, 应在项目自己的玩法数据中记录意图,并在客户端按意图重新应用这些视觉参数。
属性
Scene 仅客户端
csharp
public Scene Scene { get; }所属 SCE 场景。
Node 仅客户端
csharp
public Node Node { get; }天气/雾效入口节点。当前通常是 Weather 或 LightGroup。
备注
节点来自 SCE 场景内置结构;不要把它作为项目自定义普通 SceneGraph 的通用约定。
LightGroupNode 仅客户端
csharp
public Node? LightGroupNode { get; }SCE LightGroup 节点。
备注
在非 SCE 场景、场景尚未加载完成或资源结构不完整时可能为 null。
Zone 仅客户端
csharp
public Zone? Zone { get; }天气/雾效关联的 Zone 组件。
备注
若当前 SCE 场景没有可访问的 Zone 组件,读取或写入雾效参数的 API 会返回 null 或 false。
Lights 仅客户端
csharp
public LightComponent[] Lights { get; }天气关联的 Light 组件数组快照。
备注
返回数组是调用瞬间的快照;之后场景节点增删不会自动反映到已返回的数组中。
HasTerrainData 仅客户端
csharp
public bool HasTerrainData { get; }当前客户端是否存在可供天气和战争迷雾使用的 TerrainData。
备注
该属性只检查当前客户端运行时状态。没有 TerrainData 时,TerrainData 雾色、cloud shadow 和战争迷雾相关调用通常会失败或没有可见效果。
TerrainDataEnabled 仅客户端
csharp
public bool TerrainDataEnabled { get; set; }当前客户端 TerrainData 是否启用。
WeatherEffectEnabled 仅客户端
csharp
public bool WeatherEffectEnabled { get; set; }当前客户端 TerrainData 的地形天气效果是否启用。
TerrainFogColor 仅客户端
csharp
public Color TerrainFogColor { get; set; }当前客户端 TerrainData 的雾颜色。
FogOfWarOpen 仅客户端
csharp
public bool FogOfWarOpen { get; }当前客户端场景是否已经创建战争迷雾。
FogOfWarEnabled 仅客户端
csharp
public bool FogOfWarEnabled { get; set; }当前客户端战争迷雾渲染开关。
FogOfWarSize 仅客户端
csharp
public SceneEnvironmentMapSize FogOfWarSize { get; }当前客户端战争迷雾贴图尺寸。
方法
GetFogSettings 仅客户端
csharp
public SceneZoneFogSettings? GetFogSettings()读取当前 SCE 场景 Zone 的雾效参数。
返回: 找到 Zone 时返回雾效参数快照;否则返回 null。
ApplyFogSettings 仅客户端
csharp
public bool ApplyFogSettings(SceneZoneFogSettings settings)写入当前 SCE 场景 Zone 的雾效参数。
settings— 要应用到 Zone 的雾效参数。
返回: 成功找到 Zone 并写入时返回 true;否则返回 false。
ApplyLightWeatherValues 仅客户端
csharp
public int ApplyLightWeatherValues(Color color, float brightness, bool useWeatherValues = true)对天气关联灯光启用或写入 weather values。
color— 天气作用到灯光上的颜色。brightness— 天气作用到灯光上的亮度。useWeatherValues— 是否让灯光使用 weather values 参与最终颜色/亮度计算。
返回: 实际写入的灯光数量。
SetLightWeatherParamBlend 仅客户端
csharp
public int SetLightWeatherParamBlend(float blend)设置天气参数对天气关联灯光的混合系数。
blend— 混合系数,传入值会被限制到 0 到 1 之间。
返回: 实际写入的灯光数量。
SetCloudShadowColor 仅客户端
csharp
public bool SetCloudShadowColor(int x, int y, Color color, bool immediately = true)设置当前客户端 TerrainData cloud shadow 指定像素的颜色。
x— cloud shadow 像素 X 坐标。y— cloud shadow 像素 Y 坐标。color— 要写入的颜色。immediately— 是否立即刷新底层数据。
返回: 坐标有效且写入成功时返回 true。
RefreshCloudShadow 仅客户端
csharp
public void RefreshCloudShadow()刷新当前客户端 TerrainData cloud shadow 贴图。
OpenFogOfWar 仅客户端
csharp
public bool OpenFogOfWar(bool enabled)创建或关闭当前客户端场景的战争迷雾。
enabled— 传入true创建并打开战争迷雾;传入false关闭。
返回: 操作成功时返回 true。没有 TerrainData 或底层对象不可用时可能返回 false。
GetFogOfWarSettings 仅客户端
csharp
public SceneFogOfWarSettings? GetFogOfWarSettings()读取当前客户端战争迷雾参数。
返回: 战争迷雾已创建时返回参数快照;尚未创建时返回 null。
ApplyFogOfWarSettings 仅客户端
csharp
public bool ApplyFogOfWarSettings(SceneFogOfWarSettings settings)写入当前客户端战争迷雾参数。
settings— 要应用到战争迷雾的参数。
返回: 写入成功时返回 true;战争迷雾未创建或底层对象不可用时可能返回 false。
SetFogOfWarWeight 仅客户端
csharp
public bool SetFogOfWarWeight(int x, int y, float weight, bool immediately = true)设置当前客户端战争迷雾指定像素权重。
x— 迷雾贴图像素 X 坐标。y— 迷雾贴图像素 Y 坐标。weight— 目标权重,传入值会被限制到 0 到 1 之间。immediately— 是否立即刷新底层数据。
返回: 坐标有效且写入成功时返回 true。
AddFogOfWarWeight 仅客户端
csharp
public bool AddFogOfWarWeight(int x, int y, float weight, bool immediately = true)增加当前客户端战争迷雾指定像素权重。
x— 迷雾贴图像素 X 坐标。y— 迷雾贴图像素 Y 坐标。weight— 要增加的权重,传入值会被限制到 0 到 1 之间。immediately— 是否立即刷新底层数据。
返回: 坐标有效且写入成功时返回 true。
MixFogOfWarWeight 仅客户端
csharp
public bool MixFogOfWarWeight(int x, int y, float weight, bool immediately = true)混合当前客户端战争迷雾指定像素权重。
x— 迷雾贴图像素 X 坐标。y— 迷雾贴图像素 Y 坐标。weight— 要混合的权重,传入值会被限制到 0 到 1 之间。immediately— 是否立即刷新底层数据。
返回: 坐标有效且写入成功时返回 true。
RefreshFogOfWar 仅客户端
csharp
public bool RefreshFogOfWar(bool force = false)刷新当前客户端战争迷雾贴图。
force— 是否强制刷新。
返回: 刷新成功时返回 true。
SwapFogOfWarLayer 仅客户端
csharp
public bool SwapFogOfWarLayer()切换当前客户端战争迷雾当前层。
返回: 切换成功时返回 true。
SceneZoneEnvironmentSettings 仅客户端
命名空间 GameGraph.NodeSystem
csharp
public readonly struct SceneZoneEnvironmentSettings : IEquatable<SceneZoneEnvironmentSettings>SCE 场景 Zone 上与环境光照和后处理相关的运行时参数快照。
UseGlobalRoughness— 是否使用全局粗糙度覆盖材质粗糙度。EnvTextureDiffIntensity— 环境贴图漫反射强度。EnvTextureSpecIntensity— 环境贴图镜面反射强度。EnvCubeAngle— 环境立方体贴图旋转角度。EnvCubeFollowAngle— 环境立方体贴图跟随角度。GlobalRoughness— 全局粗糙度。UseRoleSH— 是否启用角色球谐光照。RoleSHIntensity— 角色球谐光照强度。RoleSHAngle— 角色球谐光照角度。BloomThreshold— Bloom 阈值。BloomWeight— Bloom 权重。VignetteEnabled— 是否启用暗角后处理。VignetteIntensity— 暗角强度。
备注
该类型用于读取、微调并写回当前客户端环境贴图、角色 SH、Bloom、Vignette 等视觉参数。 这些修改不会同步到其他端,也不会持久化。
构造函数
SceneZoneEnvironmentSettings 仅客户端
csharp
public SceneZoneEnvironmentSettings(bool UseGlobalRoughness, float EnvTextureDiffIntensity, float EnvTextureSpecIntensity, float EnvCubeAngle, float EnvCubeFollowAngle, float GlobalRoughness, bool UseRoleSH, float RoleSHIntensity, float RoleSHAngle, float BloomThreshold, float BloomWeight, bool VignetteEnabled, float VignetteIntensity)SCE 场景 Zone 上与环境光照和后处理相关的运行时参数快照。
UseGlobalRoughness— 是否使用全局粗糙度覆盖材质粗糙度。EnvTextureDiffIntensity— 环境贴图漫反射强度。EnvTextureSpecIntensity— 环境贴图镜面反射强度。EnvCubeAngle— 环境立方体贴图旋转角度。EnvCubeFollowAngle— 环境立方体贴图跟随角度。GlobalRoughness— 全局粗糙度。UseRoleSH— 是否启用角色球谐光照。RoleSHIntensity— 角色球谐光照强度。RoleSHAngle— 角色球谐光照角度。BloomThreshold— Bloom 阈值。BloomWeight— Bloom 权重。VignetteEnabled— 是否启用暗角后处理。VignetteIntensity— 暗角强度。
备注
该类型用于读取、微调并写回当前客户端环境贴图、角色 SH、Bloom、Vignette 等视觉参数。 这些修改不会同步到其他端,也不会持久化。
属性
UseGlobalRoughness 仅客户端
csharp
public bool UseGlobalRoughness { get; init; }是否使用全局粗糙度覆盖材质粗糙度。
EnvTextureDiffIntensity 仅客户端
csharp
public float EnvTextureDiffIntensity { get; init; }环境贴图漫反射强度。
EnvTextureSpecIntensity 仅客户端
csharp
public float EnvTextureSpecIntensity { get; init; }环境贴图镜面反射强度。
EnvCubeAngle 仅客户端
csharp
public float EnvCubeAngle { get; init; }环境立方体贴图旋转角度。
EnvCubeFollowAngle 仅客户端
csharp
public float EnvCubeFollowAngle { get; init; }环境立方体贴图跟随角度。
GlobalRoughness 仅客户端
csharp
public float GlobalRoughness { get; init; }全局粗糙度。
UseRoleSH 仅客户端
csharp
public bool UseRoleSH { get; init; }是否启用角色球谐光照。
RoleSHIntensity 仅客户端
csharp
public float RoleSHIntensity { get; init; }角色球谐光照强度。
RoleSHAngle 仅客户端
csharp
public float RoleSHAngle { get; init; }角色球谐光照角度。
BloomThreshold 仅客户端
csharp
public float BloomThreshold { get; init; }Bloom 阈值。
BloomWeight 仅客户端
csharp
public float BloomWeight { get; init; }Bloom 权重。
VignetteEnabled 仅客户端
csharp
public bool VignetteEnabled { get; init; }是否启用暗角后处理。
VignetteIntensity 仅客户端
csharp
public float VignetteIntensity { get; init; }暗角强度。
方法
ToString 仅客户端
csharp
public override string ToString()operator != 仅客户端
csharp
public static bool operator !=(SceneZoneEnvironmentSettings left, SceneZoneEnvironmentSettings right)operator == 仅客户端
csharp
public static bool operator ==(SceneZoneEnvironmentSettings left, SceneZoneEnvironmentSettings right)GetHashCode 仅客户端
csharp
public override int GetHashCode()Equals 仅客户端
csharp
public override bool Equals(object obj)Equals 仅客户端
csharp
public bool Equals(SceneZoneEnvironmentSettings other)Deconstruct 仅客户端
csharp
public void Deconstruct(out bool UseGlobalRoughness, out float EnvTextureDiffIntensity, out float EnvTextureSpecIntensity, out float EnvCubeAngle, out float EnvCubeFollowAngle, out float GlobalRoughness, out bool UseRoleSH, out float RoleSHIntensity, out float RoleSHAngle, out float BloomThreshold, out float BloomWeight, out bool VignetteEnabled, out float VignetteIntensity)SceneZoneFogSettings 仅客户端
命名空间 GameGraph.NodeSystem
csharp
public readonly struct SceneZoneFogSettings : IEquatable<SceneZoneFogSettings>SCE 场景 Zone 上与雾效和环境色相关的运行时参数快照。
AmbientColor— 全局环境光颜色。VertexAmbientColor— 顶点环境光颜色。FogColor— 雾颜色。DepthFogDensity— 深度雾密度。DepthFogStart— 深度雾开始距离。DepthFogEnd— 深度雾结束距离。DepthFogEnable— 是否启用深度雾。HeightFogDensity— 高度雾密度。HeightFogHeight— 高度雾基准高度。HeightFogFalloff— 高度雾衰减系数。HeightFogEnable— 是否启用高度雾。Priority— Zone 优先级;多个 Zone 重叠时数值较高者优先。Override— 是否覆盖低优先级 Zone 的参数。AmbientGradient— 是否启用环境光渐变。
备注
该类型适合临时调整当前客户端的昼夜、天气、雾效或镜头气氛。写回只影响当前运行时 Zone 组件,不会修改场景配置文件。
构造函数
SceneZoneFogSettings 仅客户端
csharp
public SceneZoneFogSettings(Color AmbientColor, Color VertexAmbientColor, Color FogColor, float DepthFogDensity, float DepthFogStart, float DepthFogEnd, bool DepthFogEnable, float HeightFogDensity, float HeightFogHeight, float HeightFogFalloff, bool HeightFogEnable, int Priority, bool Override, bool AmbientGradient)SCE 场景 Zone 上与雾效和环境色相关的运行时参数快照。
AmbientColor— 全局环境光颜色。VertexAmbientColor— 顶点环境光颜色。FogColor— 雾颜色。DepthFogDensity— 深度雾密度。DepthFogStart— 深度雾开始距离。DepthFogEnd— 深度雾结束距离。DepthFogEnable— 是否启用深度雾。HeightFogDensity— 高度雾密度。HeightFogHeight— 高度雾基准高度。HeightFogFalloff— 高度雾衰减系数。HeightFogEnable— 是否启用高度雾。Priority— Zone 优先级;多个 Zone 重叠时数值较高者优先。Override— 是否覆盖低优先级 Zone 的参数。AmbientGradient— 是否启用环境光渐变。
备注
该类型适合临时调整当前客户端的昼夜、天气、雾效或镜头气氛。写回只影响当前运行时 Zone 组件,不会修改场景配置文件。
属性
AmbientColor 仅客户端
csharp
public Color AmbientColor { get; init; }全局环境光颜色。
VertexAmbientColor 仅客户端
csharp
public Color VertexAmbientColor { get; init; }顶点环境光颜色。
FogColor 仅客户端
csharp
public Color FogColor { get; init; }雾颜色。
DepthFogDensity 仅客户端
csharp
public float DepthFogDensity { get; init; }深度雾密度。
DepthFogStart 仅客户端
csharp
public float DepthFogStart { get; init; }深度雾开始距离。
DepthFogEnd 仅客户端
csharp
public float DepthFogEnd { get; init; }深度雾结束距离。
DepthFogEnable 仅客户端
csharp
public bool DepthFogEnable { get; init; }是否启用深度雾。
HeightFogDensity 仅客户端
csharp
public float HeightFogDensity { get; init; }高度雾密度。
HeightFogHeight 仅客户端
csharp
public float HeightFogHeight { get; init; }高度雾基准高度。
HeightFogFalloff 仅客户端
csharp
public float HeightFogFalloff { get; init; }高度雾衰减系数。
HeightFogEnable 仅客户端
csharp
public bool HeightFogEnable { get; init; }是否启用高度雾。
Priority 仅客户端
csharp
public int Priority { get; init; }Zone 优先级;多个 Zone 重叠时数值较高者优先。
Override 仅客户端
csharp
public bool Override { get; init; }是否覆盖低优先级 Zone 的参数。
AmbientGradient 仅客户端
csharp
public bool AmbientGradient { get; init; }是否启用环境光渐变。
方法
ToString 仅客户端
csharp
public override string ToString()operator != 仅客户端
csharp
public static bool operator !=(SceneZoneFogSettings left, SceneZoneFogSettings right)operator == 仅客户端
csharp
public static bool operator ==(SceneZoneFogSettings left, SceneZoneFogSettings right)GetHashCode 仅客户端
csharp
public override int GetHashCode()Equals 仅客户端
csharp
public override bool Equals(object obj)Equals 仅客户端
csharp
public bool Equals(SceneZoneFogSettings other)Deconstruct 仅客户端
csharp
public void Deconstruct(out Color AmbientColor, out Color VertexAmbientColor, out Color FogColor, out float DepthFogDensity, out float DepthFogStart, out float DepthFogEnd, out bool DepthFogEnable, out float HeightFogDensity, out float HeightFogHeight, out float HeightFogFalloff, out bool HeightFogEnable, out int Priority, out bool Override, out bool AmbientGradient)SerializableAttributeInfo 双端
命名空间 GameGraph.NodeSystem
csharp
public readonly struct SerializableAttributeInfo : IEquatable<SerializableAttributeInfo>构造函数
SerializableAttributeInfo 双端
csharp
public SerializableAttributeInfo(UTF8String Name, VariantType Type, SerializableAttributeMode Mode)属性
Name 双端
csharp
public UTF8String Name { get; init; }Type 双端
csharp
public VariantType Type { get; init; }Mode 双端
csharp
public SerializableAttributeMode Mode { get; init; }方法
ToString 双端
csharp
public override string ToString()operator != 双端
csharp
public static bool operator !=(SerializableAttributeInfo left, SerializableAttributeInfo right)operator == 双端
csharp
public static bool operator ==(SerializableAttributeInfo left, SerializableAttributeInfo right)GetHashCode 双端
csharp
public override int GetHashCode()Equals 双端
csharp
public override bool Equals(object obj)Equals 双端
csharp
public bool Equals(SerializableAttributeInfo other)Deconstruct 双端
csharp
public void Deconstruct(out UTF8String Name, out VariantType Type, out SerializableAttributeMode Mode)SerializableAttributeMode 双端
命名空间 GameGraph.NodeSystem
csharp
public enum SerializableAttributeModeUrho Serializable attribute mode flags.
枚举值
Edit = 0uFile = 1uNetwork = 2uDefault = 3uLatestData = 4uNoEdit = 8uNodeId = 0x10uComponentId = 0x20uNodeIdVector = 0x40uFileReadOnly = 0x81u
SerializableAttributeValue 双端
命名空间 GameGraph.NodeSystem
csharp
public readonly struct SerializableAttributeValue : IEquatable<SerializableAttributeValue>Serializable attribute value represented without carrying a native Variant or a resource object across the GameGraph boundary.
构造函数
SerializableAttributeValue 双端
csharp
public SerializableAttributeValue(VariantType Type, UTF8String Value)Serializable attribute value represented without carrying a native Variant or a resource object across the GameGraph boundary.
属性
Type 双端
csharp
public VariantType Type { get; init; }Value 双端
csharp
public UTF8String Value { get; init; }方法
ToVariant 双端
csharp
public Variant ToVariant()ToString 双端
csharp
public override string ToString()operator != 双端
csharp
public static bool operator !=(SerializableAttributeValue left, SerializableAttributeValue right)operator == 双端
csharp
public static bool operator ==(SerializableAttributeValue left, SerializableAttributeValue right)GetHashCode 双端
csharp
public override int GetHashCode()Equals 双端
csharp
public override bool Equals(object obj)Equals 双端
csharp
public bool Equals(SerializableAttributeValue other)Deconstruct 双端
csharp
public void Deconstruct(out VariantType Type, out UTF8String Value)TransformSpace 双端
命名空间 GameGraph.NodeSystem
csharp
public enum TransformSpace变换空间,对应引擎的 TransformSpace
枚举值
LocalParentWorld
UnitMovementController 双端
命名空间 GameGraph.NodeSystem
csharp
public sealed class UnitMovementController : TagComponent, IContextTypeService<Entity, UnitMovementController>, IContextTypeService<Entity, IUnitMovementController>, IThinker, IUnitMovementControllerUnit-level movement mode controller. It owns high-level movement authority decisions and delegates node-level physical character work to PhysicalCharacterMovement.
构造函数
UnitMovementController 双端
csharp
public UnitMovementController(Entity host)Initializes a movement controller for a Unit entity.
属性
Unit 双端
csharp
public Unit Unit { get; }Unit controlled by this movement controller.
RequestedMode 双端
csharp
public UnitMovementMode RequestedMode { get; }EffectiveMode 双端
csharp
public UnitMovementMode EffectiveMode { get; }ActiveNodeMotor 双端
csharp
public UnitNodeMotorType? ActiveNodeMotor { get; }Authority 双端
csharp
public UnitMovementAuthority Authority { get; }IsActive 双端
csharp
public bool IsActive { get; }CanAcceptMoveIntent 双端
csharp
public bool CanAcceptMoveIntent { get; }CanAcceptPathing 双端
csharp
public bool CanAcceptPathing { get; }IsGrounded 双端
csharp
public bool IsGrounded { get; }CanJump 双端
csharp
public bool CanJump { get; }ExtraAirJumpCount 双端
csharp
public int ExtraAirJumpCount { get; }RemainingAirJumps 双端
csharp
public int RemainingAirJumps { get; }LastTransitionFailureReason 双端
csharp
public string? LastTransitionFailureReason { get; }LastJumpFailureReason 双端
csharp
public string? LastJumpFailureReason { get; }方法
GetMovementSignal 双端
csharp
public UnitMovementSignal GetMovementSignal()CreateInstance 双端
csharp
public static UnitMovementController CreateInstance(Entity content)Creates a movement controller component for the given Unit entity.
ApplyMovementControllerData 双端
csharp
public void ApplyMovementControllerData(GameDataUnitMovementController data)SetMode 双端
csharp
public bool SetMode(UnitMovementMode mode)Sets the requested movement mode using default options for any required motor setup.
SetMode 双端
csharp
public bool SetMode(UnitMovementMode mode, PhysicalCharacterMovementOptions? physicalOptions)Sets the requested movement mode and optional physical character setup options.
ReturnToSceneNavigation 双端
csharp
public bool ReturnToSceneNavigation()Returns this Unit to the navigation movement mode appropriate for its current scene.
ActivatePhysicalCharacter 双端
csharp
public bool ActivatePhysicalCharacter(PhysicalCharacterMovementOptions? physicalOptions = null, bool ensureStaticMeshColliders = true, bool ensureTerrainCollider = false)Activates physical character movement for this Unit in a 3D scene.
DeactivatePhysicalCharacter 双端
csharp
public bool DeactivatePhysicalCharacter(bool syncUnitPosition = true)Deactivates the configured physical character motor without destroying its node.
Think 双端
csharp
public void Think(int delta)DisposeManaged 双端
csharp
protected override void DisposeManaged()SetExtraAirJumpCount 双端
csharp
public void SetExtraAirJumpCount(int count)Sets how many additional jumps are allowed while airborne.
TryJump 双端
csharp
public bool TryJump(float? launchSpeed = null)Attempts to perform a physical character jump.
UnitMovementControllerExtensions 双端
命名空间 GameGraph.NodeSystem
csharp
public static class UnitMovementControllerExtensionsExtension helpers for attaching and querying Unit movement controllers.
方法
GetMovementController 双端
csharp
public static UnitMovementController? GetMovementController(this Unit unit)Gets the movement controller attached to a Unit, if present.
GetOrCreateMovementController 双端
csharp
public static UnitMovementController GetOrCreateMovementController(this Unit unit)Gets the movement controller attached to a Unit, creating it when absent.
UnitNodeBinding 双端
命名空间 GameGraph.NodeSystem
csharp
public sealed class UnitNodeBinding描述一个 Unit 与一个 GameGraph Node 之间的绑定关系。
备注
在 SCE 场景中,绑定到 Unit 的 replicated Node 会跟随该 Unit 的服务端视野可见性同步: Unit 对某个客户端不可见时,该客户端会收到绑定 Node 的移除事件且不再接收后续 transform/delta; Unit 重新可见时会重新收到绑定 Node 的完整创建同步。未绑定到 Unit 的 replicated Node 仍按所属 SCE 场景同步。
属性
Unit 双端
csharp
public Unit Unit { get; }Node 双端
csharp
public Node Node { get; }Role 双端
csharp
public UnitNodeBindingRole Role { get; }Key 双端
csharp
public string Key { get; }Mode 双端
csharp
public UnitNodeBindingMode Mode { get; set; }当前绑定的权威同步模式。
LocalOffset 双端
csharp
public Vector3 LocalOffset { get; set; }以 Unit 朝向为基准的本地偏移。XY 为地面平面,Z 为高度。
LocalRotation 双端
csharp
public Quaternion LocalRotation { get; set; }以 Unit 朝向为基准的本地旋转。
方法
SyncFromUnit 双端
csharp
public void SyncFromUnit()使用 Unit 当前的位置和朝向强制刷新绑定 Node。
SyncToUnit 仅服务端
csharp
public bool SyncToUnit(bool sync = false, bool syncDistance = false)使用 Node 当前的位置和朝向强制刷新绑定 Unit。
UnitNodeBindingExtensions 双端
命名空间 GameGraph.NodeSystem
csharp
public static class UnitNodeBindingExtensions方法
BindNode 双端
csharp
public static UnitNodeBinding BindNode(this Unit unit, Node node, UnitNodeBindingRole role = UnitNodeBindingRole.Root, string? key = null, UnitNodeBindingMode mode = UnitNodeBindingMode.Manual, Vector3? localOffset = null, Quaternion? localRotation = null, bool destroyNodeOnUnbind = false)将已有 Node 绑定到 Unit。默认不接管外部 Node 生命周期。
备注
如果被绑定的 Node 是 SCE 场景中的 replicated Node,它会随绑定 Unit 的视野可见性对各客户端创建或移除。
EnsureNodeBinding 双端
csharp
public static UnitNodeBinding? EnsureNodeBinding(this Unit unit, UnitNodeBindingRole role = UnitNodeBindingRole.Root, string? key = null, NodeReplication replication = NodeReplication.Replicated, UnitNodeBindingMode mode = UnitNodeBindingMode.UnitDriven, Vector3? localOffset = null, Quaternion? localRotation = null)获取或创建 Unit 的指定用途绑定 Node。
备注
创建出的 replicated Node 挂在当前 SCE 场景同步根下,并随绑定 Unit 的视野可见性对各客户端创建或移除。
GetNode 双端
csharp
public static Node? GetNode(this Unit unit, UnitNodeBindingRole role, string? key = null, bool createIfMissing = false)查询 Unit 的指定用途绑定 Node。createIfMissing 为 true 时会在 SCE 同步根下创建。
GetNodeBinding 双端
csharp
public static UnitNodeBinding? GetNodeBinding(this Unit unit, UnitNodeBindingRole role = UnitNodeBindingRole.Root, string? key = null)GetNodeBindings 双端
csharp
public static UnitNodeBinding[] GetNodeBindings(this Unit unit, UnitNodeBindingRole? role = null)SyncNodeBindingsFromUnit 双端
csharp
public static void SyncNodeBindingsFromUnit(this Unit unit, UnitNodeBindingRole? role = null)UnbindNode 双端
csharp
public static bool UnbindNode(this Unit unit, UnitNodeBindingRole role = UnitNodeBindingRole.Root, string? key = null, bool destroyOwnedNode = true)UnbindAllNodes 双端
csharp
public static void UnbindAllNodes(this Unit unit, bool destroyOwnedNodes = true)GetUnitNodeBinding 双端
csharp
public static UnitNodeBinding? GetUnitNodeBinding(this Node node)GetBoundUnit 双端
csharp
public static Unit? GetBoundUnit(this Node node)UnbindUnit 双端
csharp
public static bool UnbindUnit(this Node node, bool destroyOwnedNode = true)GetNode 双端
csharp
public static Node? GetNode(this PhysicsRaycastResult raycastResult)GetUnitNodeBinding 双端
csharp
public static UnitNodeBinding? GetUnitNodeBinding(this PhysicsRaycastResult raycastResult)GetBoundUnit 双端
csharp
public static Unit? GetBoundUnit(this PhysicsRaycastResult raycastResult)GetUnitNodeBinding 双端
csharp
public static UnitNodeBinding? GetUnitNodeBinding(this RigidBody rigidBody)GetBoundUnit 双端
csharp
public static Unit? GetBoundUnit(this RigidBody rigidBody)SyncUnitFromNode 仅服务端
csharp
public static bool SyncUnitFromNode(this UnitNodeBinding binding, bool sync = false, bool syncDistance = false)UnitNodeBindingMode 双端
命名空间 GameGraph.NodeSystem
csharp
public enum UnitNodeBindingModeUnit 与 GameGraph Node 的权威同步模式。
枚举值
UnitDriven— Unit 位置/朝向是权威源,绑定 Node 跟随 Unit。NodeDriven— Node/RigidBody 位置/朝向是权威源,Unit 跟随 Node。Manual— 只建立绑定、metadata 和反查关系,不做自动 transform 同步。
UnitNodeBindingRole 双端
命名空间 GameGraph.NodeSystem
csharp
public enum UnitNodeBindingRoleUnit 与 GameGraph Node 的绑定用途。
枚举值
RootQueryProxyHitboxHurtboxFirePointRaycastTargetCustomPhysicalCharacter
Viewport 双端
命名空间 GameGraph.NodeSystem
csharp
public sealed class Viewport : EngineObjectUrho3D Viewport 的 C# 封装,定义一个场景通过指定摄像机的渲染视图
构造函数
Viewport 双端
csharp
public Viewport(SceneGraph scene, CameraComponent camera)属性
Scene 双端
csharp
public SceneGraph? Scene { get; set; }设置或获取视口关联的场景
Camera 双端
csharp
public CameraComponent? Camera { get; set; }设置或获取视口关联的摄像机
CullCamera 双端
csharp
public CameraComponent? CullCamera { get; set; }可选的裁剪摄像机。未设置时使用 Camera。
Rect 双端
csharp
public (int left, int top, int right, int bottom) Rect { get; set; }当前视口矩形,依次为 left、top、right、bottom。
DrawDebug 双端
csharp
public bool DrawDebug { get; set; }是否绘制调试几何体
ViewClusterEnabled 双端
csharp
public bool ViewClusterEnabled { get; set; }方法
SetRect 双端
csharp
public void SetRect(int left, int top, int right, int bottom)设置视口渲染矩形区域(像素坐标)。全屏时使用 (0, 0, 0, 0)。 坐标相对于此 viewport 当前渲染目标:backbuffer 或 RenderTarget 纹理。 编辑器内调试时,主视口渲染目标是游戏画布 RenderTarget,不是编辑器窗口 backbuffer。
GetScreenRay 双端
csharp
public Ray GetScreenRay(int x, int y)WorldToScreenPoint 双端
csharp
public Vector2 WorldToScreenPoint(Vector3 worldPosition)ScreenToWorldPoint 双端
csharp
public Vector3 ScreenToWorldPoint(int x, int y, float depth)SetRenderPath 仅客户端
csharp
public bool SetRenderPath(UTF8String xmlPath)设置 renderpath(渲染管线 XML 资源路径)。决定渲染流水线的 pass 组合: scenepass 顺序、光照模型(Deferred vs Forward)、SSAO、雾效、shadow、xray、water 等可选 pass。 主视口、附加 Viewport 和 RenderToTexture Viewport 都应在初始化时分别显式设置; 不要依赖当前编辑器或客户端宿主提供的默认值。
xmlPath— renderpath XML 的资源路径。引擎自带的 path 都在EngineRes/RenderPaths/下。普通游戏镜头通常使用"EngineRes/RenderPaths/CEMapSSAO.xml"u8对齐独立客户端表现; 明确需要忽略雾的技术视图可使用编辑器同款"EngineRes/RenderPaths/EditorMapSSAOBloomHDR.xml"u8。
返回: true 成功;false 常见原因:资源加载失败(路径写错 / 文件不存在)
备注
使用场景:纯 GameGraph 装配的场景默认 renderpath 不一定启用 SSAO。如果想视觉对齐 编辑器数编场景(含接触阴影 / PBR 后处理表现),在 CameraComponent) 之后通过 GetMainViewport().SetRenderPath(...) 指定一个含 SSAO 的 renderpath。 引擎自带常用 renderpath 实测(截至 2026-08-15): EngineRes/RenderPaths/EditorMapSSAOBloomHDR.xml —— 编辑器主视口同款,Forward 光照 + SSAO;当前默认不呈现场景雾效 EngineRes/RenderPaths/CEMapSSAO.xml —— 游戏运行时默认,Forward 光照 + SSAO;会呈现场景雾效 EngineRes/RenderPaths/CEMapDeferred.xml —— Deferred 光照 + SSAO(名字带 Deferred 但同样有 SSAO) EngineRes/RenderPaths/EditorMapDeferred.xml —— 编辑器 Deferred + SSAO EngineRes/RenderPaths/CEMapUnderUISSAO.xml —— UI 之下变体,Forward + SSAO EngineRes/RenderPaths/GameOverlay.xml —— 直接附加 viewport 的透明叠加,只清理深度,不清理颜色,也不执行全屏后处理 前 5 个都有 SSAO;GameOverlay 用于叠加时不执行全屏后处理。真实差异主要是 Forward vs Deferred 光照模型 + 渲染顺序细节。 文件名里的 "BloomHDR" 等历史命名不一定与实际 pass 配置完全一致。 ⚠️ 多 Viewport 雾效差异:编辑器内嵌调试通常使用 EditorMapSSAOBloomHDR.xml,独立客户端和对战平台客户端通常使用 CEMapSSAO.xml。附加 Viewport 或 RTT Viewport 未调用本方法时,可能回退到宿主默认路径, 造成“编辑器里没有雾,客户端里有雾”的差异。远距离小地图镜头甚至可能整幅被雾遮住。 每个 Viewport 都应按用途显式选择 RenderPath,并通过 -no_debug_game_in_editor 或纯客户端调试完成最终渲染验收。 ⚠️ Runtime 切换限制:在 CameraComponent) 之后通过本方法切换 renderpath 可能触发 d3d11 framebuffer validation 错误(render thread 里,仅 debug layer 报警;release 不可见)。 实际渲染通常仍能继续,但 d3d11 调试层会拦警告。推荐 init 时只设一次,避免 runtime 频繁切换; 如果项目运行时确实需要切(例如赛博朋克 vs 写实风格切换),自行验证 d3d11 警告是否能容忍。
SetRenderPath 仅客户端
csharp
public void SetRenderPath(RenderPath renderPath)Assign an already assembled client-side RenderPath. The viewport keeps its own native reference; the caller may dispose the managed render-path wrapper after this call if it no longer needs it.
GetRenderPath 仅客户端
csharp
public RenderPath? GetRenderPath()Gets a retained wrapper for the current render path, if any.
EngineNodeComponent 双端
命名空间 GameGraph.NodeSystem.Component
csharp
public abstract class EngineNodeComponent : EngineObject, INodeComponent, IDisposable构造函数
EngineNodeComponent 双端
csharp
public EngineNodeComponent()属性
ObjectAnimation 仅客户端
csharp
public ObjectAnimation? ObjectAnimation { get; set; }AnimationEnabled 双端
csharp
public bool AnimationEnabled { get; set; }是否自动更新该组件已配置的属性动画。
Node 双端
csharp
public Node? Node { get; }IsEnabled 双端
csharp
public bool IsEnabled { get; set; }IsReplicated 双端
csharp
public bool IsReplicated { get; }Id 双端
csharp
public uint Id { get; }组件在所属场景中的引擎 ID。
IsEffectivelyEnabled 双端
csharp
public bool IsEffectivelyEnabled { get; }同时考虑组件自身与所属节点后的有效启用状态。
IsEffectivelyPaused 双端
csharp
public bool IsEffectivelyPaused { get; }同时考虑组件自身与所属节点后的有效暂停状态。
SceneGraph 双端
csharp
public SceneGraph? SceneGraph { get; }获取组件当前所属的底层 SceneGraph;未挂入场景时返回 null。
IsTemporary 双端
csharp
public bool IsTemporary { get; }是否在引擎场景序列化中将该组件视为临时对象。
备注
本文件中的 Serializable/Variant API 操作的是引擎组件注册属性,不替代 Unit 属性、PropertyObject 或 PropertyObjectHostComponent 的业务状态同步。
NumAttributes 双端
csharp
public uint NumAttributes { get; }NumNetworkAttributes 双端
csharp
public uint NumNetworkAttributes { get; }方法
RemoveObjectAnimation 仅客户端
csharp
public void RemoveObjectAnimation()SetAttributeAnimation 仅客户端
csharp
public void SetAttributeAnimation(string name, ValueAnimation? animation, ObjectAnimationWrapMode wrapMode = ObjectAnimationWrapMode.Loop, float speed = 1f)GetAttributeAnimation 仅客户端
csharp
public ValueAnimation? GetAttributeAnimation(string name)RemoveAttributeAnimation 仅客户端
csharp
public void RemoveAttributeAnimation(string name)GetAttributeAnimationWrapMode 仅客户端
csharp
public ObjectAnimationWrapMode GetAttributeAnimationWrapMode(string name)SetAttributeAnimationWrapMode 仅客户端
csharp
public void SetAttributeAnimationWrapMode(string name, ObjectAnimationWrapMode wrapMode)GetAttributeAnimationSpeed 仅客户端
csharp
public float GetAttributeAnimationSpeed(string name)SetAttributeAnimationSpeed 仅客户端
csharp
public void SetAttributeAnimationSpeed(string name, float speed)GetAttributeAnimationTime 仅客户端
csharp
public float GetAttributeAnimationTime(string name)SetAttributeAnimationTime 仅客户端
csharp
public void SetAttributeAnimationTime(string name, float time)SetAnimationTime 双端
csharp
public void SetAnimationTime(float time)手动设置该组件所有属性动画的时间位置。
SetPaused 双端
csharp
public void SetPaused(bool paused)设置组件的暂停状态。
MarkNetworkUpdate 双端
csharp
public void MarkNetworkUpdate()将组件标记为需要参与下一次引擎网络更新检查。
GetSiblingComponent 双端
csharp
public T? GetSiblingComponent<T>() where T : class, INodeComponent按同一节点上的组件类型获取首个兄弟组件。
SetTemporary 双端
csharp
public void SetTemporary(bool enable)ApplyAttributes 双端
csharp
public void ApplyAttributes()ResetAttributesToDefault 双端
csharp
public void ResetAttributesToDefault()RemoveInstanceAttributeDefaults 双端
csharp
public void RemoveInstanceAttributeDefaults()GetInterceptNetworkUpdate 双端
csharp
public bool GetInterceptNetworkUpdate(UTF8String attributeName)SetInterceptNetworkUpdate 双端
csharp
public void SetInterceptNetworkUpdate(UTF8String attributeName, bool enable)SetAttribute 双端
csharp
public bool SetAttribute(uint index, Variant value)SetAttribute 双端
csharp
public bool SetAttribute(UTF8String name, Variant value)GetAttribute 双端
csharp
public Variant GetAttribute(uint index)GetAttribute 双端
csharp
public Variant GetAttribute(UTF8String name)GetAttributeDefault 双端
csharp
public Variant GetAttributeDefault(uint index)GetAttributeDefault 双端
csharp
public Variant GetAttributeDefault(UTF8String name)GetAttributeInfo 双端
csharp
public SerializableAttributeInfo GetAttributeInfo(uint index)INodeComponent 双端
命名空间 GameGraph.NodeSystem.Component
csharp
public interface INodeComponent : IDisposable属性
Node 双端
csharp
public Node? Node { get; }IsEnabled 双端
csharp
public bool IsEnabled { get; set; }IsReplicated 双端
csharp
public bool IsReplicated { get; }方法
Setup 双端
csharp
void Setup()NodeComponentSnapshot 双端
命名空间 GameGraph.NodeSystem.Component
csharp
public readonly struct NodeComponentSnapshot : IEquatable<NodeComponentSnapshot>节点组件枚举快照。该对象不持有 native 引用,只描述调用时刻的组件状态。
属性
NativePtr 双端
csharp
public NativePtr NativePtr { get; }组件 native 指针。该指针不代表托管侧拥有 native 生命周期。
Node 双端
csharp
public Node? Node { get; }组件所属节点。
Id 双端
csharp
public uint Id { get; }组件在底层 Scene 中的 ID。
NodeId 双端
csharp
public uint NodeId { get; }所属节点在底层 Scene 中的 ID。
TypeHash 双端
csharp
public uint TypeHash { get; }组件 native 类型哈希。
IsReplicated 双端
csharp
public bool IsReplicated { get; }组件是否使用 replicated ID,参与引擎网络复制。
IsValid 双端
csharp
public bool IsValid { get; }native 指针是否非空。
方法
ToString 双端
csharp
public override string ToString()operator != 双端
csharp
public static bool operator !=(NodeComponentSnapshot left, NodeComponentSnapshot right)operator == 双端
csharp
public static bool operator ==(NodeComponentSnapshot left, NodeComponentSnapshot right)GetHashCode 双端
csharp
public override int GetHashCode()Equals 双端
csharp
public override bool Equals(object obj)Equals 双端
csharp
public bool Equals(NodeComponentSnapshot other)PropertyHostComponent 双端
命名空间 GameGraph.NodeSystem.Component
csharp
public abstract class PropertyHostComponent : DisposableObject, INodeComponent, IDisposable强类型同步属性组件基类:作为 Node 的托管组件挂载,承载一组按 SyncType 分级的网络同步属性。
备注
适用形态:位置/朝向放在 Node 上(客户端原生平滑),游戏数据放在本组件的属性上。两者按 node 关联, 但属性的可见性独立分级—— 逐属性可设 SyncType(Self/Ally/All),见 SetPropertySyncType<TProperty>; 属性只会发送给「能看到该 node 的玩家」(即 node 所在场景图的当前订阅玩家集); 因此「看得到 node、不一定看得到其私有属性」:不在本端可见范围内的属性读到默认值。 到达时机:本组件与 node 走两条独立的同步流,组件可能晚于 node 到达。客户端取用须容忍尚未就绪—— 用 node.OnPropertyHostReady<T>(...) 或 node.TryGetPropertyHost<T>(out var host), 不可假设「node 在 ⇒ 属性在」。 生命周期:销毁 node 会自动带走本组件并释放其同步属性;无需手动镜像收件人——属性受众随场景图的发布/掉线实时变化。 用法:派生一个强类型组件,用 GetProperty``2(``0) / SetProperty<TProperty,TValue> 暴露属性: public sealed class Bird : PropertyHostComponent { public float Score { get => GetProperty<PropertyBird, float>(PropertyBird.Score); #if SERVER set => SetProperty<PropertyBird, float>(PropertyBird.Score, value); #endif } } #if SERVER var bird = node.AddPropertyHost<Bird>(player, SyncType.All); bird.Score = 10; #endif #if CLIENT node.OnPropertyHostReady<Bird>(b => Render(b.Score)); #endif
构造函数
PropertyHostComponent 双端
csharp
protected PropertyHostComponent()框架构造用的无参构造函数。组件由框架在关联 node 与同步属性后构造,作者不应直接 new。
属性
Node 双端
csharp
public Node? Node { get; }挂载本组件的 Node。未初始化时为 null。
Owner 双端
csharp
public Player Owner { get; }本组件所属玩家。
IsValid 双端
csharp
public override bool IsValid { get; }IsEnabled 双端
csharp
public bool IsEnabled { get; set; }IsReplicated 双端
csharp
public bool IsReplicated { get; }方法
OnInitialize 双端
csharp
protected virtual void OnInitialize()组件就绪(已关联 node 与同步属性)后触发一次。派生类可重写以做初始化。
GetProperty 双端
csharp
protected TValue GetProperty<TProperty, TValue>(TProperty property) where TProperty : IExtendableEnum读取一条同步属性。不在本端可见范围内或属性未就绪时返回默认值。
DisposeManaged 双端
csharp
protected override void DisposeManaged()释放本组件:服务端一并释放其同步属性(收件人随之消失);客户端仅解除引用。
备注
本方法不自行从 node 的组件列表移除自身(避免 node 销毁遍历组件时并发修改集合)。 只想移除本组件请用 node.RemovePropertyHost<T>();销毁 node 会自动带走本组件并触发本方法。
RegisterPropertySyncTypes 仅服务端
csharp
protected virtual void RegisterPropertySyncTypes()框架在关联完成、OnInitialize 之前调用(仅服务端)。codegen 生成的属性组件重写此方法, 用 SyncType) 声明各属性的同步范围,使其在首次写入前就位、 初始快照即按目标范围分发。作者请重写 OnInitialize 做自定义初始化,勿动此方法。
SetProperty 仅服务端
csharp
protected void SetProperty<TProperty, TValue>(TProperty property, TValue value) where TProperty : IExtendableEnum写入一条同步属性(仅服务端)。
SetPropertySyncType 仅服务端
csharp
protected void SetPropertySyncType<TProperty>(TProperty property, SyncType syncType) where TProperty : IExtendableEnum设置某条属性的同步范围(仅服务端)。默认所有属性为 All。
备注
典型用途:把私有数据(如背包)设为 Self,使其只同步给 owner,敌方收不到字节(反作弊)。 建议在该属性首次写入后调用:未写入过的属性此刻没有值/快照可同步,且同步范围的变更要等该属性被初始化后才会推送; 先写一次再设范围,可确保范围覆盖既作用于已有数据、又能在该属性的初始快照里就按目标范围正确分发。
PropertyHostComponentExtensions 双端
命名空间 GameGraph.NodeSystem.Component
csharp
public static class PropertyHostComponentExtensions在 Node 上挂载 / 取用强类型同步属性组件(PropertyHostComponent)的扩展方法。
备注
服务端 AddPropertyHost<T>:在 node 上创建并挂载一个属性组件,其属性只发送给能看到该 node 的玩家。 客户端 Action{``0}) / Node,``0@):取用属性组件; 组件可能晚于 node 到达,二者均容忍尚未就绪。
方法
TryGetPropertyHost 双端
csharp
public static bool TryGetPropertyHost<T>(this Node node, out T host) where T : PropertyHostComponent, new()尝试取回 node 上的属性组件。组件未就绪(可能晚于 node 到达)时返回 false(不抛异常)。
OnPropertyHostReady 双端
csharp
public static void OnPropertyHostReady<T>(this Node node, Action<T> callback) where T : PropertyHostComponent, new()当 node 的属性组件就绪时回调一次。已就绪则立即回调;客户端若组件尚未到达,则登记等待,到达后由框架构造再回调。
AddPropertyHost 仅服务端
csharp
public static T AddPropertyHost<T>(this Node node, Player owner, SyncType syncType = SyncType.All) where T : PropertyHostComponent, new()在 node 上创建并挂载一个强类型同步属性组件(仅服务端)。组件的属性只会发送给能看到该 node 的玩家 (即 node 所在场景图的当前订阅玩家集),并可逐属性按 SyncType 再分级。
node— 承载属性的 node;应身处一个可发布的场景图下,门控才生效。owner— 属性组件的所属玩家。syncType— 属性的目标同步范围。
返回: 创建好的属性组件;已存在则幂等返回原有组件。
备注
发布(graph.Publish(player))由作者按需调用,与本方法顺序无关:受众每帧自动对账,发布在挂载之后亦会下一帧自动纳入。 node 不在任何场景图下时仍可挂载,但属性受众退化为纯 SyncType(不受 node 可见性门控)。
RemovePropertyHost 仅服务端
csharp
public static bool RemovePropertyHost<T>(this Node node) where T : PropertyHostComponent, new()移除 node 上的某个属性组件(保留 node),并释放其同步属性。通常无需调用——销毁 node 会自动带走属性组件。
SplineInterpolationMode 双端
命名空间 GameGraph.NodeSystem.Component
csharp
public enum SplineInterpolationMode样条插值模式。
枚举值
BezierCurveCatmullRomCurveLinearCurveCatmullRomFullCurve
SplinePath 双端
命名空间 GameGraph.NodeSystem.Component
csharp
public sealed class SplinePath : EngineNodeComponent, INodeComponent, IDisposable由一组控制点驱动节点沿样条移动的场景组件。
构造函数
SplinePath 双端
csharp
public SplinePath()属性
InterpolationMode 双端
csharp
public SplineInterpolationMode InterpolationMode { get; set; }Speed 双端
csharp
public float Speed { get; set; }Length 双端
csharp
public float Length { get; }Position 双端
csharp
public Vector3 Position { get; }ControlledNode 双端
csharp
public Node? ControlledNode { get; set; }IsFinished 双端
csharp
public bool IsFinished { get; }方法
AddControlPoint 双端
csharp
public void AddControlPoint(Node point, uint index = uint.MaxValue)RemoveControlPoint 双端
csharp
public void RemoveControlPoint(Node point)ClearControlPoints 双端
csharp
public void ClearControlPoints()SetPosition 双端
csharp
public void SetPosition(float factor)GetPoint 双端
csharp
public Vector3 GetPoint(float factor)Move 双端
csharp
public void Move(float timeStep)Reset 双端
csharp
public void Reset()AudioManager 仅客户端
命名空间 GameGraph.NodeSystem.Component.Audio
csharp
public static class AudioManager全局音频控制。管理主音量和活跃监听器。
属性
SampleSize 仅客户端
csharp
public static uint SampleSize { get; }MixRate 仅客户端
csharp
public static int MixRate { get; }Interpolation 仅客户端
csharp
public static bool Interpolation { get; }Stereo 仅客户端
csharp
public static bool Stereo { get; }Playing 仅客户端
csharp
public static bool Playing { get; }Initialized 仅客户端
csharp
public static bool Initialized { get; }方法
SetMode 仅客户端
csharp
public static bool SetMode(int bufferLengthMilliseconds, int mixRate, bool stereo, bool interpolation = true)Play 仅客户端
csharp
public static bool Play()Stop 仅客户端
csharp
public static void Stop()SetMasterGain 仅客户端
csharp
public static void SetMasterGain(string type, float gain)设置指定声音类型的主音量
type— 声音类型(如 "Effect"、"Music"、"Ambient")gain— 音量(0.0 ~ 1.0)
GetMasterGain 仅客户端
csharp
public static float GetMasterGain(string type)获取指定声音类型的主音量
HasMasterGain 仅客户端
csharp
public static bool HasMasterGain(string type)Pause 仅客户端
csharp
public static void Pause(string type)Resume 仅客户端
csharp
public static void Resume(string type)IsPaused 仅客户端
csharp
public static bool IsPaused(string type)ResumeAll 仅客户端
csharp
public static void ResumeAll()StopSound 仅客户端
csharp
public static void StopSound(SoundResource sound)SetListener 仅客户端
csharp
public static void SetListener(SoundListenerComponent listener)设置活跃的 3D 声音监听器
GetListener 仅客户端
csharp
public static SoundListenerComponent? GetListener()获取当前活跃的 3D 声音监听器
GetSoundSources 仅客户端
csharp
public static SoundSourceComponent[] GetSoundSources()字段
Master 仅客户端
csharp
public const string MasterEffect 仅客户端
csharp
public const string EffectAmbient 仅客户端
csharp
public const string AmbientVoice 仅客户端
csharp
public const string VoiceMusic 仅客户端
csharp
public const string MusicSoundListenerComponent 双端
命名空间 GameGraph.NodeSystem.Component.Audio
csharp
public class SoundListenerComponent : EngineNodeComponent, INodeComponent, IDisposable声音监听器组件。挂载到相机或玩家 Node 上,标记为 3D 音频的听者位置。 一个场景同时只有一个活跃监听器。
构造函数
SoundListenerComponent 双端
csharp
public SoundListenerComponent()SoundSource3DComponent 双端
命名空间 GameGraph.NodeSystem.Component.Audio
csharp
public class SoundSource3DComponent : SoundSourceComponent, INodeComponent, IDisposable3D 空间音源组件。继承 SoundSourceComponent 的所有播放能力,并增加距离/方向衰减参数。 Node 的世界位置决定声源位置。
构造函数
SoundSource3DComponent 双端
csharp
public SoundSource3DComponent()属性
NearDistance 双端
csharp
public float NearDistance { get; set; }近距离(此范围内不衰减)
FarDistance 双端
csharp
public float FarDistance { get; set; }远距离(此范围外完全静音)
InnerAngle 双端
csharp
public float InnerAngle { get; set; }内锥角度(此角度内不衰减,默认 360 = 全方向)
OuterAngle 双端
csharp
public float OuterAngle { get; set; }外锥角度(此角度外完全衰减,默认 360 = 全方向)
RolloffFactor 双端
csharp
public float RolloffFactor { get; set; }滚降因子,控制衰减曲线形状
方法
SetDistanceAttenuation 双端
csharp
public void SetDistanceAttenuation(float nearDistance, float farDistance, float rolloffFactor)SetAngleAttenuation 双端
csharp
public void SetAngleAttenuation(float innerAngle, float outerAngle)CalculateAttenuation 双端
csharp
public void CalculateAttenuation()SoundSourceComponent 双端
命名空间 GameGraph.NodeSystem.Component.Audio
csharp
public class SoundSourceComponent : EngineNodeComponent, INodeComponent, IDisposable2D 音源组件(无空间衰减)。挂载到 Node 上播放音频。
构造函数
SoundSourceComponent 双端
csharp
public SoundSourceComponent()SoundSourceComponent 双端
csharp
protected SoundSourceComponent(string objectType)属性
IsPlaying 双端
csharp
public bool IsPlaying { get; }Sound 仅客户端
csharp
public SoundResource? Sound { get; }TimePosition 双端
csharp
public float TimePosition { get; }当前播放位置(秒)
SoundType 双端
csharp
public string SoundType { get; set; }声音类型分组(用于全局音量控制,如 "Effect"、"Music")
Frequency 双端
csharp
public float Frequency { get; set; }播放频率(Hz)
Gain 双端
csharp
public float Gain { get; set; }音量(0.0 静音 ~ 1.0 满音量)
Attenuation 双端
csharp
public float Attenuation { get; set; }衰减系数(1.0 = 不衰减)
Panning 双端
csharp
public float Panning { get; set; }立体声平移(-1.0 左 ~ 1.0 右)
AutoRemoveMode 双端
csharp
public AutoRemoveMode AutoRemoveMode { get; set; }播放完成后的自动移除模式
MixOutput 双端
csharp
public bool MixOutput { get; set; }是否将音频采样混合到音频输出缓冲区。 引擎底层默认为 false(用于屏幕外音源优化),构造函数已自动设为 true。 设为 false 时 IsPlaying 仍返回 true,但不会产生实际音频输出。
方法
Play 仅客户端
csharp
public void Play(SoundResource sound)播放音频资源
Play 仅客户端
csharp
public void Play(SoundResource sound, float frequency)以指定频率播放
Play 仅客户端
csharp
public void Play(SoundResource sound, float frequency, float gain)以指定频率和音量播放
Play 仅客户端
csharp
public void Play(SoundResource sound, float frequency, float gain, float panning)以指定频率、音量和立体声位置播放
Stop 双端
csharp
public void Stop()Seek 双端
csharp
public void Seek(float time)跳转到指定时间(秒)
AdditionModelAttachment 仅客户端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public sealed class AdditionModelAttachment : DisposableObject一次附加模型挂载的生命周期句柄。
属性
IsAttached 仅客户端
csharp
public bool IsAttached { get; }挂载是否仍由此句柄持有。
方法
Detach 仅客户端
csharp
public void Detach()立即解除挂载;可重复调用。
DisposeUnmanaged 仅客户端
csharp
protected override void DisposeUnmanaged(bool finalizing)AdditionModelOptions 仅客户端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public sealed class AdditionModelOptions客户端 Prefab-backed 附加模型的挂载选项。
构造函数
AdditionModelOptions 仅客户端
csharp
public AdditionModelOptions()属性
CullHostMesh 仅客户端
csharp
public bool CullHostMesh { get; init; }是否按附加模型参与宿主网格裁剪。仅对支持裁剪资源的附加模型生效。
AnimatedModelComponent 仅客户端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public class AnimatedModelComponent : StaticMeshComponent, INodeComponent, IDisposable骨骼动画模型组件。挂载带骨架的 Mesh (.mdl),配合 AnimationController 驱动播放动画。
备注
同节点上需配合 AnimationController 才能播放动画。直接设置 Mesh 会以默认参数建立骨架;如需控制骨架创建行为,调用 Boolean) 或 Mesh)。 与 Actor 体系的关系:ActorModel 与本 wrapper 操作同一个底层骨骼模型对象。 可通过 actor.GetAnimatedModel() 扩展方法从 Actor 下钻到本 wrapper。
构造函数
AnimatedModelComponent 仅客户端
csharp
public AnimatedModelComponent()属性
Mesh 仅客户端
csharp
public new Mesh? Mesh { get; set; }设置/获取 Mesh(带骨架的 .mdl)。设置时自动建立骨架(createBones = true)。
AnimationLodBias 仅客户端
csharp
public float AnimationLodBias { set; }动画 LOD 偏置。越大越激进地按距离降低动画更新频率。
UpdateInvisible 仅客户端
csharp
public bool UpdateInvisible { get; set; }不可见时是否继续更新动画与包围盒。布娃娃等物理驱动模型建议设为 true。
ComputeShaderSkinning 仅客户端
csharp
public bool ComputeShaderSkinning { get; set; }是否启用 Compute Shader 蒙皮(性能开关,需 GPU 支持)。
SimpleSkinning 仅客户端
csharp
public bool SimpleSkinning { get; set; }是否启用普通硬件骨骼蒙皮。
备注
普通蒙皮把骨骼矩阵直接传入顶点着色器,受设备最大骨骼数限制;启用后优先于 ComputeShaderSkinning。关闭普通蒙皮和 Compute Shader 后,CE 模型使用 默认的纹理蒙皮路径。骨骼数超过设备上限时设置为 true 会被拒绝并保持关闭。 此属性需要客户端能力版本 3;旧客户端上读为 false,写入会被忽略。
TrackOptimizationEnabled 仅客户端
csharp
public bool TrackOptimizationEnabled { get; set; }是否启用动画轨道优化(对始终不变的骨骼跳过采样以提升性能)。
NumAnimationStates 仅客户端
csharp
public uint NumAnimationStates { get; }NumBones 仅客户端
csharp
public uint NumBones { get; }骨骼总数。模型未加载骨架时返回 0。
RootBoneIndex 仅客户端
csharp
public uint RootBoneIndex { get; }根骨骼索引。模型未加载骨架时返回 MaxValue。
方法
AttachAdditionModel 仅客户端
csharp
public AdditionModelAttachment AttachAdditionModel(GameCore.ResourceType.Prefab additionPrefab, AdditionModelOptions? options = null)在当前 Prefab-backed 宿主骨骼模型上挂载一个 Prefab-backed 附加模型。 当前组件必须是宿主 Prefab 的主骨骼模型;同一 Node 上存在多个模型时,调用方通过 持有的具体 AnimatedModelComponent 显式选择宿主。
AttachAdditionModel 仅客户端
csharp
public AdditionModelAttachment AttachAdditionModel(GameGraph.ResourceSystem.Prefab additionPrefab, AdditionModelOptions? options = null)在当前宿主上挂载已加载的 Prefab-backed 附加模型。
SetModel 仅客户端
csharp
public void SetModel(Mesh mesh, bool createBones = true)完整设置 Mesh,可指定是否自动创建骨节点。
mesh— 带骨架的 .mdl 资源createBones— 是否自动创建骨节点(场景图层级)。默认 true
SetModelWithoutSkeleton 仅客户端
csharp
public void SetModelWithoutSkeleton(Mesh mesh)设置 Mesh 但不建立骨架。用于把骨骼模型当作纯静态模型使用,性能更好。
UpdateBoneBoundingBox 仅客户端
csharp
public void UpdateBoneBoundingBox()手动触发骨骼包围盒重算。一般由内部调用;渲染前需要最新包围盒时可手动调用。
Move 仅客户端
csharp
public void Move(Vector3 delta)应用根运动位移(root motion)。
AddAnimationState 仅客户端
csharp
public AnimationState? AddAnimationState(AnimationResource animation, bool allowDuplicates = false)Adds an animation state directly to this model.
GetAnimationState 仅客户端
csharp
public AnimationState? GetAnimationState(AnimationResource animation)GetAnimationState 仅客户端
csharp
public AnimationState? GetAnimationState(AnimationHandle handle)GetAnimationStateByIndex 仅客户端
csharp
public AnimationState? GetAnimationStateByIndex(uint index)GetAnimationStates 仅客户端
csharp
public AnimationState[] GetAnimationStates()RemoveAnimationState 仅客户端
csharp
public void RemoveAnimationState(AnimationState state)RemoveAllAnimationStates 仅客户端
csharp
public void RemoveAllAnimationStates()ApplyAnimation 仅客户端
csharp
public void ApplyAnimation()Immediately applies all current animation states to the skeleton.
GetBoneNode 仅客户端
csharp
public Node? GetBoneNode(string boneName)按真实骨骼名查找对应的场景 Node。返回的 Node 可用于挂载子节点。 挂点名(如 "socket_weapon_r")应使用 String) 查询,以保留挂点变换。
返回: 对应骨骼的场景节点;骨骼不存在时返回 null
GetSocket 仅客户端
csharp
public Socket? GetSocket(string socketName)按名称查找挂点(Socket),返回 Socket 含骨骼 Node + 相对偏移信息。 预制体实例优先读取当前骨架下的挂点节点,未找到时读取模型 XML 挂点。
socketName— 挂点名(建模时定义的 socket,例如"socket_weapon_r")
返回: 挂点信息;socket 不存在或未绑定骨骼时返回 null
备注
单次调用一次性返回完整 socket 信息(bone node + 3 个 transform)。 典型用法: var socket = animatedModel.GetSocket("socket_weapon_r"); if (socket.HasValue) { var swordNode = socket.Value.BoneNode.CreateChild("Sword"); swordNode.LocalPosition = socket.Value.LocalPosition; swordNode.LocalRotation = socket.Value.LocalRotation; swordNode.LocalScale = socket.Value.LocalScale; }
GetBoneIndex 仅客户端
csharp
public uint? GetBoneIndex(string boneName)GetBoneIndexByHash 仅客户端
csharp
public uint? GetBoneIndexByHash(uint boneNameHash)GetBoneName 仅客户端
csharp
public string GetBoneName(uint index)GetBoneNameHash 仅客户端
csharp
public uint GetBoneNameHash(uint index)GetBoneByIndex 仅客户端
csharp
public Bone? GetBoneByIndex(uint index)按 index 取骨骼快照。index 越界或模型未加载骨架时返回 null。
GetBoneByName 仅客户端
csharp
public Bone? GetBoneByName(string boneName)按名称取骨骼快照。骨骼不存在时返回 null。
ComputeBakedAnimationPath 仅客户端
csharp
public string ComputeBakedAnimationPath(string animName)拼接当前模型的烘焙动画路径:anim/{modelName}/{animName}(小写)。 编辑器对 Humanoid 模型执行动画烘焙后,重定向后的动画会按这个约定路径输出。 用户面无需关心 Actor 体系内部的路径解析逻辑 —— 知道动画名 + 想要烘焙版时调此方法。
animName— 原始动画名(不带烘焙路径),例如"run.ani"
返回: 烘焙路径字符串,可直接交给 Single) 或 Animation)。模型未加载时返回 string.Empty。
备注
不做存在性检查 —— 返回的是按约定拼接的候选路径。烘焙资源是否存在由 ResourceCache 在实际 Load / Play 时判定;如果不存在,请回退到 原值 或检查项目 res/anim/<ModelName>/ 下是否包含该烘焙输出。 与 Actor 层 ModelActor::GetAnimationPath_Redirect 走的是同一约定路径,但 不依赖 Actor 体系,仅依赖当前模型挂载的 Mesh 资源路径。
SetBoneFacing 仅客户端
csharp
public bool SetBoneFacing(string boneName, float yaw)设置骨骼朝向偏移(yaw 角,弧度)。常用于上半身转向、瞄准等场景。
boneName— 骨骼名(通常是脊椎根,如"bone_spine_01")yaw— 额外的 yaw 旋转
返回: 是否成功(骨骼存在且模型支持)
备注
仅在使用 CE_SKIN(默认骨骼蒙皮)时生效。其他变体(CEG/CEGX/CEGP)下行为未定义。
SetBoneFacing 仅客户端
csharp
public bool SetBoneFacing(string boneName, Quaternion rotation)3-axis 版本的骨骼朝向偏移。常用于瞄准 / 看向某方向 / 仰头低头 / 倾斜上半身 等 单一 yaw 无法表达的场景。
boneName— 骨骼名(通常是脊椎根,如"Bip001 Spine1")rotation— 在 root local frame 中应用的额外旋转。语义与 yaw 版本对齐—— yaw 版本相当于rotation = Quaternion.CreateFromYawPitchRoll(0, 0, yaw)。
备注
仅在使用 CE_SKIN(默认骨骼蒙皮)时生效。其他变体(CEG/CEGX/CEGP)下行为未定义。 调 String) 可清除(与 yaw 版本共享同一 helper Node)。
CancelBoneFacing 仅客户端
csharp
public void CancelBoneFacing(string boneName)取消之前对指定骨骼的朝向偏移设置。
SetBonePostProcessTransform 仅客户端
csharp
public bool SetBonePostProcessTransform(string boneName, Vector3 localPosition, Quaternion localRotation, Vector3 localScale)设置骨骼的 PostProcess transform(local space)。
boneName— 骨骼名localPosition— 在该骨骼 local space 中的位置偏移localRotation— 在该骨骼 local space 中的旋转偏移localScale— 本骨骼的 scale(只允许 local space)
备注
PostProcess transform 在动画 sample 完成之后、骨骼 skinning 之前应用, 由星火动画后处理阶段在每帧处理一次。常用于: IK solver 输出(脚步贴地、手部 grasp) 布娃娃 / 物理模拟的骨骼姿态覆盖 永久骨骼调整(角色比例微调) 一次性 set 三字段(pos/rot/scale)+ 自动置 bPostProcess_ = true,一次 WASM 调用搞定。 与 Single) 完全不同——后者改 helper Node 的 IndieRotation 在 Node transform 计算阶段生效;本方法改 Bone 结构体的 postProcess 字段在 skinning 阶段生效。
SetBonePostProcessTransform 仅客户端
csharp
public bool SetBonePostProcessTransform(uint boneIndex, Vector3 localPosition, Quaternion localRotation, Vector3 localScale)按 index 设置骨骼 PostProcess transform。
SetBonePostProcessWorldTransform 仅客户端
csharp
public bool SetBonePostProcessWorldTransform(string boneName, Vector3 worldPosition, Quaternion worldRotation)设置骨骼 PostProcess transform 的 position + rotation(world space)。 native 端用 bone node 的 world transform inverse 把 world 坐标转回 local 后存储。
备注
scale 没有 world 版本(native 注释:"只允许Local Space的scale"),需要 scale 时走 local 版本。 典型用法:solver 在 world space 计算出目标 pose 后直接传入,省自己换算。
SetBonePostProcessPosition 仅客户端
csharp
public bool SetBonePostProcessPosition(string boneName, Vector3 localPosition)仅设置 PostProcess position(local space)。其他字段不变。
SetBonePostProcessRotation 仅客户端
csharp
public bool SetBonePostProcessRotation(string boneName, Quaternion localRotation)仅设置 PostProcess rotation(local space)。其他字段不变。
SetBonePostProcessScale 仅客户端
csharp
public bool SetBonePostProcessScale(string boneName, Vector3 localScale)仅设置 PostProcess scale(local space)。其他字段不变。
ClearBonePostProcessTransform 仅客户端
csharp
public bool ClearBonePostProcessTransform(string boneName)清除指定骨骼的 PostProcess transform(重置 pos = 0 / rot = identity / scale = 1,bPostProcess_ = false)。
ClearAllBonesPostProcessTransform 仅客户端
csharp
public void ClearAllBonesPostProcessTransform()批量清除骨架上所有骨骼的 PostProcess transform。 调 native Skeleton::ClearBonesPostProcessTransform,比逐个清更高效。
SetBoneAnimated 仅客户端
csharp
public bool SetBoneAnimated(string boneName, bool animated)设置骨骼的 animated 标志。false 时该骨骼跨所有动画都被跳过 apply(在动画 update 阶段直接 continue)。
备注
与 UTF8String) / UTF8String) 的 stateTracks_ 遮罩不同——遮罩是 per-animation 的;本标志是 per-bone 的 enable,跨所有播放中的动画生效。
AnimatedSprite2D 仅客户端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public sealed class AnimatedSprite2D : StaticSprite2D, INodeComponent, IDisposablePlays Spriter or Spine 2D animation inside a GameGraph scene.
备注
AnimatedSprite2D is a client-side visual component. It renders the animation as world-space 2D geometry transformed by its node; it is not an automatic billboard. With a perspective camera, it has normal near/far perspective scaling and can be depth-tested against 3D scene content. The default Urho2D material is unlit, so scene lights and shadows do not change the sprite color; use Color and Alpha for manual tinting and fading.
构造函数
AnimatedSprite2D 仅客户端
csharp
public AnimatedSprite2D()Creates an AnimatedSprite2D component.
属性
AnimationSet 仅客户端
csharp
public AnimationSet2D? AnimationSet { get; set; }Gets or sets the Spriter or Spine animation set to play.
备注
Load this value with String). Assigning a new animation set resets the currently selected animation.
Animation 仅客户端
csharp
public string Animation { get; set; }Gets or sets the current animation name.
备注
Setting this property uses Default. Use LoopMode2D) when you need to force looping or clamping.
Entity 仅客户端
csharp
public string Entity { get; set; }Gets or sets the Spriter entity name, or the Spine skin name for Spine resources.
备注
For Spriter .scml resources, this selects the entity in the SCML file. For Spine resources, this uses the same native field to select the skin; prefer Skin in new Spine code for clearer intent. If left empty, the runtime uses the default or first entity/skin.
Skin 仅客户端
csharp
public string Skin { get; set; }Gets or sets the Spine skin name.
备注
This is a semantic alias of Entity for Spine animation sets. It does not create an additional tint or material channel.
LoopMode 仅客户端
csharp
public LoopMode2D LoopMode { get; set; }Gets or sets the loop mode used for the current animation.
Speed 仅客户端
csharp
public float Speed { get; set; }Gets or sets the playback speed multiplier.
备注
1 is normal speed, 0.5 is half speed, and 2 is double speed.
方法
SetAnimation 仅客户端
csharp
public void SetAnimation(string name, LoopMode2D loopMode = LoopMode2D.Default)Selects and starts an animation.
name— Animation name fromAnimationSet.loopMode— Loop mode override. The default uses the animation data.
SetSkin 仅客户端
csharp
public void SetSkin(string skinName)Sets the Spine skin name.
skinName— Skin name from the Spine skeleton.
GetSpineInstance 仅客户端
csharp
public SpineInstance GetSpineInstance()Gets the Spine animation state and skeleton for this component.
备注
Set a Spine animation set before calling this method. Subscribe to events before starting playback to receive the initial OnStart callback. The returned instance follows this component when its animation set changes; previously obtained track entries, bones, and slots must not be kept across a change.
DisposeManaged 仅客户端
csharp
protected override void DisposeManaged()事件
OnStart 仅客户端
csharp
public event Action<SpineTrackEntry>? OnStart动画开始播放。
OnInterrupt 仅客户端
csharp
public event Action<SpineTrackEntry>? OnInterrupt动画被中断。
OnEnd 仅客户端
csharp
public event Action<SpineTrackEntry>? OnEnd动画播放结束。
OnComplete 仅客户端
csharp
public event Action<SpineTrackEntry>? OnComplete动画完成一次循环。
OnDispose 仅客户端
csharp
public event Action<SpineTrackEntry>? OnDispose动画轨道被销毁。
OnEvent 仅客户端
csharp
public event Action<SpineTrackEntry, SpineEvent>? OnEventSpine 自定义事件。
AnimationBlendMode 仅客户端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public enum AnimationBlendMode动画混合模式。
枚举值
Lerp— 线性混合(默认)。多个动画按权重在最终姿态上插值。Additive— 加法混合。基于绑定姿态的差值叠加,用于在基础动画上叠瞄准/呼吸等增量动画。
AnimationController 仅客户端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public class AnimationController : EngineNodeComponent, INodeComponent, IDisposable驱动 AnimatedModelComponent 播放骨骼动画的组件。
备注
同节点上需先添加 AnimatedModelComponent。 两套 API: 快路径:用 AnimationHandle(uint hash)—— 全程零字符串 marshaling, 适合每帧调用的 SetTime / SetWeight / SetSpeed 等热点路径。 便利路径:用 Animation 字符串路径 —— 每次调用付一次 C# 端 SDBM hash + uint marshaling 开销(无 string marshaling), 适合一次性查询或控制。 与 Actor 体系的关系:ActorModel 通过 IActorAnimationPlayable.PlayAnimation(...) 等接口播放的动画与本 wrapper 操作同一个底层动画控制器。 可通过 actor.GetAnimationController() 扩展方法从 Actor 下钻到本 wrapper,双向控制等价。
构造函数
AnimationController 仅客户端
csharp
public AnimationController()属性
NumAnimationStates 仅客户端
csharp
public uint NumAnimationStates { get; }TopLayerAnimationState 仅客户端
csharp
public AnimationState? TopLayerAnimationState { get; }NumAnimations 仅客户端
csharp
public uint NumAnimations { get; }Number of controller entries, including entries that are fading out.
IsPlayStep 仅客户端
csharp
public bool IsPlayStep { get; }TimeStep 仅客户端
csharp
public float TimeStep { get; }IsStopping 仅客户端
csharp
public bool IsStopping { get; }是否所有动画都即将停止或已停止(targetWeightTotal == 0),可用于防止意外定格。
方法
Play 仅客户端
csharp
public AnimationHandle? Play(Animation animation, byte layer = 0, bool looped = true, float fadeInTime = 0f, float fadeOutTime = 0f)播放动画并淡入到目标权重 1.0。
animation— 动画资源路径layer— 混合层,相同层的动画互相替换;不同层叠加(如下半身行走 + 上半身挥手)looped— 是否循环fadeInTime— 淡入时间(秒)。0 表示立即生效fadeOutTime— 淡出时间(秒),仅在 PlayExclusive 风格下生效,常规 Play 传 0 即可
返回: 成功时返回动画句柄(用于后续高频访问);失败返回 null
PlayExclusive 仅客户端
csharp
public AnimationHandle? PlayExclusive(Animation animation, byte layer = 0, bool looped = true, float fadeInTime = 0f, float fadeOutTime = 0f)播放动画并淡出同层其他动画。
Stop 仅客户端
csharp
public bool Stop(AnimationHandle handle, float fadeOutTime = 0f)停止指定动画。
handle— 动画句柄fadeOutTime— 淡出时间(秒)。0 表示立即停止
Stop 仅客户端
csharp
public bool Stop(Animation animation, float fadeOutTime = 0f)StopLayer 仅客户端
csharp
public void StopLayer(byte layer, float fadeOutTime = 0f)停止指定层上的所有动画。
StopLayerRange 仅客户端
csharp
public void StopLayerRange(byte beginLayer, byte endLayer, float fadeOutTime = 0f)停止指定层区间内的所有动画(左开右闭)。
StopAll 仅客户端
csharp
public void StopAll(float fadeOutTime = 0f)停止所有动画。
Fade 仅客户端
csharp
public bool Fade(AnimationHandle handle, float targetWeight, float fadeTime)把动画淡入到指定目标权重。
Fade 仅客户端
csharp
public bool Fade(Animation animation, float targetWeight, float fadeTime)FadeOthers 仅客户端
csharp
public bool FadeOthers(AnimationHandle handle, float targetWeight, float fadeTime)把同层其他动画淡到指定目标权重。
FadeOthers 仅客户端
csharp
public bool FadeOthers(Animation animation, float targetWeight, float fadeTime)SetLayer 仅客户端
csharp
public bool SetLayer(AnimationHandle handle, byte layer)SetLayer 仅客户端
csharp
public bool SetLayer(Animation animation, byte layer)SetTime 仅客户端
csharp
public bool SetTime(AnimationHandle handle, float time)设置动画当前时间位置(秒)。
SetTime 仅客户端
csharp
public bool SetTime(Animation animation, float time)SetWeight 仅客户端
csharp
public bool SetWeight(AnimationHandle handle, float weight)设置动画权重 (0~1)。
SetWeight 仅客户端
csharp
public bool SetWeight(Animation animation, float weight)SetLooped 仅客户端
csharp
public bool SetLooped(AnimationHandle handle, bool enable)SetLooped 仅客户端
csharp
public bool SetLooped(Animation animation, bool enable)SetInterpolate 仅客户端
csharp
public bool SetInterpolate(AnimationHandle handle, bool enable)是否对当前动画做帧间插值(关闭后离散采样)。
SetInterpolate 仅客户端
csharp
public bool SetInterpolate(Animation animation, bool enable)SetSpeed 仅客户端
csharp
public bool SetSpeed(AnimationHandle handle, float speed)设置播放速度倍率。1.0 为正常速度,<0 表示倒放。
SetSpeed 仅客户端
csharp
public bool SetSpeed(Animation animation, float speed)SetAutoFade 仅客户端
csharp
public bool SetAutoFade(AnimationHandle handle, float fadeOutTime)设置非循环动画播完时的自动淡出时间。0 表示禁用自动淡出。
SetAutoFade 仅客户端
csharp
public bool SetAutoFade(Animation animation, float fadeOutTime)SetRemoveOnCompletion 仅客户端
csharp
public bool SetRemoveOnCompletion(AnimationHandle handle, bool removeOnCompletion)设置动画播完后是否自动从控制器移除。默认 true。
SetRemoveOnCompletion 仅客户端
csharp
public bool SetRemoveOnCompletion(Animation animation, bool removeOnCompletion)SetStartBone 仅客户端
csharp
public bool SetStartBone(AnimationHandle handle, UTF8String boneName = default(UTF8String))限定指定动画的作用范围:仅 及其子骨骼参与本动画的采样。 传空(默认)等价于恢复全身(native 端 fallback 到 root bone)。
备注
每次调用会重建 stateTracks_,与 UTF8String) 不累加。 复合遮罩调用顺序:SetStartBone(spineBone) → SetExcludedBone(rightArmBone) → 结果为脊椎子树减去右臂子树。顺序颠倒会被 SetStartBone 重建覆盖。 与 Actor 体系的共生:Actor 的 SetUpperBodyRootBone + BodyPart 是 per-actor 默认, 在 PlayAnimation 时由 ModelComponent 一次性写入本动画的 start/excluded bone。 本方法是 per-animation 直接覆盖,后写赢。两者操作同一个 native state, 混用时调过 SetStartBone 后请勿再依赖 Actor BodyPart 的语义。 性能:UTF8 marshal 一次,适合 setup 阶段调用;本方法不是 per-frame hot path。
SetStartBone 仅客户端
csharp
public bool SetStartBone(Animation animation, UTF8String boneName = default(UTF8String))SetExcludedBone 仅客户端
csharp
public bool SetExcludedBone(AnimationHandle handle, UTF8String boneName)在指定动画当前作用范围内进一步排除 及其子骨骼。 必须在 UTF8String) 之后调用(要求 stateTracks_ 非空)。骨骼不存在时返回 false。
备注
该排除范围会累加到当前动画状态的骨骼作用范围中,用于从中减去指定骨骼子树。
SetExcludedBone 仅客户端
csharp
public bool SetExcludedBone(Animation animation, UTF8String boneName)IsPlaying 仅客户端
csharp
public bool IsPlaying(AnimationHandle handle)动画是否在播放中。非循环动画停在末尾时也会返回 true(除非已被移除)。
IsPlaying 仅客户端
csharp
public bool IsPlaying(Animation animation)IsPlayingOnLayer 仅客户端
csharp
public bool IsPlayingOnLayer(byte layer)指定层上是否有任何动画在播放。
IsFadingIn 仅客户端
csharp
public bool IsFadingIn(AnimationHandle handle)IsFadingIn 仅客户端
csharp
public bool IsFadingIn(Animation animation)IsFadingOut 仅客户端
csharp
public bool IsFadingOut(AnimationHandle handle)IsFadingOut 仅客户端
csharp
public bool IsFadingOut(Animation animation)IsAtEnd 仅客户端
csharp
public bool IsAtEnd(AnimationHandle handle)动画是否播放到末尾。非循环动画播完会停在末尾,此时返回 true;动画不存在或未激活则返回 false。
IsAtEnd 仅客户端
csharp
public bool IsAtEnd(Animation animation)GetLayer 仅客户端
csharp
public byte GetLayer(AnimationHandle handle)GetLayer 仅客户端
csharp
public byte GetLayer(Animation animation)GetTime 仅客户端
csharp
public float GetTime(AnimationHandle handle)GetTime 仅客户端
csharp
public float GetTime(Animation animation)GetWeight 仅客户端
csharp
public float GetWeight(AnimationHandle handle)GetWeight 仅客户端
csharp
public float GetWeight(Animation animation)IsLooped 仅客户端
csharp
public bool IsLooped(AnimationHandle handle)IsLooped 仅客户端
csharp
public bool IsLooped(Animation animation)GetBlendMode 仅客户端
csharp
public AnimationBlendMode GetBlendMode(AnimationHandle handle)GetBlendMode 仅客户端
csharp
public AnimationBlendMode GetBlendMode(Animation animation)GetLength 仅客户端
csharp
public float GetLength(AnimationHandle handle)动画长度(秒),等价于先 Load 资源再读 Length。
GetLength 仅客户端
csharp
public float GetLength(Animation animation)GetSpeed 仅客户端
csharp
public float GetSpeed(AnimationHandle handle)GetSpeed 仅客户端
csharp
public float GetSpeed(Animation animation)GetFadeTarget 仅客户端
csharp
public float GetFadeTarget(AnimationHandle handle)GetFadeTarget 仅客户端
csharp
public float GetFadeTarget(Animation animation)GetFadeTime 仅客户端
csharp
public float GetFadeTime(AnimationHandle handle)GetFadeTime 仅客户端
csharp
public float GetFadeTime(Animation animation)GetAutoFade 仅客户端
csharp
public float GetAutoFade(AnimationHandle handle)GetAutoFade 仅客户端
csharp
public float GetAutoFade(Animation animation)GetRemoveOnCompletion 仅客户端
csharp
public bool GetRemoveOnCompletion(AnimationHandle handle)GetRemoveOnCompletion 仅客户端
csharp
public bool GetRemoveOnCompletion(Animation animation)GetAnimationState 仅客户端
csharp
public AnimationState? GetAnimationState(AnimationHandle handle)获取指定动画的运行时 AnimationState。返回 null 表示该动画未在播放或不存在。
GetAnimationState 仅客户端
csharp
public AnimationState? GetAnimationState(Animation animation)GetAnimationStateByIndex 仅客户端
csharp
public AnimationState? GetAnimationStateByIndex(uint index)GetAnimationStates 仅客户端
csharp
public AnimationState[] GetAnimationStates()GetTopAnimationStateInLayerRange 仅客户端
csharp
public AnimationState? GetTopAnimationStateInLayerRange(byte beginLayer, byte endLayer)GetAnimationName 仅客户端
csharp
public string GetAnimationName(uint index)Gets the resource name of a controller entry by index.
GetAnimationControl 仅客户端
csharp
public AnimationControlSnapshot? GetAnimationControl(uint index)Gets a safe scalar snapshot of a controller entry by index.
GetStartBoneName 仅客户端
csharp
public string GetStartBoneName(AnimationHandle handle)GetStartBoneName 仅客户端
csharp
public string GetStartBoneName(Animation animation)SetPause 仅客户端
csharp
public void SetPause(bool pause)暂停/恢复所有动画更新。
PlayStep 仅客户端
csharp
public void PlayStep()CancelPlayStep 仅客户端
csharp
public void CancelPlayStep()SetFps 仅客户端
csharp
public void SetFps(uint fps)UpdateStateTrackPointer 仅客户端
csharp
public void UpdateStateTrackPointer(Animation animation)SetCustomHandle 仅客户端
csharp
public bool SetCustomHandle(AnimationHandle animation, uint customHandle)AddSilentTimeStep 仅客户端
csharp
public void AddSilentTimeStep(float timeStep)累积静默时间,待下次实际更新时才会应用。
CleanAndResetPose 仅客户端
csharp
public void CleanAndResetPose()清理并重置骨骼姿态、更新包围盒。
AnimationControlSnapshot 仅客户端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public readonly struct AnimationControlSnapshot : IEquatable<AnimationControlSnapshot>Read-only snapshot of one animation control entry in the native controller.
构造函数
AnimationControlSnapshot 仅客户端
csharp
public AnimationControlSnapshot(uint NameHash, float Speed, float TargetWeight, float FadeTime, float AutoFadeTime, bool RemoveOnCompletion)Read-only snapshot of one animation control entry in the native controller.
属性
NameHash 仅客户端
csharp
public uint NameHash { get; init; }Speed 仅客户端
csharp
public float Speed { get; init; }TargetWeight 仅客户端
csharp
public float TargetWeight { get; init; }FadeTime 仅客户端
csharp
public float FadeTime { get; init; }AutoFadeTime 仅客户端
csharp
public float AutoFadeTime { get; init; }RemoveOnCompletion 仅客户端
csharp
public bool RemoveOnCompletion { get; init; }方法
ToString 仅客户端
csharp
public override string ToString()operator != 仅客户端
csharp
public static bool operator !=(AnimationControlSnapshot left, AnimationControlSnapshot right)operator == 仅客户端
csharp
public static bool operator ==(AnimationControlSnapshot left, AnimationControlSnapshot right)GetHashCode 仅客户端
csharp
public override int GetHashCode()Equals 仅客户端
csharp
public override bool Equals(object obj)Equals 仅客户端
csharp
public bool Equals(AnimationControlSnapshot other)Deconstruct 仅客户端
csharp
public void Deconstruct(out uint NameHash, out float Speed, out float TargetWeight, out float FadeTime, out float AutoFadeTime, out bool RemoveOnCompletion)AnimationHandle 仅客户端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public readonly struct AnimationHandle : IEquatable<AnimationHandle>动画句柄。Single) 成功后返回;用于后续高频访问(SetTime/SetWeight 等) 避免每次重新做字符串 hash + WASM 字符串 marshaling。
Hash— 动画名的 Urho StringHash(SDBM 算法)。0 表示无效句柄。
构造函数
AnimationHandle 仅客户端
csharp
public AnimationHandle(uint Hash)动画句柄。Single) 成功后返回;用于后续高频访问(SetTime/SetWeight 等) 避免每次重新做字符串 hash + WASM 字符串 marshaling。
Hash— 动画名的 Urho StringHash(SDBM 算法)。0 表示无效句柄。
属性
Hash 仅客户端
csharp
public uint Hash { get; init; }动画名的 Urho StringHash(SDBM 算法)。0 表示无效句柄。
IsValid 仅客户端
csharp
public bool IsValid { get; }句柄是否有效。Play 失败或显式构造为 0 时返回 false。
方法
For 仅客户端
csharp
public static AnimationHandle For(Animation animation)不经 Play 直接由动画路径构造句柄。常用于查询尚未播放但已经知道路径的动画状态, 或者预先把热点动画的 handle 缓存好。
ToString 仅客户端
csharp
public override string ToString()operator != 仅客户端
csharp
public static bool operator !=(AnimationHandle left, AnimationHandle right)operator == 仅客户端
csharp
public static bool operator ==(AnimationHandle left, AnimationHandle right)GetHashCode 仅客户端
csharp
public override int GetHashCode()Equals 仅客户端
csharp
public override bool Equals(object obj)Equals 仅客户端
csharp
public bool Equals(AnimationHandle other)Deconstruct 仅客户端
csharp
public void Deconstruct(out uint Hash)字段
None 仅客户端
csharp
public static readonly AnimationHandle NoneAnimationState 仅客户端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public class AnimationState : EngineObject单条动画的运行时状态。通过 AnimationController.GetAnimationState(...) 获取, 用于对单一动画做精细控制(权重、时间、层、混合模式等),而不影响同节点上的其他动画。
备注
动画状态由所属 AnimationController 创建并管理,不能直接构造。 本 wrapper 只能通过 AnimationController.GetAnimationState(...) 或 Actor 层的扩展方法 animation.GetAnimationState() 获取。
属性
IsLooped 仅客户端
csharp
public bool IsLooped { get; set; }是否循环播放。
IsLoopedThisFrame 仅客户端
csharp
public bool IsLoopedThisFrame { get; }本帧是否已循环过一次(用于检测循环触发)。
IsInterpolated 仅客户端
csharp
public bool IsInterpolated { get; set; }是否对帧间数据做插值(关闭后离散采样,可用于像素风等场景)。
Weight 仅客户端
csharp
public float Weight { get; set; }混合权重 (0~1)。
Time 仅客户端
csharp
public float Time { get; set; }当前时间位置(秒)。
Layer 仅客户端
csharp
public byte Layer { get; set; }混合层。
BlendMode 仅客户端
csharp
public AnimationBlendMode BlendMode { get; }混合模式(Lerp / Additive)。
Length 仅客户端
csharp
public float Length { get; }动画总长度(秒)。
IsEnabled 仅客户端
csharp
public bool IsEnabled { get; }权重 > 0 即视为启用。
Animation 仅客户端
csharp
public AnimationResource? Animation { get; }The animation resource retained by this state.
Model 仅客户端
csharp
public AnimatedModelComponent? Model { get; }The animated model that owns this state, when running in model mode.
RootNode 仅客户端
csharp
public Node? RootNode { get; }The root node controlled by this state when running in node-hierarchy mode.
KawaiiPhysicsAnimation 仅客户端
csharp
public AnimationResource? KawaiiPhysicsAnimation { get; set; }Optional physics-animation resource associated with this state.
StartBoneIndex 仅客户端
csharp
public uint? StartBoneIndex { get; }Current start-bone index, or null for node mode / unavailable skeletons.
StartBoneName 仅客户端
csharp
public string StartBoneName { get; }CustomHandle 仅客户端
csharp
public uint CustomHandle { get; set; }Handle 仅客户端
csharp
public uint Handle { get; }IsSuppressed 仅客户端
csharp
public bool IsSuppressed { get; }当前是否被高权重动画完全遮蔽(采样会被优化跳过)。
IsSuppressible 仅客户端
csharp
public bool IsSuppressible { get; set; }是否会遮蔽其他动画。设为 false 会关闭遮蔽优化。
PausedWhenSuppressed 仅客户端
csharp
public bool PausedWhenSuppressed { get; set; }被遮蔽时是否暂停时间推进。
MaxFrame 仅客户端
csharp
public uint MaxFrame { set; }设置动画的最大帧率(用于限制采样频率)。
方法
AddWeight 仅客户端
csharp
public void AddWeight(float delta)累加权重。等价于 Weight += delta 但只调一次 native。
AddTime 仅客户端
csharp
public void AddTime(float delta)累加时间。
SetStartBone 仅客户端
csharp
public bool SetStartBone(string boneName)SetStartBone 仅客户端
csharp
public bool SetStartBone(uint boneIndex)SetBoneWeight 仅客户端
csharp
public void SetBoneWeight(string boneName, float weight, bool recursive = false)SetBoneWeightByHash 仅客户端
csharp
public void SetBoneWeightByHash(uint boneNameHash, float weight, bool recursive = false)SetBoneWeight 仅客户端
csharp
public void SetBoneWeight(uint trackIndex, float weight, bool recursive = false)GetBoneWeight 仅客户端
csharp
public float GetBoneWeight(string boneName)GetBoneWeightByHash 仅客户端
csharp
public float GetBoneWeightByHash(uint boneNameHash)GetBoneWeight 仅客户端
csharp
public float GetBoneWeight(uint trackIndex)GetTrackIndex 仅客户端
csharp
public uint? GetTrackIndex(string boneName)GetTrackIndexByHash 仅客户端
csharp
public uint? GetTrackIndexByHash(uint boneNameHash)Apply 仅客户端
csharp
public void Apply()Immediately applies this state's current pose to its model or node hierarchy.
AutoRemoveMode 双端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public enum AutoRemoveMode组件播放完成后的自动移除模式。
枚举值
DisabledRemoveComponentRemoveNode
BillboardSetComponent 仅客户端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public sealed class BillboardSetComponent : Drawable, INodeComponent, IDisposable一组共享材质与渲染状态的 3D billboard。
构造函数
BillboardSetComponent 仅客户端
csharp
public BillboardSetComponent()属性
Material 仅客户端
csharp
public Material? Material { get; set; }Count 仅客户端
csharp
public uint Count { get; set; }Relative 仅客户端
csharp
public bool Relative { get; set; }Scaled 仅客户端
csharp
public bool Scaled { get; set; }Sorted 仅客户端
csharp
public bool Sorted { get; set; }FixedScreenSize 仅客户端
csharp
public bool FixedScreenSize { get; set; }FaceCameraMode 仅客户端
csharp
public FaceCameraMode FaceCameraMode { get; set; }MinAngle 仅客户端
csharp
public float MinAngle { get; set; }AnimationLodBias 仅客户端
csharp
public float AnimationLodBias { get; set; }方法
Commit 仅客户端
csharp
public void Commit()提交 billboard 数据修改,更新包围盒与 GPU 顶点数据。
Bone 仅客户端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public readonly struct Bone : IEquatable<Bone>骨骼只读快照。一次性按值返回引用 pose + 父级 + 关联场景 Node。 通过 UInt32) / String) 获取。
Node— 骨骼在场景图里对应的 Node。可能为 null(骨骼未与场景节点关联)。ParentIndex— 父骨骼 index。根骨骼通常为 0 或指向自身,可对照RootBoneIndex判别。InitialPosition— 引用 pose 的局部位置。InitialRotation— 引用 pose 的局部旋转。InitialScale— 引用 pose 的局部缩放。Animated— 骨骼是否参与动画驱动(Bone.animated_ 标志)。
构造函数
Bone 仅客户端
csharp
public Bone(Node? Node, uint ParentIndex, Vector3 InitialPosition, Quaternion InitialRotation, Vector3 InitialScale, bool Animated, string Name, uint NameHash, Matrix4x4 OffsetMatrix, BoneCollisionShape CollisionMask, float Radius, BoundingBox BoundingBox)骨骼只读快照。一次性按值返回引用 pose + 父级 + 关联场景 Node。 通过 UInt32) / String) 获取。
Node— 骨骼在场景图里对应的 Node。可能为 null(骨骼未与场景节点关联)。ParentIndex— 父骨骼 index。根骨骼通常为 0 或指向自身,可对照RootBoneIndex判别。InitialPosition— 引用 pose 的局部位置。InitialRotation— 引用 pose 的局部旋转。InitialScale— 引用 pose 的局部缩放。Animated— 骨骼是否参与动画驱动(Bone.animated_ 标志)。
属性
Node 仅客户端
csharp
public Node? Node { get; init; }骨骼在场景图里对应的 Node。可能为 null(骨骼未与场景节点关联)。
ParentIndex 仅客户端
csharp
public uint ParentIndex { get; init; }父骨骼 index。根骨骼通常为 0 或指向自身,可对照 RootBoneIndex 判别。
InitialPosition 仅客户端
csharp
public Vector3 InitialPosition { get; init; }引用 pose 的局部位置。
InitialRotation 仅客户端
csharp
public Quaternion InitialRotation { get; init; }引用 pose 的局部旋转。
InitialScale 仅客户端
csharp
public Vector3 InitialScale { get; init; }引用 pose 的局部缩放。
Animated 仅客户端
csharp
public bool Animated { get; init; }骨骼是否参与动画驱动(Bone.animated_ 标志)。
Name 仅客户端
csharp
public string Name { get; init; }NameHash 仅客户端
csharp
public uint NameHash { get; init; }OffsetMatrix 仅客户端
csharp
public Matrix4x4 OffsetMatrix { get; init; }CollisionMask 仅客户端
csharp
public BoneCollisionShape CollisionMask { get; init; }Radius 仅客户端
csharp
public float Radius { get; init; }BoundingBox 仅客户端
csharp
public BoundingBox BoundingBox { get; init; }方法
ToString 仅客户端
csharp
public override string ToString()operator != 仅客户端
csharp
public static bool operator !=(Bone left, Bone right)operator == 仅客户端
csharp
public static bool operator ==(Bone left, Bone right)GetHashCode 仅客户端
csharp
public override int GetHashCode()Equals 仅客户端
csharp
public override bool Equals(object obj)Equals 仅客户端
csharp
public bool Equals(Bone other)Deconstruct 仅客户端
csharp
public void Deconstruct(out Node? Node, out uint ParentIndex, out Vector3 InitialPosition, out Quaternion InitialRotation, out Vector3 InitialScale, out bool Animated, out string Name, out uint NameHash, out Matrix4x4 OffsetMatrix, out BoneCollisionShape CollisionMask, out float Radius, out BoundingBox BoundingBox)BoneCollisionShape 仅客户端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public enum BoneCollisionShapeCollision primitives configured on a skeleton bone.
枚举值
None = 0Sphere = 1Box = 2
CameraComponent 双端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public sealed class CameraComponent : EngineNodeComponent, INodeComponent, IDisposableUrho3D 摄像机组件,提供对底层摄像机属性的直接控制
构造函数
CameraComponent 双端
csharp
public CameraComponent()属性
Fov 双端
csharp
public float Fov { get; set; }视场角(度)
NearClip 双端
csharp
public float NearClip { get; set; }近裁剪面距离
FarClip 双端
csharp
public float FarClip { get; set; }远裁剪面距离
AspectRatio 双端
csharp
public float AspectRatio { get; set; }宽高比
AutoAspectRatio 双端
csharp
public bool AutoAspectRatio { get; set; }是否自动计算宽高比
IsOrthographic 双端
csharp
public bool IsOrthographic { get; set; }是否正交投影
OrthoSize 双端
csharp
public float OrthoSize { get; set; }正交尺寸
Zoom 双端
csharp
public float Zoom { get; set; }缩放
LodBias 双端
csharp
public float LodBias { get; set; }LOD偏差
ViewMask 双端
csharp
public uint ViewMask { get; set; }视图遮罩
ViewOverrideFlags 双端
csharp
public uint ViewOverrideFlags { get; set; }视图覆盖标志
FillMode 双端
csharp
public FillMode FillMode { get; set; }填充模式
UseClipping 双端
csharp
public bool UseClipping { get; set; }是否启用裁剪
UseReflection 双端
csharp
public bool UseReflection { get; set; }是否使用反射
ProjectionOffset 双端
csharp
public Vector2 ProjectionOffset { get; set; }投影偏移
Projection 双端
csharp
public Matrix4x4 Projection { get; set; }投影矩阵
GPUProjection 双端
csharp
public Matrix4x4 GPUProjection { get; }GPU投影矩阵
View 双端
csharp
public Matrix4x4 View { get; }视图矩阵
EffectiveWorldTransform 双端
csharp
public Matrix4x4 EffectiveWorldTransform { get; }有效世界变换
HalfViewSize 双端
csharp
public float HalfViewSize { get; }半视图尺寸
IsProjectionValid 双端
csharp
public bool IsProjectionValid { get; }投影是否有效
方法
SetOrthoSize 双端
csharp
public void SetOrthoSize(Vector2 orthoSize)正交尺寸(Vector2)
GetDistance 双端
csharp
public float GetDistance(Vector3 worldPos)获取到世界空间点的距离
GetDistanceSquared 双端
csharp
public float GetDistanceSquared(Vector3 worldPos)获取到世界空间点的距离平方
GetLodDistance 双端
csharp
public float GetLodDistance(float distance, float scale, float bias)获取LOD距离
ScreenToWorldPoint 双端
csharp
public Vector3 ScreenToWorldPoint(Vector3 screenPos)屏幕坐标转世界坐标
WorldToScreenPoint 双端
csharp
public Vector2 WorldToScreenPoint(Vector3 worldPos)世界坐标转屏幕坐标
GetScreenRay 双端
csharp
public Ray GetScreenRay(float x, float y)获取屏幕射线
GetFrustum 双端
csharp
public Frustum GetFrustum()获取视锥体
GetFrustumSize 双端
csharp
public (Vector3 near, Vector3 far) GetFrustumSize()获取视锥体近远平面尺寸
GetSplitFrustum 双端
csharp
public Frustum GetSplitFrustum(float nearClip, float farClip)获取分割视锥体
GetViewSpaceFrustum 双端
csharp
public Frustum GetViewSpaceFrustum()获取视图空间视锥体
GetViewSpaceSplitFrustum 双端
csharp
public Frustum GetViewSpaceSplitFrustum(float nearClip, float farClip)获取视图空间分割视锥体
GetClipPlane 双端
csharp
public Plane GetClipPlane()获取裁剪平面
SetClipPlane 双端
csharp
public void SetClipPlane(Plane clipPlane)设置裁剪平面
GetReflectionPlane 双端
csharp
public Plane GetReflectionPlane()获取反射平面
SetReflectionPlane 双端
csharp
public void SetReflectionPlane(Plane reflectionPlane)设置反射平面
CustomGeometryComponent 仅客户端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public sealed class CustomGeometryComponent : Drawable, INodeComponent, IDisposable可由脚本逐顶点构造的客户端几何体组件。
构造函数
CustomGeometryComponent 仅客户端
csharp
public CustomGeometryComponent()属性
NumGeometries 仅客户端
csharp
public uint NumGeometries { get; set; }Dynamic 仅客户端
csharp
public bool Dynamic { get; set; }Material 仅客户端
csharp
public Material? Material { get; set; }方法
Clear 仅客户端
csharp
public void Clear()BeginGeometry 仅客户端
csharp
public void BeginGeometry(uint index, PrimitiveType type)DefineVertex 仅客户端
csharp
public void DefineVertex(Vector3 position)DefineNormal 仅客户端
csharp
public void DefineNormal(Vector3 normal)DefineColor 仅客户端
csharp
public void DefineColor(Color color)DefineTexCoord 仅客户端
csharp
public void DefineTexCoord(Vector2 texCoord)DefineTangent 仅客户端
csharp
public void DefineTangent(Vector4 tangent)DefineGeometry 仅客户端
csharp
public void DefineGeometry(uint index, PrimitiveType type, uint numVertices, bool hasNormals, bool hasColors, bool hasTexCoords, bool hasTangents)GetNumVertices 仅客户端
csharp
public uint GetNumVertices(uint geometryIndex)GetMaterial 仅客户端
csharp
public Material? GetMaterial(uint geometryIndex)SetMaterial 仅客户端
csharp
public bool SetMaterial(uint geometryIndex, Material? material)Commit 仅客户端
csharp
public void Commit()DebugRenderer 仅客户端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public sealed class DebugRenderer : EngineNodeComponent, INodeComponent, IDisposableUrho3D 调试绘制组件。通常挂在 SceneGraph 根节点,并需要对应 Viewport.DrawDebug = true。 调试几何会在帧末清空;需要持续显示的线框应每帧重新提交。
构造函数
DebugRenderer 仅客户端
csharp
public DebugRenderer()属性
LineAntiAlias 仅客户端
csharp
public bool LineAntiAlias { get; set; }OccludeBlend 仅客户端
csharp
public float OccludeBlend { set; }HasContent 仅客户端
csharp
public bool HasContent { get; }HasContentCurrentRender 仅客户端
csharp
public bool HasContentCurrentRender { get; }方法
AddLine 仅客户端
csharp
public void AddLine(Vector3 start, Vector3 end, Color color, bool depthTest = true, bool translucent = false)AddTriangle 仅客户端
csharp
public void AddTriangle(Vector3 v1, Vector3 v2, Vector3 v3, Color color, bool depthTest = true)AddPolygon 仅客户端
csharp
public void AddPolygon(Vector3 v1, Vector3 v2, Vector3 v3, Vector3 v4, Color color, bool depthTest = true)AddNode 仅客户端
csharp
public void AddNode(Node node, float scale = 1f, bool depthTest = true)AddBoundingBox 仅客户端
csharp
public void AddBoundingBox(BoundingBox box, Color color, bool depthTest = true, bool solid = false)AddFrustum 仅客户端
csharp
public void AddFrustum(Frustum frustum, Color color, bool depthTest = true)AddTriangleMesh 仅客户端
csharp
public void AddTriangleMesh(Vector3[] positions, uint[] indices, Color color, bool depthTest = true)AddTriangleMesh 仅客户端
csharp
public void AddTriangleMesh(Vector3[] positions, uint[] indices, Matrix4x4 transform, Color color, bool depthTest = true)AddPolyhedron 仅客户端
csharp
public void AddPolyhedron(IReadOnlyList<IReadOnlyList<Vector3>> faces, Color color, bool depthTest = true)AddPolyhedron 仅客户端
csharp
public void AddPolyhedron(Vector3[] vertices, uint[] faceStarts, uint[] faceCounts, Color color, bool depthTest = true)AddSphere 仅客户端
csharp
public void AddSphere(Vector3 center, float radius, Color color, bool depthTest = true)AddCapsule 仅客户端
csharp
public void AddCapsule(Vector3 center, Vector3 direction, float radius, float length, Color color, bool depthTest = true)AddCircle 仅客户端
csharp
public void AddCircle(Vector3 center, Vector3 normal, float radius, Color color, int steps = 64, bool depthTest = true, bool normalLine = true)AddArc 仅客户端
csharp
public void AddArc(Vector3 center, Vector3 normal, Vector3 startDirection, float angle, float radius, Color color, int steps = 64, bool depthTest = true, bool normalLine = false)AddEllipse 仅客户端
csharp
public void AddEllipse(Vector3 center, Quaternion rotation, float radiusX, float radiusY, Color color, int steps = 256, bool depthTest = true)AddCross 仅客户端
csharp
public void AddCross(Vector3 center, float size, Color color, bool depthTest = true)AddQuad 仅客户端
csharp
public void AddQuad(Vector3 center, float width, float height, Color color, bool depthTest = true)AddCylinder 仅客户端
csharp
public void AddCylinder(Vector3 position, float radius, float height, Color color, bool depthTest = true)AddVerticalCylinder 仅客户端
csharp
public void AddVerticalCylinder(Vector3 position, float radius, float height, Color color, bool depthTest = true)AddCone 仅客户端
csharp
public void AddCone(Vector3 center, Vector3 normal, float length, float radius, Color color, int numLines = 16, bool depthTest = true)AddConeAndHemisphere 仅客户端
csharp
public void AddConeAndHemisphere(Vector3 center, Vector3 normal, float coneAngle, float radius, Color color, int numConeLines = 32, int numLines = 16, bool depthTest = true)AddSkeleton 仅客户端
csharp
public void AddSkeleton(AnimatedModelComponent animatedModel, Color color, bool depthTest = true)AddStaticModelNormals 仅客户端
csharp
public void AddStaticModelNormals(StaticMeshComponent staticMesh, float normalLength = 1f)RemoveStaticModelNormals 仅客户端
csharp
public void RemoveStaticModelNormals(StaticMeshComponent staticMesh)ClearStaticModelNormals 仅客户端
csharp
public void ClearStaticModelNormals()DecalSetComponent 仅客户端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public sealed class DecalSetComponent : Drawable, INodeComponent, IDisposable将贴花投射到目标 Drawable 几何体上的客户端组件。
构造函数
DecalSetComponent 仅客户端
csharp
public DecalSetComponent()属性
Material 仅客户端
csharp
public Material? Material { get; set; }MaxVertices 仅客户端
csharp
public uint MaxVertices { get; set; }MaxIndices 仅客户端
csharp
public uint MaxIndices { get; set; }OptimizeBufferSize 仅客户端
csharp
public bool OptimizeBufferSize { get; set; }NumDecals 仅客户端
csharp
public uint NumDecals { get; }NumVertices 仅客户端
csharp
public uint NumVertices { get; }NumIndices 仅客户端
csharp
public uint NumIndices { get; }方法
AddDecal 仅客户端
csharp
public bool AddDecal(Drawable target, Vector3 worldPosition, Quaternion worldRotation, float size, float aspectRatio, float depth, Vector2 topLeftUV, Vector2 bottomRightUV, float timeToLive = 0f, float normalCutoff = 0.1f, uint subGeometry = uint.MaxValue)RemoveOldest 仅客户端
csharp
public void RemoveOldest(uint count)RemoveAll 仅客户端
csharp
public void RemoveAll()Drawable 双端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public abstract class Drawable : EngineNodeComponent构造函数
Drawable 双端
csharp
protected Drawable()Drawable 双端
csharp
protected Drawable(NativePtr nativePtr)属性
CastShadows 双端
csharp
public bool CastShadows { get; set; }DrawDistance 双端
csharp
public float DrawDistance { get; set; }LodBias 双端
csharp
public float LodBias { get; set; }MaxLights 双端
csharp
public uint MaxLights { get; set; }LightMask 双端
csharp
public uint LightMask { get; set; }ShadowDistance 双端
csharp
public float ShadowDistance { get; set; }ShadowMask 双端
csharp
public uint ShadowMask { get; set; }ViewMask 双端
csharp
public uint ViewMask { get; set; }ZoneMask 双端
csharp
public uint ZoneMask { get; set; }IsInView 双端
csharp
public bool IsInView { get; }Zone 双端
csharp
public Zone? Zone { get; }IsOccludee 双端
csharp
public bool IsOccludee { get; set; }IsOccluder 双端
csharp
public bool IsOccluder { get; set; }BoundingBox 双端
csharp
public BoundingBox BoundingBox { get; }WorldBoundingBox 双端
csharp
public BoundingBox WorldBoundingBox { get; }DrawableFlags 双端
csharp
public byte DrawableFlags { get; }方法
IsInViewOf 双端
csharp
public bool IsInViewOf(CameraComponent camera)MarkForUpdate 双端
csharp
public void MarkForUpdate()Drawable2D 双端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public abstract class Drawable2D : DrawableBase class for Urho2D drawables rendered by Renderer2D.
备注
Drawable2D state exists on both runtime ends for scene authority and replication. Actual drawing and material batching still happen on client.
构造函数
Drawable2D 双端
csharp
protected Drawable2D()Drawable2D 双端
csharp
protected Drawable2D(NativePtr nativePtr)属性
Layer 双端
csharp
public int Layer { get; set; }Gets or sets the coarse 2D render layer.
备注
Higher layers are drawn above lower layers. Use this with OrderInLayer to control ordering among 2D sprites and animations in the same scene.
OrderInLayer 双端
csharp
public int OrderInLayer { get; set; }Gets or sets the fine-grained order inside Layer.
备注
Higher values are drawn above lower values within the same layer.
DrawableQueryFlags 仅客户端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public enum DrawableQueryFlagsDrawable flags accepted by an Urho octree query. The values mirror Drawable.h; keeping them as a byte matches the native query ABI.
枚举值
Undefined = 0StaticMesh = 1SkeletalMesh = 2Terrain = 4Particle = 8Geometry = 0xFLight = 0x10Zone = 0x20Geometry2D = 0x40Cull = 0x80Any = byte.MaxValue
DrawTag 仅客户端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public enum DrawTag枚举值
UnknownStaticMeshSkeletalMeshTerrainParticleQuad
FaceCameraMode 仅客户端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public enum FaceCameraMode枚举值
NoneRotateXYZRotateXRotateYRotateZLookAtXYZLookAtYLookAtMixedDirectionEpalXEpalYEpalZEpalNegativeXEpalNegativeYEpalNegativeZ
Frustum 双端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public struct Frustum : IEquatable<Frustum>属性
NearPlane 双端
csharp
public Plane NearPlane { get; set; }LeftPlane 双端
csharp
public Plane LeftPlane { get; set; }RightPlane 双端
csharp
public Plane RightPlane { get; set; }UpPlane 双端
csharp
public Plane UpPlane { get; set; }DownPlane 双端
csharp
public Plane DownPlane { get; set; }FarPlane 双端
csharp
public Plane FarPlane { get; set; }Vertex0 双端
csharp
public Vector3 Vertex0 { get; set; }Vertex1 双端
csharp
public Vector3 Vertex1 { get; set; }Vertex2 双端
csharp
public Vector3 Vertex2 { get; set; }Vertex3 双端
csharp
public Vector3 Vertex3 { get; set; }Vertex4 双端
csharp
public Vector3 Vertex4 { get; set; }Vertex5 双端
csharp
public Vector3 Vertex5 { get; set; }Vertex6 双端
csharp
public Vector3 Vertex6 { get; set; }Vertex7 双端
csharp
public Vector3 Vertex7 { get; set; }方法
Classify 双端
csharp
public Intersection Classify(Vector3 point)Classify 双端
csharp
public Intersection Classify(Sphere sphere, bool fast = false)Classify 双端
csharp
public Intersection Classify(BoundingBox box, bool fast = false)DistanceTo 双端
csharp
public float DistanceTo(Vector3 point)Transform 双端
csharp
public Frustum Transform(Matrix4x4 affineTransform)TransformRotation 双端
csharp
public Frustum TransformRotation(Matrix4x4 rotation)Project 双端
csharp
public RectangleF Project(Matrix4x4 projection)UpdatePlanes 双端
csharp
public Frustum UpdatePlanes()CreatePerspective 双端
csharp
public static Frustum CreatePerspective(float fov, float aspectRatio, float zoom, float nearZ, float farZ, Matrix4x4? transform = null)CreateOrthographic 双端
csharp
public static Frustum CreateOrthographic(float orthoSize, float aspectRatio, float zoom, float nearZ, float farZ, Matrix4x4? transform = null)FromBoundingBox 双端
csharp
public static Frustum FromBoundingBox(BoundingBox box, Matrix4x4? transform = null)FromProjection 双端
csharp
public static Frustum FromProjection(Matrix4x4 projection)FromProjectionSplit 双端
csharp
public static Frustum FromProjectionSplit(Matrix4x4 projection, float nearZ, float farZ)ToString 双端
csharp
public override readonly string ToString()operator != 双端
csharp
public static bool operator !=(Frustum left, Frustum right)operator == 双端
csharp
public static bool operator ==(Frustum left, Frustum right)GetHashCode 双端
csharp
public override readonly int GetHashCode()Equals 双端
csharp
public override readonly bool Equals(object obj)Equals 双端
csharp
public readonly bool Equals(Frustum other)Geometry 仅客户端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public sealed class Geometry : EngineObject构造函数
Geometry 仅客户端
csharp
public Geometry()属性
NumVertexBuffers 仅客户端
csharp
public uint NumVertexBuffers { get; set; }IndexBuffer 仅客户端
csharp
public IndexBuffer? IndexBuffer { get; set; }PrimitiveType 仅客户端
csharp
public PrimitiveType PrimitiveType { get; }IndexStart 仅客户端
csharp
public uint IndexStart { get; }IndexCount 仅客户端
csharp
public uint IndexCount { get; }VertexStart 仅客户端
csharp
public uint VertexStart { get; }VertexCount 仅客户端
csharp
public uint VertexCount { get; }LodDistance 仅客户端
csharp
public float LodDistance { get; set; }IsEmpty 仅客户端
csharp
public bool IsEmpty { get; }方法
SetVertexBuffer 仅客户端
csharp
public bool SetVertexBuffer(uint index, VertexBuffer? buffer)GetVertexBuffer 仅客户端
csharp
public VertexBuffer? GetVertexBuffer(uint index)SetDrawRange 仅客户端
csharp
public bool SetDrawRange(PrimitiveType type, uint indexStart, uint indexCount, bool getUsedVertexRange = true)SetDrawRange 仅客户端
csharp
public bool SetDrawRange(PrimitiveType type, uint indexStart, uint indexCount, uint vertexStart, uint vertexCount, bool checkIllegal = true)IndexBuffer 仅客户端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public sealed class IndexBuffer : EngineObject构造函数
IndexBuffer 仅客户端
csharp
public IndexBuffer()属性
Shadowed 仅客户端
csharp
public bool Shadowed { get; set; }IsDynamic 仅客户端
csharp
public bool IsDynamic { get; }IndexCount 仅客户端
csharp
public uint IndexCount { get; }IndexSize 仅客户端
csharp
public uint IndexSize { get; }方法
SetSize 仅客户端
csharp
public bool SetSize(uint indexCount, bool largeIndices, bool dynamic = false, uint usageFlags = 0u)SetData 仅客户端
csharp
public bool SetData(ReadOnlySpan<byte> data)SetDataRange 仅客户端
csharp
public bool SetDataRange(ReadOnlySpan<byte> data, uint start, uint count, bool discard = false)GetData 仅客户端
csharp
public byte[] GetData()LightComponent 双端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public class LightComponent : Drawable, INodeComponent, IDisposable双端 3D 光源组件。服务端可维护权威光源状态,实际渲染仅发生在客户端。
备注
适合运行时调整 SCE 场景光照或脚本创建的 GameGraph 光源。 对 SCE 地图内置光照的高层访问优先使用 。
构造函数
LightComponent 双端
csharp
public LightComponent()属性
Type 双端
csharp
public LightType Type { get; set; }光源类型。
Units 双端
csharp
public LightUnits Units { get; set; }Color 双端
csharp
public Color Color { get; set; }光源基础颜色。
Temperature 双端
csharp
public float Temperature { get; set; }UseTemperature 双端
csharp
public bool UseTemperature { get; set; }Radius 双端
csharp
public float Radius { get; set; }SoftRadius 双端
csharp
public float SoftRadius { get; set; }Length 双端
csharp
public float Length { get; set; }UsePhysicalValues 双端
csharp
public bool UsePhysicalValues { get; set; }EffectiveColor 双端
csharp
public Color EffectiveColor { get; }ColorFromTemperature 双端
csharp
public Color ColorFromTemperature { get; }EffectiveSpecularIntensity 双端
csharp
public float EffectiveSpecularIntensity { get; }Brightness 双端
csharp
public float Brightness { get; set; }光源亮度倍率。
Range 双端
csharp
public float Range { get; set; }有效范围(仅 Point/Spot 灯光)。
AspectRatio 双端
csharp
public float AspectRatio { get; set; }FadeDistance 双端
csharp
public float FadeDistance { get; set; }SpecularIntensity 双端
csharp
public float SpecularIntensity { get; set; }高光反射强度。
Fov 双端
csharp
public float Fov { get; set; }聚光锥角度(仅 Spot 灯光)。
PerVertex 双端
csharp
public bool PerVertex { get; set; }是否按顶点光照计算。通常只在需要较低成本的简单光照时启用。
ShadowIntensity 双端
csharp
public float ShadowIntensity { get; set; }阴影强度。值越大,阴影越明显。
ShadowFadeDistance 双端
csharp
public float ShadowFadeDistance { get; set; }ShadowBias 双端
csharp
public LightShadowBias ShadowBias { get; set; }ShadowCascade 双端
csharp
public LightShadowCascade ShadowCascade { get; set; }AutoShadowCascade 双端
csharp
public bool AutoShadowCascade { get; set; }AutoShadowCascadeCount 双端
csharp
public uint AutoShadowCascadeCount { get; set; }ShadowFocus 双端
csharp
public LightShadowFocus ShadowFocus { get; set; }ShadowResolution 双端
csharp
public float ShadowResolution { get; set; }阴影贴图分辨率倍率或引擎侧分辨率参数。
备注
提高该值可能改善阴影细节,但也会增加客户端渲染成本。
ShadowNearFarRatio 双端
csharp
public float ShadowNearFarRatio { get; set; }ShadowMaxExtrusion 双端
csharp
public float ShadowMaxExtrusion { get; set; }方向光阴影最大外推距离。
备注
主要影响方向光阴影覆盖范围。值过小可能截断远处阴影,值过大可能降低阴影精度。
ShadowFarClipLimit 双端
csharp
public float ShadowFarClipLimit { get; set; }UseWeatherValues 双端
csharp
public bool UseWeatherValues { get; set; }是否使用天气参数覆盖或混合该光源的颜色和亮度。
备注
SCE 场景天气通常通过 LightGroup 内的 Light 与 Zone 共同表达。开启后可配合 WeatherColor、WeatherBrightness 和 Single) 在运行时做客户端本地天气过渡。
WeatherColor 双端
csharp
public Color WeatherColor { get; set; }天气光照颜色。
备注
该值只影响当前客户端运行时光源状态,不会同步服务器,也不会写回地图资源。
WeatherBrightness 双端
csharp
public float WeatherBrightness { get; set; }天气光照亮度倍率。
备注
该值只影响当前客户端运行时光源状态,不会同步服务器,也不会写回地图资源。
Frustum 双端
csharp
public Frustum Frustum { get; }ShadowSplitCount 双端
csharp
public int ShadowSplitCount { get; }IsNegative 双端
csharp
public bool IsNegative { get; }DebugGeometryUsesLightColor 双端
csharp
public bool DebugGeometryUsesLightColor { get; set; }IgnoreRayQuery 双端
csharp
public bool IgnoreRayQuery { get; set; }StaticLight 双端
csharp
public bool StaticLight { get; set; }PunctualLight 双端
csharp
public bool PunctualLight { get; set; }IsActuallyPunctualLight 双端
csharp
public bool IsActuallyPunctualLight { get; }CanCluster 双端
csharp
public bool CanCluster { get; }InnerConeAngle 双端
csharp
public float InnerConeAngle { get; set; }OuterConeAngle 双端
csharp
public float OuterConeAngle { get; set; }VolumetricEnabled 双端
csharp
public bool VolumetricEnabled { get; set; }ScatteringIntensity 双端
csharp
public float ScatteringIntensity { get; set; }ScatteringColor 双端
csharp
public Vector3 ScatteringColor { get; set; }AbsorptionIntensity 双端
csharp
public float AbsorptionIntensity { get; set; }AbsorptionColor 双端
csharp
public Vector3 AbsorptionColor { get; set; }PhaseG 双端
csharp
public float PhaseG { get; set; }VolumetricBlend 双端
csharp
public float VolumetricBlend { get; set; }VolumetricDepthMask 双端
csharp
public bool VolumetricDepthMask { get; set; }VolumetricMaskIntensity 双端
csharp
public float VolumetricMaskIntensity { get; set; }LightShaftHeight 双端
csharp
public float LightShaftHeight { get; set; }LightShaftScale 双端
csharp
public float LightShaftScale { get; set; }方法
SetRangeScale 双端
csharp
public void SetRangeScale(float scale)SetWeatherParamBlend 双端
csharp
public void SetWeatherParamBlend(float blend)设置当前光照参数与天气光照参数之间的混合系数。
blend— 混合系数,通常使用 0 到 1。0 表示原光照参数,1 表示天气光照参数。
备注
该操作仅影响当前客户端运行时状态。需要按 SCE 场景整体调整天气时,优先使用 Single)。
LightShadowBias 双端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public readonly struct LightShadowBias : IEquatable<LightShadowBias>构造函数
LightShadowBias 双端
csharp
public LightShadowBias(float ConstantBias, float SlopeScaledBias, float NormalOffset)属性
ConstantBias 双端
csharp
public float ConstantBias { get; init; }SlopeScaledBias 双端
csharp
public float SlopeScaledBias { get; init; }NormalOffset 双端
csharp
public float NormalOffset { get; init; }方法
ToString 双端
csharp
public override string ToString()operator != 双端
csharp
public static bool operator !=(LightShadowBias left, LightShadowBias right)operator == 双端
csharp
public static bool operator ==(LightShadowBias left, LightShadowBias right)GetHashCode 双端
csharp
public override int GetHashCode()Equals 双端
csharp
public override bool Equals(object obj)Equals 双端
csharp
public bool Equals(LightShadowBias other)Deconstruct 双端
csharp
public void Deconstruct(out float ConstantBias, out float SlopeScaledBias, out float NormalOffset)LightShadowCascade 双端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public readonly struct LightShadowCascade : IEquatable<LightShadowCascade>构造函数
LightShadowCascade 双端
csharp
public LightShadowCascade(float Split1, float Split2, float Split3, float Split4, float FadeStart, float BiasAutoAdjust)属性
Split1 双端
csharp
public float Split1 { get; init; }Split2 双端
csharp
public float Split2 { get; init; }Split3 双端
csharp
public float Split3 { get; init; }Split4 双端
csharp
public float Split4 { get; init; }FadeStart 双端
csharp
public float FadeStart { get; init; }BiasAutoAdjust 双端
csharp
public float BiasAutoAdjust { get; init; }方法
ToString 双端
csharp
public override string ToString()operator != 双端
csharp
public static bool operator !=(LightShadowCascade left, LightShadowCascade right)operator == 双端
csharp
public static bool operator ==(LightShadowCascade left, LightShadowCascade right)GetHashCode 双端
csharp
public override int GetHashCode()Equals 双端
csharp
public override bool Equals(object obj)Equals 双端
csharp
public bool Equals(LightShadowCascade other)Deconstruct 双端
csharp
public void Deconstruct(out float Split1, out float Split2, out float Split3, out float Split4, out float FadeStart, out float BiasAutoAdjust)LightShadowFocus 双端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public readonly struct LightShadowFocus : IEquatable<LightShadowFocus>构造函数
LightShadowFocus 双端
csharp
public LightShadowFocus(bool Enabled, bool NonUniform, bool AutoSize, float Quantize, float MinView)属性
Enabled 双端
csharp
public bool Enabled { get; init; }NonUniform 双端
csharp
public bool NonUniform { get; init; }AutoSize 双端
csharp
public bool AutoSize { get; init; }Quantize 双端
csharp
public float Quantize { get; init; }MinView 双端
csharp
public float MinView { get; init; }方法
ToString 双端
csharp
public override string ToString()operator != 双端
csharp
public static bool operator !=(LightShadowFocus left, LightShadowFocus right)operator == 双端
csharp
public static bool operator ==(LightShadowFocus left, LightShadowFocus right)GetHashCode 双端
csharp
public override int GetHashCode()Equals 双端
csharp
public override bool Equals(object obj)Equals 双端
csharp
public bool Equals(LightShadowFocus other)Deconstruct 双端
csharp
public void Deconstruct(out bool Enabled, out bool NonUniform, out bool AutoSize, out float Quantize, out float MinView)LightType 双端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public enum LightType枚举值
Directional— 方向光。常用于太阳光、月光等全局平行光。Spot— 聚光灯。受 和 影响。Point— 点光源。受 影响。
LightUnits 双端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public enum LightUnits枚举值
UnitlessCandelasLumens
LoopMode2D 仅客户端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public enum LoopMode2DControls how AnimatedSprite2D loops the selected animation.
枚举值
Default— Uses the default loop setting from the animation data.ForceLooped— Forces the animation to loop.ForceClamped— Forces the animation to stop at its final frame.
OctreeComponent 仅客户端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public sealed class OctreeComponent : EngineNodeComponent, INodeComponent, IDisposableClient-side Urho octree component. It is a graphics spatial index and is intentionally absent from Server-Wasm; server spatial queries use the authority-side physics/navigation systems instead.
构造函数
OctreeComponent 仅客户端
csharp
public OctreeComponent()属性
NumLevels 仅客户端
csharp
public uint NumLevels { get; }方法
SetSize 仅客户端
csharp
public void SetSize(BoundingBox box, uint numLevels)AddManualDrawable 仅客户端
csharp
public void AddManualDrawable(Drawable drawable)RemoveManualDrawable 仅客户端
csharp
public void RemoveManualDrawable(Drawable drawable)QueueUpdate 仅客户端
csharp
public void QueueUpdate(Drawable drawable)GetDrawables 仅客户端
csharp
public OctreeDrawableResult[] GetDrawables(Vector3 point, DrawableQueryFlags drawableFlags = DrawableQueryFlags.Any, uint viewMask = uint.MaxValue)GetDrawables 仅客户端
csharp
public OctreeDrawableResult[] GetDrawables(BoundingBox box, DrawableQueryFlags drawableFlags = DrawableQueryFlags.Any, uint viewMask = uint.MaxValue)GetDrawables 仅客户端
csharp
public OctreeDrawableResult[] GetDrawables(Frustum frustum, DrawableQueryFlags drawableFlags = DrawableQueryFlags.Any, uint viewMask = uint.MaxValue)GetDrawables 仅客户端
csharp
public OctreeDrawableResult[] GetDrawables(Sphere sphere, DrawableQueryFlags drawableFlags = DrawableQueryFlags.Any, uint viewMask = uint.MaxValue)GetAllDrawables 仅客户端
csharp
public OctreeDrawableResult[] GetAllDrawables(DrawableQueryFlags drawableFlags = DrawableQueryFlags.Any, uint viewMask = uint.MaxValue)Raycast 仅客户端
csharp
public OctreeRaycastResult[] Raycast(Ray ray, OctreeRayQueryLevel level = OctreeRayQueryLevel.Triangle, float maxDistance = float.PositiveInfinity, DrawableQueryFlags drawableFlags = DrawableQueryFlags.Any, uint viewMask = uint.MaxValue)RaycastSingle 仅客户端
csharp
public OctreeRaycastResult? RaycastSingle(Ray ray, OctreeRayQueryLevel level = OctreeRayQueryLevel.Triangle, float maxDistance = float.PositiveInfinity, DrawableQueryFlags drawableFlags = DrawableQueryFlags.Any, uint viewMask = uint.MaxValue)DrawDebugGeometry 仅客户端
csharp
public void DrawDebugGeometry(bool depthTest = true)OctreeDrawableResult 仅客户端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public readonly struct OctreeDrawableResult : IEquatable<OctreeDrawableResult>A non-owning octree result. The drawable pointer is borrowed from the scene; use TryGetDrawable``1 only when a concrete wrapper is already known to be registered for that pointer.
构造函数
OctreeDrawableResult 仅客户端
csharp
public OctreeDrawableResult(NativePtr DrawablePointer, Node? Node)A non-owning octree result. The drawable pointer is borrowed from the scene; use TryGetDrawable``1 only when a concrete wrapper is already known to be registered for that pointer.
属性
DrawablePointer 仅客户端
csharp
public NativePtr DrawablePointer { get; init; }Node 仅客户端
csharp
public Node? Node { get; init; }方法
TryGetDrawable 仅客户端
csharp
public T? TryGetDrawable<T>() where T : EngineObjectToString 仅客户端
csharp
public override string ToString()operator != 仅客户端
csharp
public static bool operator !=(OctreeDrawableResult left, OctreeDrawableResult right)operator == 仅客户端
csharp
public static bool operator ==(OctreeDrawableResult left, OctreeDrawableResult right)GetHashCode 仅客户端
csharp
public override int GetHashCode()Equals 仅客户端
csharp
public override bool Equals(object obj)Equals 仅客户端
csharp
public bool Equals(OctreeDrawableResult other)Deconstruct 仅客户端
csharp
public void Deconstruct(out NativePtr DrawablePointer, out Node? Node)OctreeRaycastResult 仅客户端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public readonly struct OctreeRaycastResult : IEquatable<OctreeRaycastResult>A non-owning raycast hit returned by the scene octree.
构造函数
OctreeRaycastResult 仅客户端
csharp
public OctreeRaycastResult(Vector3 Position, Vector3 Normal, Vector2 TextureUV, float Distance, NativePtr DrawablePointer, Node? Node, uint SubObject)A non-owning raycast hit returned by the scene octree.
属性
Position 仅客户端
csharp
public Vector3 Position { get; init; }Normal 仅客户端
csharp
public Vector3 Normal { get; init; }TextureUV 仅客户端
csharp
public Vector2 TextureUV { get; init; }Distance 仅客户端
csharp
public float Distance { get; init; }DrawablePointer 仅客户端
csharp
public NativePtr DrawablePointer { get; init; }Node 仅客户端
csharp
public Node? Node { get; init; }SubObject 仅客户端
csharp
public uint SubObject { get; init; }HasHit 仅客户端
csharp
public bool HasHit { get; }方法
TryGetDrawable 仅客户端
csharp
public T? TryGetDrawable<T>() where T : EngineObjectToString 仅客户端
csharp
public override string ToString()operator != 仅客户端
csharp
public static bool operator !=(OctreeRaycastResult left, OctreeRaycastResult right)operator == 仅客户端
csharp
public static bool operator ==(OctreeRaycastResult left, OctreeRaycastResult right)GetHashCode 仅客户端
csharp
public override int GetHashCode()Equals 仅客户端
csharp
public override bool Equals(object obj)Equals 仅客户端
csharp
public bool Equals(OctreeRaycastResult other)Deconstruct 仅客户端
csharp
public void Deconstruct(out Vector3 Position, out Vector3 Normal, out Vector2 TextureUV, out float Distance, out NativePtr DrawablePointer, out Node? Node, out uint SubObject)OctreeRayQueryLevel 仅客户端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public enum OctreeRayQueryLevelRaycast detail level used by UInt32).
枚举值
AabbObbTriangleTriangleUvCylinderSimpleConvexHull
ParticleEmitter 仅客户端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public class ParticleEmitter : EngineNodeComponent, INodeComponent, IDisposable粒子发射器组件。通过 Int32) 获取, 支持对单个发射器进行独立控制(速度、缩放、循环、停止等)。 一个 ParticleSystem 在调用 AddToNode 后, 会在节点上创建一个或多个此类型的组件。
属性
IsFinished 仅客户端
csharp
public bool IsFinished { get; }发射器是否已播放完毕(所有粒子消亡且不再发射)。
TickSpeed 仅客户端
csharp
public float TickSpeed { set; }播放速率倍数。1.0 为正常速度,<1.0 减速,>1.0 加速。仅支持设置。
RandomSeed 仅客户端
csharp
public uint RandomSeed { get; set; }发射器独立随机种子。设置后立即生效,并在之后每次 Boolean) 时恢复到同一 seed。
备注
读取返回初始种子;旧挂载返回挂载种子,仅显式设置后才将其用于 Reset。需要客户端能力版本 10。
DeterministicMode 仅客户端
csharp
public bool DeterministicMode { get; set; }确定性模式开关。进入后该发射器暂停每帧自动推进,只响应 Single) / Single); 离开后从当前状态恢复正常自动播放。
备注
进入时该模式接管组件的暂停状态并暂时关闭自动移除,避免采样过程中组件被销毁; 离开时恢复进入前的状态。确定性模式期间不要修改自动移除模式或组件暂停状态。 不支持的发射器(非 Component、未挂载节点、没有 effect 或包含 EmitterHierarchy)在开启时会抛出 InvalidOperationException;需要无异常判断时使用 Boolean)。 需要客户端能力版本 10。
UnitScale 仅客户端
csharp
public float UnitScale { get; set; }单位缩放。
SpawnRateFactor 仅客户端
csharp
public float SpawnRateFactor { get; set; }生成速率因子 (0~1)。
EmitterLoops 仅客户端
csharp
public int EmitterLoops { set; }循环次数。0 表示无限循环。仅支持设置。
AutoRemoveMode 仅客户端
csharp
public AutoRemoveMode AutoRemoveMode { get; set; }播放完成后的自动移除模式。
BeamScale 仅客户端
csharp
public float BeamScale { set; }[Beam] 设置射束缩放。仅支持设置。
方法
Reset 仅客户端
csharp
public void Reset(bool forceOneShot = false)重置发射器状态并重新开始发射。
forceOneShot— true 则强制只播放一次(忽略循环设置)
备注
显式设置 RandomSeed 或调用 Single) 后,重置会恢复该种子的随机序列。 未显式设置种子的旧挂载路径继续原有随机序列。
Stop 仅客户端
csharp
public void Stop(bool killOnDeactivate = false)停止发射。
killOnDeactivate— true 则立即销毁所有粒子,false 则让现有粒子自然消亡
Seek 仅客户端
csharp
public void Seek(float tickTime)增量推进指定时间量(秒),用于快进粒子状态;不是绝对时间定位。
备注
该调用保留现有增量语义:以 0.1 秒为一步,末尾余量再推进一次(恰好 0.1 秒也会推进一帧)。 时间单位为播放秒,内部会应用当前 TickSpeed;本接口不会修改 TickSpeed。 非有限值、非正时间或超过 100000 步的请求会被忽略,发射器保持原状。 需要定位到某一绝对时刻、并且要求可复现时,请使用 Single)。
TrySetDeterministicMode 仅客户端
csharp
public bool TrySetDeterministicMode(bool enabled)尝试进入或离开确定性模式,返回 false 表示该发射器不支持确定性回放。
备注
需要客户端能力版本 10。
Advance 仅客户端
csharp
public bool Advance(float seconds, float fixedStepSeconds = 0.05f)以固定步长推进指定总时长(播放秒)。返回 false 表示未处于确定性模式、参数无效、步数过多或未能完成。
备注
时间单位与每帧 deltaTime 相同:内部每次 Tick 都会应用当前 TickSpeed, 因此实际粒子时间 = × TickSpeed。本接口不会修改 TickSpeed; 需要复现时把 TickSpeed 也视为回放输入的一部分。 参数必须是有限值, 不得为负, 必须为正; 步数超过上限时直接返回 false 且不改变状态。内部按固定步长分割,末尾不足一步的余量再推进一次。 需要客户端能力版本 10,并且已打开 DeterministicMode。
Replay 仅客户端
csharp
public bool Replay(uint randomSeed, float absoluteTimeSeconds, float fixedStepSeconds = 0.05f)进入确定性模式,恢复 对应的初始状态,再按固定步长推进到 播放秒。返回 false 表示该发射器不支持确定性回放或参数无效。
备注
参数(有限值、非负时间、正步长、步数上限)和模式支持会在改变任何状态前校验;校验失败时发射器保持原状。 首期不支持包含 EmitterHierarchy 模块的回放,此时返回 false。 时间为播放秒:内部按固定步长逐次 Tick,并应用当前 TickSpeed;本接口不会修改 TickSpeed。 回放只覆盖发射器自身状态。宿主节点在回放期间应保持静止;如果粒子依赖外部逐帧输入 (例如光束端点跟随、AnimTrail 的骨骼轨迹),调用方需要在推进前自行同步这些输入。 相同种子、相同固定步长序列和相同 TickSpeed 得到相同仿真状态,但不承诺跨 GPU/平台逐像素一致。 需要客户端能力版本 10。
SetEndPoint 仅客户端
csharp
public void SetEndPoint(Vector3 endPoint)[Beam] 设置射束终点位置。
endPoint— 相对于粒子宿主 Node 的局部坐标。
备注
更新当前发射器的端点值,不建立 Node 绑定。跟随目标时,在每帧更新中将目标 Node.Position 通过粒子宿主 Node.WorldToLocal 转换后传入。无需调用 ParticleSystem.Apply。 目标或光束移除时应停止更新;ActorBeam 的单位/挂点跟随由框架管理。
SetSourcePoint 仅客户端
csharp
public void SetSourcePoint(Vector3 sourcePoint)[Beam] 设置射束起点位置。
sourcePoint— 相对于粒子宿主 Node 的局部坐标。
备注
与 SetEndPoint 一样,只更新运行时端点值。需要跟随 Node 时由调用方逐帧转换并更新坐标, 不需要修改 ParticleEmitterBeamBuilder 或调用 ParticleSystem.Apply。
PrimitiveShapeComponent 仅客户端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public class PrimitiveShapeComponent : DisposableObject, INodeComponent, IDisposable基本形状组件 - 作为NodeComponent附加到任意Node上,支持双层缩放机制
备注
架构说明: 用户的Node(外层)→ 控制位置/旋转/运行时缩放(RuntimeScale = node.LocalScale) └── PrimitiveShapeComponent(本组件) └── ShapeNode(内部子节点)→ 控制形状定义缩放 └── StaticMeshComponent(渲染) 这样设计的好处:
- 用户Node可以自由嵌套到任意父节点下
- 可以在用户Node上添加其他组件
- 用户Node的localScale作为RuntimeScale使用
- 组件的ShapeScale属性控制形状定义
属性
Node 仅客户端
csharp
public Node Node { get; }所属的Node(用户的节点,用于运行时变换)
IsEnabled 仅客户端
csharp
public bool IsEnabled { get; set; }IsReplicated 仅客户端
csharp
public bool IsReplicated { get; }Material 仅客户端
csharp
public MaterialPBR? Material { get; }材质,可以设置基本形状的颜色、金属度、粗糙度等属性
ShapeType 仅客户端
csharp
public PrimitiveShape ShapeType { get; }形状类型
ShapeScale 仅客户端
csharp
public Vector3 ShapeScale { get; set; }【形状缩放】定义形状的基本比例,如把球变成椭球
备注
这是形状的"出生形态",通常在创建时设置一次。 示例: (1, 2, 1) - 竖向拉伸的椭球/椭圆柱 (2, 1, 2) - 扁平的椭球(飞碟形) (0.5f, 1, 0.5f) - 细长的圆柱/胶囊
ShapeOffset 仅客户端
csharp
public Vector3 ShapeOffset { get; set; }【形状偏移】形状相对于所属Node的本地偏移
备注
用于调整形状的轴心点位置,如把轴心从中心移到底部
ShapeRotation 仅客户端
csharp
public Quaternion ShapeRotation { get; set; }【形状旋转】形状相对于所属Node的本地旋转
备注
用于调整形状的初始朝向,如把圆柱横放
方法
DisposeUnmanaged 仅客户端
csharp
protected override void DisposeUnmanaged(bool finalizing)PrimitiveShapeComponentExtensions 仅客户端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public static class PrimitiveShapeComponentExtensions基本形状组件的扩展方法 - 为Node提供便捷的形状创建方法
方法
AddPrimitiveShape 仅客户端
csharp
public static PrimitiveShapeComponent AddPrimitiveShape(this Node node, PrimitiveShape shapeType, HdrColor color)为Node添加基本形状组件
node— 目标节点shapeType— 形状类型color— 形状颜色
返回: 创建的形状组件
AddPrimitiveShape 仅客户端
csharp
public static PrimitiveShapeComponent AddPrimitiveShape(this Node node, PrimitiveShape shapeType, Vector3 shapeScale, HdrColor color)为Node添加基本形状组件并设置形状缩放
node— 目标节点shapeType— 形状类型shapeScale— 形状缩放color— 形状颜色
返回: 创建的形状组件
AddEllipsoid 仅客户端
csharp
public static PrimitiveShapeComponent AddEllipsoid(this Node node, float radiusX, float radiusY, float radiusZ, HdrColor color)为Node添加椭球形状
AddBox 仅客户端
csharp
public static PrimitiveShapeComponent AddBox(this Node node, float width, float height, float depth, HdrColor color)为Node添加长方体形状
Ray 双端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public struct Ray : IEquatable<Ray>属性
Origin 双端
csharp
public Vector3 Origin { get; set; }Direction 双端
csharp
public Vector3 Direction { get; set; }方法
Project 双端
csharp
public Vector3 Project(Vector3 point)DistanceTo 双端
csharp
public float DistanceTo(Vector3 point)ClosestPoint 双端
csharp
public Vector3 ClosestPoint(Ray other)HitDistance 双端
csharp
public float HitDistance(Plane plane)HitDistance 双端
csharp
public float HitDistance(BoundingBox box)HitDistance 双端
csharp
public float HitDistance(Frustum frustum, bool solidInside = true)HitDistance 双端
csharp
public float HitDistance(Sphere sphere)HitDistance 双端
csharp
public float HitDistance(Vector3 v0, Vector3 v1, Vector3 v2)Transform 双端
csharp
public Ray Transform(Matrix4x4 affineTransform)ToString 双端
csharp
public override readonly string ToString()operator != 双端
csharp
public static bool operator !=(Ray left, Ray right)operator == 双端
csharp
public static bool operator ==(Ray left, Ray right)GetHashCode 双端
csharp
public override readonly int GetHashCode()Equals 双端
csharp
public override readonly bool Equals(object obj)Equals 双端
csharp
public readonly bool Equals(Ray other)Renderer2D 双端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public sealed class Renderer2D : Drawable, INodeComponent, IDisposableUrho2D renderer component used to batch and render Drawable2D components.
备注
You normally do not need to create this component yourself: Drawable2D components create the scene renderer and register themselves automatically when attached to a scene. Renderer2D uses the built-in unlit Urho2D material by default.
构造函数
Renderer2D 双端
csharp
public Renderer2D()Creates a Renderer2D component.
方法
CheckVisibility 双端
csharp
public bool CheckVisibility(Drawable2D drawable)Tests whether the specified 2D drawable is visible to this renderer's current view.
drawable— Drawable2D component to test.
返回: true if the drawable passes view-mask and frustum checks; otherwise false.
AddDrawable 双端
csharp
public void AddDrawable(Drawable2D drawable)Adds a drawable that is not attached to this renderer's scene. Drawables attached to a scene are registered automatically and do not need this call. Repeated calls for the same drawable have no effect.
RemoveDrawable 双端
csharp
public void RemoveDrawable(Drawable2D drawable)Removes all registrations of a drawable from this renderer. A drawable that remains enabled in the scene may be registered again by its normal scene lifecycle.
GetMaterial 仅客户端
csharp
public Material? GetMaterial(Texture2D? texture, BlendMode blendMode)Gets the cached material for a texture/blend-mode pair.
RibbonTrailComponent 仅客户端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public sealed class RibbonTrailComponent : Drawable, INodeComponent, IDisposableClient-side drawable that leaves a configurable ribbon behind its node.
备注
A ribbon trail updates GPU geometry and therefore intentionally lives behind the client build boundary. Its gameplay-facing controls are ordinary scalar and value-type properties; the material remains an opaque client resource.
构造函数
RibbonTrailComponent 仅客户端
csharp
public RibbonTrailComponent()属性
Material 仅客户端
csharp
public Material? Material { get; set; }VertexDistance 仅客户端
csharp
public float VertexDistance { get; set; }Width 仅客户端
csharp
public float Width { get; set; }StartColor 仅客户端
csharp
public Color StartColor { get; set; }EndColor 仅客户端
csharp
public Color EndColor { get; set; }StartScale 仅客户端
csharp
public float StartScale { get; set; }EndScale 仅客户端
csharp
public float EndScale { get; set; }TrailType 仅客户端
csharp
public RibbonTrailType TrailType { get; set; }BaseVelocity 仅客户端
csharp
public Vector3 BaseVelocity { get; set; }Sorted 仅客户端
csharp
public bool Sorted { get; set; }Lifetime 仅客户端
csharp
public float Lifetime { get; set; }Emitting 仅客户端
csharp
public bool Emitting { get; set; }UpdateInvisible 仅客户端
csharp
public bool UpdateInvisible { get; set; }TailColumn 仅客户端
csharp
public uint TailColumn { get; set; }AnimationLodBias 仅客户端
csharp
public float AnimationLodBias { get; set; }方法
Commit 仅客户端
csharp
public void Commit()RibbonTrailType 仅客户端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public enum RibbonTrailType枚举值
FaceCameraBone
ShadowQuality 仅客户端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public enum ShadowQuality枚举值
Simple16BitSimple24BitPcf16BitPcf24BitVarianceShadowMapBlurredVarianceShadowMap
SkinTextureBufferComponent 仅客户端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public sealed class SkinTextureBufferComponent : EngineNodeComponent, INodeComponent, IDisposableClient-side skinning texture atlas component. The atlas is owned and updated by the renderer; callers only receive borrowed resource wrappers and must not attempt to replace or dispose the textures independently.
构造函数
SkinTextureBufferComponent 仅客户端
csharp
public SkinTextureBufferComponent()属性
SkinTexture 仅客户端
csharp
public Texture2D? SkinTexture { get; }Current-frame skinning atlas, or null before the first update.
SkyboxComponent 仅客户端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public class SkyboxComponent : StaticMeshComponent, INodeComponent, IDisposable构造函数
SkyboxComponent 仅客户端
csharp
public SkyboxComponent()Socket 仅客户端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public readonly struct Socket : IEquatable<Socket>角色挂点(Socket)信息。挂点是建模时定义的骨骼相对位置,常用于挂载武器、特效、装备等子节点。 通过 String) 获取。
BoneNode— 挂点所绑骨骼的场景 Node,把子节点 attach 到这个 Node 上即可跟随动画移动。LocalPosition— 挂点相对骨骼 Node 的局部偏移(建模时定义)。LocalRotation— 挂点相对骨骼 Node 的局部旋转。LocalScale— 挂点的局部缩放。
构造函数
Socket 仅客户端
csharp
public Socket(Node BoneNode, Vector3 LocalPosition, Quaternion LocalRotation, Vector3 LocalScale)角色挂点(Socket)信息。挂点是建模时定义的骨骼相对位置,常用于挂载武器、特效、装备等子节点。 通过 String) 获取。
BoneNode— 挂点所绑骨骼的场景 Node,把子节点 attach 到这个 Node 上即可跟随动画移动。LocalPosition— 挂点相对骨骼 Node 的局部偏移(建模时定义)。LocalRotation— 挂点相对骨骼 Node 的局部旋转。LocalScale— 挂点的局部缩放。
属性
BoneNode 仅客户端
csharp
public Node BoneNode { get; init; }挂点所绑骨骼的场景 Node,把子节点 attach 到这个 Node 上即可跟随动画移动。
LocalPosition 仅客户端
csharp
public Vector3 LocalPosition { get; init; }挂点相对骨骼 Node 的局部偏移(建模时定义)。
LocalRotation 仅客户端
csharp
public Quaternion LocalRotation { get; init; }挂点相对骨骼 Node 的局部旋转。
LocalScale 仅客户端
csharp
public Vector3 LocalScale { get; init; }挂点的局部缩放。
方法
ToString 仅客户端
csharp
public override string ToString()operator != 仅客户端
csharp
public static bool operator !=(Socket left, Socket right)operator == 仅客户端
csharp
public static bool operator ==(Socket left, Socket right)GetHashCode 仅客户端
csharp
public override int GetHashCode()Equals 仅客户端
csharp
public override bool Equals(object obj)Equals 仅客户端
csharp
public bool Equals(Socket other)Deconstruct 仅客户端
csharp
public void Deconstruct(out Node BoneNode, out Vector3 LocalPosition, out Quaternion LocalRotation, out Vector3 LocalScale)StaticMeshComponent 仅客户端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public class StaticMeshComponent : Drawable, INodeComponent, IDisposable构造函数
StaticMeshComponent 仅客户端
csharp
public StaticMeshComponent()StaticMeshComponent 仅客户端
csharp
protected StaticMeshComponent(string objectType)属性
RenderDebugNormals 仅客户端
csharp
public bool RenderDebugNormals { get; set; }Mesh 仅客户端
csharp
public Mesh? Mesh { get; set; }获取/设置 Mesh
Material 仅客户端
csharp
public Material? Material { get; set; }获取/设置材质
Materials 仅客户端
csharp
public Material[] Materials { get; set; }获取/设置材质数组
NumGeometries 仅客户端
csharp
public uint NumGeometries { get; }几何体数量
OcclusionLodLevel 仅客户端
csharp
public uint OcclusionLodLevel { get; set; }遮挡 LOD 等级
方法
IsInside 仅客户端
csharp
public bool IsInside(Vector3 point)判断世界空间点是否在模型内部
IsInsideLocal 仅客户端
csharp
public bool IsInsideLocal(Vector3 point)判断本地空间点是否在模型内部
ApplyMaterialList 仅客户端
csharp
public void ApplyMaterialList(string fileName)从文件应用材质列表
GetMaterial 仅客户端
csharp
public Material? GetMaterial(uint index)获取指定索引的材质
SetMaterial 仅客户端
csharp
public bool SetMaterial(uint index, Material material)设置指定索引的材质
StaticModelGroupComponent 仅客户端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public sealed class StaticModelGroupComponent : StaticMeshComponent, INodeComponent, IDisposable使用同一模型和材质批量渲染多个场景节点的静态模型组。
构造函数
StaticModelGroupComponent 仅客户端
csharp
public StaticModelGroupComponent()属性
InstanceCount 仅客户端
csharp
public uint InstanceCount { get; }方法
AddInstance 仅客户端
csharp
public void AddInstance(Node node)RemoveInstance 仅客户端
csharp
public void RemoveInstance(Node node)RemoveAllInstances 仅客户端
csharp
public void RemoveAllInstances()GetInstance 仅客户端
csharp
public Node? GetInstance(uint index)StaticSprite2D 仅客户端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public class StaticSprite2D : Drawable2D, INodeComponent, IDisposableRenders a single 2D sprite inside a GameGraph scene.
备注
StaticSprite2D is a client-side visual component. The sprite is transformed by its node as world-space 2D geometry; it is not automatically billboarded. The default Urho2D material is unlit, so lights and shadows do not affect it. Use Color and Alpha for manual tinting and fading.
构造函数
StaticSprite2D 仅客户端
csharp
public StaticSprite2D()Creates a StaticSprite2D component.
StaticSprite2D 仅客户端
csharp
protected StaticSprite2D(string objectType)属性
Sprite 仅客户端
csharp
public Sprite2D? Sprite { get; set; }Gets or sets the sprite resource to render.
DrawRect 仅客户端
csharp
public RectangleF DrawRect { get; set; }Gets or sets the local draw rectangle used when UseDrawRect is enabled.
TextureRect 仅客户端
csharp
public RectangleF TextureRect { get; set; }Gets or sets the source texture rectangle used when UseTextureRect is enabled.
BlendMode 仅客户端
csharp
public BlendMode BlendMode { get; set; }Gets or sets the blend mode used by the sprite material.
FlipX 仅客户端
csharp
public bool FlipX { get; set; }Gets or sets whether the sprite is flipped horizontally.
FlipY 仅客户端
csharp
public bool FlipY { get; set; }Gets or sets whether the sprite is flipped vertically.
SwapXY 仅客户端
csharp
public bool SwapXY { get; set; }Gets or sets whether X and Y texture axes are swapped.
Color 仅客户端
csharp
public Color Color { get; set; }Gets or sets the color multiplied with the sprite texture.
备注
This is the normal way to tint an unlit 2D sprite so it better matches the surrounding 3D scene. It is not affected by scene lights.
Alpha 仅客户端
csharp
public float Alpha { get; set; }Gets or sets the alpha multiplier.
UseHotSpot 仅客户端
csharp
public bool UseHotSpot { get; set; }Gets or sets whether HotSpot is used as the sprite pivot.
UseDrawRect 仅客户端
csharp
public bool UseDrawRect { get; set; }Gets or sets whether DrawRect overrides the sprite's default draw rectangle.
UseTextureRect 仅客户端
csharp
public bool UseTextureRect { get; set; }Gets or sets whether TextureRect overrides the sprite's default texture rectangle.
HotSpot 仅客户端
csharp
public Vector2 HotSpot { get; set; }Gets or sets the sprite pivot in normalized texture space.
备注
(0.5, 0.5) is the center, (0, 0) is one corner. Enable UseHotSpot for this value to affect rendering.
CustomMaterial 仅客户端
csharp
public Material? CustomMaterial { get; set; }Gets or sets a custom material for the sprite.
备注
Leave this null to use the built-in Urho2D material generated by Renderer2D. A custom material is an advanced escape hatch for specialized shaders.
方法
SetFlip 仅客户端
csharp
public void SetFlip(bool flipX, bool flipY, bool swapXY = false)Sets horizontal flip, vertical flip, and optional texture-axis swap in one call.
flipX— Whether to flip horizontally.flipY— Whether to flip vertically.swapXY— Whether to swap X and Y texture axes.
StretchableSprite2D 仅客户端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public sealed class StretchableSprite2D : StaticSprite2D, INodeComponent, IDisposableNine-patch style Urho2D sprite component with independently stretched borders.
构造函数
StretchableSprite2D 仅客户端
csharp
public StretchableSprite2D()属性
Border 仅客户端
csharp
public Rectangle Border { get; set; }Border thickness in source-texture pixels.
TerrainComponent 仅客户端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public sealed class TerrainComponent : EngineNodeComponent, INodeComponent, IDisposableUrho Terrain 运行时组件。高度图和材质等资源仍由客户端资源系统管理, 此处只暴露几何、邻接、LOD、遮罩和高度查询等运行时 API。
构造函数
TerrainComponent 仅客户端
csharp
public TerrainComponent()属性
PatchSize 仅客户端
csharp
public int PatchSize { get; set; }Spacing 仅客户端
csharp
public Vector3 Spacing { get; set; }NumVertices 仅客户端
csharp
public (int x, int y) NumVertices { get; }NumPatches 仅客户端
csharp
public (int x, int y) NumPatches { get; }MaxLodLevels 仅客户端
csharp
public uint MaxLodLevels { get; set; }OcclusionLodLevel 仅客户端
csharp
public uint OcclusionLodLevel { get; set; }Smoothing 仅客户端
csharp
public bool Smoothing { get; set; }HeightMap 仅客户端
csharp
public Image? HeightMap { get; set; }Material 仅客户端
csharp
public Material? Material { get; set; }NorthNeighbor 仅客户端
csharp
public TerrainComponent? NorthNeighbor { get; set; }SouthNeighbor 仅客户端
csharp
public TerrainComponent? SouthNeighbor { get; set; }WestNeighbor 仅客户端
csharp
public TerrainComponent? WestNeighbor { get; set; }EastNeighbor 仅客户端
csharp
public TerrainComponent? EastNeighbor { get; set; }DrawDistance 仅客户端
csharp
public float DrawDistance { get; set; }ShadowDistance 仅客户端
csharp
public float ShadowDistance { get; set; }LodBias 仅客户端
csharp
public float LodBias { get; set; }ViewMask 仅客户端
csharp
public uint ViewMask { get; set; }LightMask 仅客户端
csharp
public uint LightMask { get; set; }ShadowMask 仅客户端
csharp
public uint ShadowMask { get; set; }ZoneMask 仅客户端
csharp
public uint ZoneMask { get; set; }MaxLights 仅客户端
csharp
public uint MaxLights { get; set; }CastShadows 仅客户端
csharp
public bool CastShadows { get; set; }IsOccluder 仅客户端
csharp
public bool IsOccluder { get; set; }IsOccludee 仅客户端
csharp
public bool IsOccludee { get; set; }IsVisible 仅客户端
csharp
public bool IsVisible { get; }方法
SetNeighbors 仅客户端
csharp
public void SetNeighbors(TerrainComponent? north, TerrainComponent? south, TerrainComponent? west, TerrainComponent? east)GetHeight 仅客户端
csharp
public float GetHeight(Vector3 worldPosition)GetNormal 仅客户端
csharp
public Vector3 GetNormal(Vector3 worldPosition)IsSplineRoad 仅客户端
csharp
public bool IsSplineRoad(int x, int y)IsBeach 仅客户端
csharp
public bool IsBeach(int x, int y)IsSplitStyle 仅客户端
csharp
public bool IsSplitStyle(int x, int y)WorldToHeightMap 仅客户端
csharp
public (int x, int y) WorldToHeightMap(Vector3 worldPosition)将世界坐标转换为高度图像素坐标。
HeightMapToWorld 仅客户端
csharp
public Vector3 HeightMapToWorld(int x, int y)将高度图像素坐标转换为世界坐标。
GetPatch 仅客户端
csharp
public TerrainPatch? GetPatch(uint index)GetPatch 仅客户端
csharp
public TerrainPatch? GetPatch(int x, int z)GetNeighborPatch 仅客户端
csharp
public TerrainPatch? GetNeighborPatch(int x, int z)ApplyHeightMap 仅客户端
csharp
public void ApplyHeightMap()TerrainPatch 仅客户端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public sealed class TerrainPatch : EngineObjectClient terrain patch view. A patch is an engine drawable owned by Terrain; callers must not dispose it independently of its owning terrain.
属性
Geometry 仅客户端
csharp
public Geometry? Geometry { get; }MaxLodGeometry 仅客户端
csharp
public Geometry? MaxLodGeometry { get; }OcclusionGeometry 仅客户端
csharp
public Geometry? OcclusionGeometry { get; }VertexBuffer 仅客户端
csharp
public VertexBuffer? VertexBuffer { get; }Owner 仅客户端
csharp
public TerrainComponent? Owner { get; }NorthPatch 仅客户端
csharp
public TerrainPatch? NorthPatch { get; }SouthPatch 仅客户端
csharp
public TerrainPatch? SouthPatch { get; }WestPatch 仅客户端
csharp
public TerrainPatch? WestPatch { get; }EastPatch 仅客户端
csharp
public TerrainPatch? EastPatch { get; }Material 仅客户端
csharp
public Material? Material { set; }Coordinates 仅客户端
csharp
public (int x, int y) Coordinates { get; set; }LodLevel 仅客户端
csharp
public uint LodLevel { get; }方法
SetOwner 仅客户端
csharp
public void SetOwner(TerrainComponent? terrain)SetNeighbors 仅客户端
csharp
public void SetNeighbors(TerrainPatch? north, TerrainPatch? south, TerrainPatch? west, TerrainPatch? east)SetBoundingBox 仅客户端
csharp
public void SetBoundingBox(BoundingBox box)ResetLod 仅客户端
csharp
public void ResetLod()Text3DComponent 仅客户端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public sealed class Text3DComponent : Drawable, INodeComponent, IDisposable渲染在 3D 场景中的文本组件。
构造函数
Text3DComponent 仅客户端
csharp
public Text3DComponent()属性
FontSize 仅客户端
csharp
public float FontSize { get; set; }Material 仅客户端
csharp
public Material? Material { get; set; }Text 仅客户端
csharp
public string Text { get; set; }HorizontalAlignment 仅客户端
csharp
public TextHorizontalAlignment HorizontalAlignment { get; set; }获取或设置整个文本块相对 Node 原点的水平对齐方式。 与 ActorText 使用同一套对齐语义。
VerticalAlignment 仅客户端
csharp
public TextVerticalAlignment VerticalAlignment { get; set; }获取或设置整个文本块相对 Node 原点的垂直对齐方式。 与 ActorText 使用同一套对齐语义。
TextAlignment 仅客户端
csharp
public TextHorizontalAlignment TextAlignment { get; set; }获取或设置文本块中每一行的水平对齐方式。
RowSpacing 仅客户端
csharp
public float RowSpacing { get; set; }WordWrap 仅客户端
csharp
public bool WordWrap { get; set; }Effect 仅客户端
csharp
public TextEffect Effect { get; set; }EffectShadowOffset 仅客户端
csharp
public Point EffectShadowOffset { get; set; }EffectStrokeThickness 仅客户端
csharp
public int EffectStrokeThickness { get; set; }EffectRoundStroke 仅客户端
csharp
public bool EffectRoundStroke { get; set; }EffectColor 仅客户端
csharp
public Color EffectColor { get; set; }EffectDepthBias 仅客户端
csharp
public float EffectDepthBias { get; set; }Width 仅客户端
csharp
public int Width { get; set; }Height 仅客户端
csharp
public int Height { get; }RowHeight 仅客户端
csharp
public int RowHeight { get; }RowCount 仅客户端
csharp
public uint RowCount { get; }CharacterCount 仅客户端
csharp
public uint CharacterCount { get; }Opacity 仅客户端
csharp
public float Opacity { get; set; }FixedScreenSize 仅客户端
csharp
public bool FixedScreenSize { get; set; }FaceCameraMode 仅客户端
csharp
public FaceCameraMode FaceCameraMode { get; set; }方法
SetFont 仅客户端
csharp
public bool SetFont(string fontName, float size = 12f)SetAlignment 仅客户端
csharp
public void SetAlignment(TextHorizontalAlignment horizontal, TextVerticalAlignment vertical)SetEffectShadowColor 仅客户端
csharp
public void SetEffectShadowColor(Color color)SetColor 仅客户端
csharp
public void SetColor(Color color)SetColor 仅客户端
csharp
public void SetColor(TextCorner corner, Color color)GetColor 仅客户端
csharp
public Color GetColor(TextCorner corner)GetRowWidth 仅客户端
csharp
public int GetRowWidth(uint row)GetCharacterPosition 仅客户端
csharp
public Vector2 GetCharacterPosition(uint index)GetCharacterSize 仅客户端
csharp
public Vector2 GetCharacterSize(uint index)TextCorner 仅客户端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public enum TextCorner枚举值
TopLeftTopRightBottomLeftBottomRight
TextEffect 仅客户端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public enum TextEffect枚举值
NoneShadowStrokeAuto
TileMap2DComponent 仅客户端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public sealed class TileMap2DComponent : EngineNodeComponent, INodeComponent, IDisposableClient-side Urho2D tile-map component.
构造函数
TileMap2DComponent 仅客户端
csharp
public TileMap2DComponent()属性
TmxFile 仅客户端
csharp
public TmxFile2D? TmxFile { get; set; }Info 仅客户端
csharp
public TileMapInfo Info { get; }LayerCount 仅客户端
csharp
public uint LayerCount { get; }方法
GetLayer 仅客户端
csharp
public TileMapLayer2D? GetLayer(uint index)TileIndexToPosition 仅客户端
csharp
public Vector2 TileIndexToPosition(int x, int y)TryPositionToTileIndex 仅客户端
csharp
public bool TryPositionToTileIndex(Vector2 position, out IntVector2 tile)PositionToTileIndex 仅客户端
csharp
public bool PositionToTileIndex(Vector2 position, out int x, out int y)DrawDebugGeometry 仅客户端
csharp
public void DrawDebugGeometry()TileMapInfo 仅客户端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public readonly struct TileMapInfo : IEquatable<TileMapInfo>构造函数
TileMapInfo 仅客户端
csharp
public TileMapInfo(TileMapOrientation Orientation, int Width, int Height, float TileWidth, float TileHeight)属性
Orientation 仅客户端
csharp
public TileMapOrientation Orientation { get; init; }Width 仅客户端
csharp
public int Width { get; init; }Height 仅客户端
csharp
public int Height { get; init; }TileWidth 仅客户端
csharp
public float TileWidth { get; init; }TileHeight 仅客户端
csharp
public float TileHeight { get; init; }MapWidth 仅客户端
csharp
public float MapWidth { get; }MapHeight 仅客户端
csharp
public float MapHeight { get; }方法
ToString 仅客户端
csharp
public override string ToString()operator != 仅客户端
csharp
public static bool operator !=(TileMapInfo left, TileMapInfo right)operator == 仅客户端
csharp
public static bool operator ==(TileMapInfo left, TileMapInfo right)GetHashCode 仅客户端
csharp
public override int GetHashCode()Equals 仅客户端
csharp
public override bool Equals(object obj)Equals 仅客户端
csharp
public bool Equals(TileMapInfo other)Deconstruct 仅客户端
csharp
public void Deconstruct(out TileMapOrientation Orientation, out int Width, out int Height, out float TileWidth, out float TileHeight)TileMapLayer2D 仅客户端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public sealed class TileMapLayer2D : EngineNodeComponent, INodeComponent, IDisposableRead/write metadata and data access for a loaded tile-map layer.
属性
TileMap 仅客户端
csharp
public TileMap2DComponent? TileMap { get; }DrawOrder 仅客户端
csharp
public int DrawOrder { get; set; }IsVisible 仅客户端
csharp
public bool IsVisible { get; set; }LayerType 仅客户端
csharp
public TileMapLayerKind LayerType { get; }Width 仅客户端
csharp
public int Width { get; }Height 仅客户端
csharp
public int Height { get; }ObjectCount 仅客户端
csharp
public uint ObjectCount { get; }ImageNode 仅客户端
csharp
public Node? ImageNode { get; }方法
HasProperty 仅客户端
csharp
public bool HasProperty(UTF8String name)GetProperty 仅客户端
csharp
public UTF8String GetProperty(UTF8String name)GetTileNode 仅客户端
csharp
public Node? GetTileNode(int x, int y)GetTile 仅客户端
csharp
public Tile2D? GetTile(int x, int y)GetObject 仅客户端
csharp
public TileMapObject2D? GetObject(uint index)GetObjectNode 仅客户端
csharp
public Node? GetObjectNode(uint index)TileMapLayerKind 仅客户端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public enum TileMapLayerKind枚举值
TileLayer = 0ObjectGroup = 1ImageLayer = 2Invalid = 65535
TileMapObjectKind 仅客户端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public enum TileMapObjectKind枚举值
Rectangle = 0Ellipse = 1Polygon = 2Polyline = 3Tile = 4Invalid = 65535
TileMapOrientation 仅客户端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public enum TileMapOrientation枚举值
OrthogonalIsometricStaggeredHexagonal
VertexBuffer 仅客户端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public sealed class VertexBuffer : EngineObject构造函数
VertexBuffer 仅客户端
csharp
public VertexBuffer()属性
Shadowed 仅客户端
csharp
public bool Shadowed { get; set; }IsDynamic 仅客户端
csharp
public bool IsDynamic { get; }VertexCount 仅客户端
csharp
public uint VertexCount { get; }VertexSize 仅客户端
csharp
public uint VertexSize { get; }ElementMask 仅客户端
csharp
public uint ElementMask { get; }UsageFlags 仅客户端
csharp
public uint UsageFlags { get; }方法
SetSize 仅客户端
csharp
public bool SetSize(uint vertexCount, uint elementMask, bool dynamic = false, uint usageFlags = 0u)SetSize 仅客户端
csharp
public bool SetSize(uint vertexCount, bool dynamic, uint usageFlags, params VertexElementInfo[] elements)HasElement 仅客户端
csharp
public bool HasElement(VertexElementSemantic semantic, byte index = 0)HasElement 仅客户端
csharp
public bool HasElement(VertexElementType type, VertexElementSemantic semantic, byte index = 0)GetElementOffset 仅客户端
csharp
public uint GetElementOffset(VertexElementSemantic semantic, byte index = 0)GetElementOffset 仅客户端
csharp
public uint GetElementOffset(VertexElementType type, VertexElementSemantic semantic, byte index = 0)SetData 仅客户端
csharp
public bool SetData(ReadOnlySpan<byte> data)SetDataRange 仅客户端
csharp
public bool SetDataRange(ReadOnlySpan<byte> data, uint start, uint count, bool discard = false)GetData 仅客户端
csharp
public byte[] GetData()GetElements 仅客户端
csharp
public VertexElementInfo[] GetElements()VertexElementInfo 仅客户端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public readonly struct VertexElementInfo : IEquatable<VertexElementInfo>构造函数
VertexElementInfo 仅客户端
csharp
public VertexElementInfo(VertexElementType Type, VertexElementSemantic Semantic, bool PerInstance, uint Offset)属性
Type 仅客户端
csharp
public VertexElementType Type { get; init; }Semantic 仅客户端
csharp
public VertexElementSemantic Semantic { get; init; }PerInstance 仅客户端
csharp
public bool PerInstance { get; init; }Offset 仅客户端
csharp
public uint Offset { get; init; }方法
ToString 仅客户端
csharp
public override string ToString()operator != 仅客户端
csharp
public static bool operator !=(VertexElementInfo left, VertexElementInfo right)operator == 仅客户端
csharp
public static bool operator ==(VertexElementInfo left, VertexElementInfo right)GetHashCode 仅客户端
csharp
public override int GetHashCode()Equals 仅客户端
csharp
public override bool Equals(object obj)Equals 仅客户端
csharp
public bool Equals(VertexElementInfo other)Deconstruct 仅客户端
csharp
public void Deconstruct(out VertexElementType Type, out VertexElementSemantic Semantic, out bool PerInstance, out uint Offset)VertexElementSemantic 仅客户端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public enum VertexElementSemantic枚举值
PositionNormalBinormalTangentTexCoordColorBlendWeightsBlendIndicesObjectIndex
VertexElementType 仅客户端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public enum VertexElementType枚举值
IntFloatVector2Vector3Vector4UByte4UByte4Norm
Zone 双端
命名空间 GameGraph.NodeSystem.Component.Graphics
csharp
public class Zone : Drawable, INodeComponent, IDisposable双端 3D 环境区域组件。服务端可维护权威环境状态,实际渲染仅发生在客户端。
备注
Zone 控制环境光、雾效、环境贴图强度以及部分后处理参数; 对 SCE 地图内置 LightGroup/Zone 的高层访问优先使用 或 。
构造函数
Zone 双端
csharp
public Zone()属性
AmbientColor 双端
csharp
public Color AmbientColor { get; set; }环境光颜色。
AmbientStartColor 双端
csharp
public Color AmbientStartColor { get; }AmbientEndColor 双端
csharp
public Color AmbientEndColor { get; }InverseWorldTransform 双端
csharp
public Matrix4x4 InverseWorldTransform { get; }VertexAmbientColor 双端
csharp
public Color VertexAmbientColor { get; set; }顶点环境光颜色。
备注
某些地形、模型或简化光照路径会使用该颜色作为顶点环境光来源。
FogColor 双端
csharp
public Color FogColor { get; set; }深度雾和高度雾使用的雾颜色。
DepthFogDensity 双端
csharp
public float DepthFogDensity { get; set; }深度雾密度。
DepthFogStart 双端
csharp
public float DepthFogStart { get; set; }深度雾开始距离。
DepthFogEnd 双端
csharp
public float DepthFogEnd { get; set; }深度雾结束距离。
DepthFogEnable 双端
csharp
public bool DepthFogEnable { get; set; }是否启用深度雾。
HeightFogDensity 双端
csharp
public float HeightFogDensity { get; set; }高度雾密度。
HeightFogHeight 双端
csharp
public float HeightFogHeight { get; set; }高度雾基准高度。
HeightFogFalloff 双端
csharp
public float HeightFogFalloff { get; set; }高度雾随高度衰减的系数。
HeightFogEnable 双端
csharp
public bool HeightFogEnable { get; set; }是否启用高度雾。
Priority 双端
csharp
public int Priority { get; set; }Zone 优先级。多个 Zone 重叠时通常优先使用优先级更高的参数。
Override 双端
csharp
public bool Override { get; set; }是否覆盖低优先级或父级 Zone 的环境参数。
AmbientGradient 双端
csharp
public bool AmbientGradient { get; set; }是否启用环境光渐变。
UseGlobalRoughness 双端
csharp
public bool UseGlobalRoughness { get; set; }是否使用全局粗糙度覆盖环境反射粗糙度。
EnvTextureDiffIntensity 双端
csharp
public float EnvTextureDiffIntensity { get; set; }环境贴图漫反射强度。
EnvTextureSpecIntensity 双端
csharp
public float EnvTextureSpecIntensity { get; set; }环境贴图高光反射强度。
EnvCubeAngle 双端
csharp
public float EnvCubeAngle { get; set; }环境立方体贴图旋转角度。
EnvCubeFollowAngle 双端
csharp
public float EnvCubeFollowAngle { get; set; }环境立方体贴图跟随角度。
GlobalRoughness 双端
csharp
public float GlobalRoughness { get; set; }全局粗糙度值。通常配合 UseGlobalRoughness 使用。
UseRoleSH 双端
csharp
public bool UseRoleSH { get; set; }是否为角色使用球谐光照参数。
RoleSHIntensity 双端
csharp
public float RoleSHIntensity { get; set; }角色球谐光照强度。
RoleSHAngle 双端
csharp
public float RoleSHAngle { get; set; }角色球谐光照角度。
BloomThreshold 双端
csharp
public float BloomThreshold { get; set; }Bloom 后处理阈值。
BloomWeight 双端
csharp
public float BloomWeight { get; set; }Bloom 后处理权重。
VignetteEnabled 双端
csharp
public bool VignetteEnabled { get; set; }是否启用暗角后处理。
备注
启用前需在 LightGroup XML 的 Vignette Texture 属性中配置有效遮罩。 遮罩红色通道参与画面乘法合成;不要只迁移其它引擎的开关而遗漏纹理。
VignetteIntensity 双端
csharp
public float VignetteIntensity { get; set; }暗角后处理强度。
备注
使用有限正数。遮罩红色通道除以该值后截断到 1,再乘到画面颜色; 设为 1 保留遮罩原有明暗,数值增大会使画面更暗,不能按其它引擎的同名参数直接换算。
方法
SetBoundingBox 双端
csharp
public void SetBoundingBox(BoundingBox box)设置 Zone 的空间影响范围(局部坐标系)。
box— Zone 在所属节点局部坐标系中的包围盒。
IsInside 双端
csharp
public bool IsInside(Vector3 point)IKConstraint 仅客户端
命名空间 GameGraph.NodeSystem.Component.IK
csharp
public sealed class IKConstraint : EngineNodeComponent, INodeComponent, IDisposable限制 IK 链段伸缩与弯曲的约束组件。
构造函数
IKConstraint 仅客户端
csharp
public IKConstraint()属性
Stiffness 仅客户端
csharp
public float Stiffness { get; set; }Stretchiness 仅客户端
csharp
public float Stretchiness { get; set; }LengthConstraints 仅客户端
csharp
public Vector2 LengthConstraints { get; set; }IKEffector 仅客户端
命名空间 GameGraph.NodeSystem.Component.IK
csharp
public sealed class IKEffector : EngineNodeComponent, INodeComponent, IDisposableIK 链末端执行器,描述目标位置、旋转与影响权重。
构造函数
IKEffector 仅客户端
csharp
public IKEffector()属性
TargetNode 仅客户端
csharp
public Node? TargetNode { get; set; }TargetName 仅客户端
csharp
public string TargetName { get; set; }TargetPosition 仅客户端
csharp
public Vector3 TargetPosition { get; set; }TargetRotation 仅客户端
csharp
public Quaternion TargetRotation { get; set; }TargetRotationEuler 仅客户端
csharp
public Vector3 TargetRotationEuler { get; set; }ChainLength 仅客户端
csharp
public uint ChainLength { get; set; }Weight 仅客户端
csharp
public float Weight { get; set; }RotationWeight 仅客户端
csharp
public float RotationWeight { get; set; }RotationDecay 仅客户端
csharp
public float RotationDecay { get; set; }WeightNlerp 仅客户端
csharp
public bool WeightNlerp { get; set; }InheritParentRotation 仅客户端
csharp
public bool InheritParentRotation { get; set; }方法
DrawDebugGeometry 仅客户端
csharp
public void DrawDebugGeometry(bool depthTest = true)IKSolver 仅客户端
命名空间 GameGraph.NodeSystem.Component.IK
csharp
public sealed class IKSolver : EngineNodeComponent, INodeComponent, IDisposableIK 链求解器组件。
构造函数
IKSolver 仅客户端
csharp
public IKSolver()属性
Algorithm 仅客户端
csharp
public IKSolverAlgorithm Algorithm { get; set; }MaximumIterations 仅客户端
csharp
public uint MaximumIterations { get; set; }Tolerance 仅客户端
csharp
public float Tolerance { get; set; }JointRotations 仅客户端
csharp
public bool JointRotations { get; set; }TargetRotations 仅客户端
csharp
public bool TargetRotations { get; set; }UpdateOriginalPose 仅客户端
csharp
public bool UpdateOriginalPose { get; set; }UpdateActivePose 仅客户端
csharp
public bool UpdateActivePose { get; set; }UseOriginalPose 仅客户端
csharp
public bool UseOriginalPose { get; set; }ConstraintsEnabled 仅客户端
csharp
public bool ConstraintsEnabled { get; set; }AutoSolve 仅客户端
csharp
public bool AutoSolve { get; set; }方法
RebuildChainTrees 仅客户端
csharp
public void RebuildChainTrees()RecalculateSegmentLengths 仅客户端
csharp
public void RecalculateSegmentLengths()CalculateJointRotations 仅客户端
csharp
public void CalculateJointRotations()Solve 仅客户端
csharp
public void Solve()ApplyOriginalPoseToScene 仅客户端
csharp
public void ApplyOriginalPoseToScene()ApplySceneToOriginalPose 仅客户端
csharp
public void ApplySceneToOriginalPose()ApplyActivePoseToScene 仅客户端
csharp
public void ApplyActivePoseToScene()ApplySceneToActivePose 仅客户端
csharp
public void ApplySceneToActivePose()ApplyOriginalPoseToActivePose 仅客户端
csharp
public void ApplyOriginalPoseToActivePose()MarkSegmentLengthNeedUpdating 仅客户端
csharp
public void MarkSegmentLengthNeedUpdating()DrawDebugGeometry 仅客户端
csharp
public void DrawDebugGeometry(bool depthTest = true)IKSolverAlgorithm 仅客户端
命名空间 GameGraph.NodeSystem.Component.IK
csharp
public enum IKSolverAlgorithm枚举值
OneBoneTwoBoneFabrik
CharacterCollisionRole 双端
命名空间 GameGraph.NodeSystem.Component.Physics
csharp
public enum CharacterCollisionRole枚举值
UnknownWalkableSurfaceObstacleDecorationNoCharacterCollisionPhysicsOnlyQueryOnly
CharacterCollisionRoleRules 双端
命名空间 GameGraph.NodeSystem.Component.Physics
csharp
public static class CharacterCollisionRoleRules方法
CanServeAsCharacterGround 双端
csharp
public static bool CanServeAsCharacterGround(this CharacterCollisionRole role)BlocksCharacterMovement 双端
csharp
public static bool BlocksCharacterMovement(this CharacterCollisionRole role)ParticipatesInCharacterCollision 双端
csharp
public static bool ParticipatesInCharacterCollision(this CharacterCollisionRole role)ParticipatesInGenericPhysics 双端
csharp
public static bool ParticipatesInGenericPhysics(this CharacterCollisionRole role)ParticipatesInQueries 双端
csharp
public static bool ParticipatesInQueries(this CharacterCollisionRole role)CollisionEventMode 双端
命名空间 GameGraph.NodeSystem.Component.Physics
csharp
public enum CollisionEventMode枚举值
NeverActiveAlways
CollisionShape 双端
命名空间 GameGraph.NodeSystem.Component.Physics
csharp
public sealed class CollisionShape : EngineNodeComponent, INodeComponent, IDisposable3D碰撞形状组件
构造函数
CollisionShape 双端
csharp
public CollisionShape()属性
ShapeType 双端
csharp
public ShapeType ShapeType { get; set; }碰撞形状类型
Size 双端
csharp
public Vector3 Size { get; set; }形状尺寸
Position 双端
csharp
public Vector3 Position { get; set; }形状本地偏移
Rotation 双端
csharp
public Quaternion Rotation { get; set; }形状本地旋转
LodLevel 双端
csharp
public uint LodLevel { get; set; }LOD级别
Margin 双端
csharp
public float Margin { get; set; }碰撞边距
WorldBoundingBox 双端
csharp
public BoundingBox WorldBoundingBox { get; }碰撞形状的世界包围盒
PhysicsWorld 双端
csharp
public PhysicsWorld? PhysicsWorld { get; }当前碰撞形状所属场景的 3D 物理世界。
Model 双端
csharp
public Mesh? Model { get; set; }碰撞模型
方法
SetTransform 双端
csharp
public void SetTransform(Vector3 position, Quaternion rotation)设置形状变换(位置+旋转)
SetBox 双端
csharp
public void SetBox(Vector3 size, Vector3 position = default(Vector3), Quaternion rotation = default(Quaternion))设置为盒体形状
SetSphere 双端
csharp
public void SetSphere(float diameter, Vector3 position = default(Vector3), Quaternion rotation = default(Quaternion))设置为球体形状
SetCapsule 双端
csharp
public void SetCapsule(float diameter, float height, Vector3 position = default(Vector3), Quaternion rotation = default(Quaternion))设置为胶囊形状
SetCylinder 双端
csharp
public void SetCylinder(float diameter, float height, Vector3 position = default(Vector3), Quaternion rotation = default(Quaternion))设置为圆柱形状
SetCone 双端
csharp
public void SetCone(float diameter, float height, Vector3 position = default(Vector3), Quaternion rotation = default(Quaternion))设置为圆锥形状
SetStaticPlane 双端
csharp
public void SetStaticPlane(Vector3 position = default(Vector3), Quaternion rotation = default(Quaternion))设置为静态平面形状
SetTriangleMesh 双端
csharp
public void SetTriangleMesh(Mesh model, uint lodLevel = 0u, Vector3 scale = default(Vector3), Vector3 position = default(Vector3), Quaternion rotation = default(Quaternion))设置为三角网格形状
SetConvexHull 双端
csharp
public void SetConvexHull(Mesh model, uint lodLevel = 0u, Vector3 scale = default(Vector3), Vector3 position = default(Vector3), Quaternion rotation = default(Quaternion))设置为凸包形状
SetCustomTriangleMesh 仅客户端
csharp
public void SetCustomTriangleMesh(CustomGeometryComponent custom, Vector3 scale = default(Vector3), Vector3 position = default(Vector3), Quaternion rotation = default(Quaternion))设置为由客户端 CustomGeometry 组件提供的三角网格形状。
SetCustomConvexHull 仅客户端
csharp
public void SetCustomConvexHull(CustomGeometryComponent custom, Vector3 scale = default(Vector3), Vector3 position = default(Vector3), Quaternion rotation = default(Quaternion))设置为由客户端 CustomGeometry 组件提供的凸包形状。
SetGImpactMesh 仅客户端
csharp
public void SetGImpactMesh(Mesh model, uint lodLevel = 0u, Vector3 scale = default(Vector3), Vector3 position = default(Vector3), Quaternion rotation = default(Quaternion))设置为由模型生成的 GImpact 三角网格形状。
SetCustomGImpactMesh 仅客户端
csharp
public void SetCustomGImpactMesh(CustomGeometryComponent custom, Vector3 scale = default(Vector3), Vector3 position = default(Vector3), Quaternion rotation = default(Quaternion))设置为由客户端 CustomGeometry 组件提供的 GImpact 三角网格形状。
SetTerrain 双端
csharp
public void SetTerrain(uint lodLevel = 0u)设置为地形形状(需同节点存在 Terrain 组件)
SetHeightfield 双端
csharp
public void SetHeightfield(float[] heights, int sizeX, int sizeY, Vector3 spacing, Vector3 position = default(Vector3), Quaternion rotation = default(Quaternion))直接用一份原始高度网格设置为地形(高度场)形状,无需 Terrain 组件。 heights 为行主序:每行 sizeX 个采样、共 sizeY 行(长度须等于 sizeX*sizeY)。 SCE(Z-up) 坐标系下高度沿 +Z、网格铺在 XY 平面(spacing.X/spacing.Y 为采样间距,spacing.Z 忽略)。 高度为世界单位绝对值;最小/最大高度由原生扫描得出。该形状不随网络复制,客户端应各自本地构建。 用途定位:本方法是 procedural 低层原语,仅适合"高度数据本就在脚本侧"的用例(运行时生成地形等); 数组会跨 wasm 边界传一次。不要用它把已是服务端原生资产的地图烘焙地形高度往返搬过 wasm—— 那种权威地形应走 native-sourced 路径(由 C++/Host 直接从原生高度源构建,数组不过边界,见 Phase 2/4)。
Constraint 双端
命名空间 GameGraph.NodeSystem.Component.Physics
csharp
public sealed class Constraint : EngineNodeComponent, INodeComponent, IDisposable3D物理约束组件
构造函数
Constraint 双端
csharp
public Constraint()属性
ConstraintType 双端
csharp
public ConstraintType ConstraintType { get; set; }约束类型
Position 双端
csharp
public Vector3 Position { get; set; }约束在本体上的位置
Rotation 双端
csharp
public Quaternion Rotation { get; set; }约束在本体上的旋转
OtherPosition 双端
csharp
public Vector3 OtherPosition { get; set; }约束在对方体上的位置
OtherRotation 双端
csharp
public Quaternion OtherRotation { get; set; }约束在对方体上的旋转
WorldPosition 双端
csharp
public Vector3 WorldPosition { get; set; }约束的世界位置
HighLimit 双端
csharp
public Vector2 HighLimit { get; set; }高限制值
LowLimit 双端
csharp
public Vector2 LowLimit { get; set; }低限制值
CFM 双端
csharp
public float CFM { get; set; }约束力混合参数
ERP 双端
csharp
public float ERP { get; set; }误差修正参数
DisableCollision 双端
csharp
public bool DisableCollision { get; set; }是否禁用连接体之间的碰撞
OwnBody 双端
csharp
public RigidBody? OwnBody { get; }拥有此约束的刚体
OtherBody 双端
csharp
public RigidBody? OtherBody { get; set; }约束连接的另一个刚体
PhysicsWorld 双端
csharp
public PhysicsWorld? PhysicsWorld { get; }当前约束所属的 3D 物理世界。
方法
SetAxis 双端
csharp
public void SetAxis(Vector3 axis)设置约束轴
SetOtherAxis 双端
csharp
public void SetOtherAxis(Vector3 axis)设置对方约束轴
ConstraintType 双端
命名空间 GameGraph.NodeSystem.Component.Physics
csharp
public enum ConstraintType枚举值
PointHingeSliderConeTwist
KinematicCharacterMotor 双端
命名空间 GameGraph.NodeSystem.Component.Physics
csharp
public sealed class KinematicCharacterMotor : EngineNodeComponent, INodeComponent, IDisposableNode-level kinematic capsule motor, also known as a kinematic character controller (KCC).
构造函数
KinematicCharacterMotor 双端
csharp
public KinematicCharacterMotor()属性
Radius 双端
csharp
public float Radius { get; set; }Height 双端
csharp
public float Height { get; set; }StepHeight 双端
csharp
public float StepHeight { get; set; }MaxSlopeDegrees 双端
csharp
public float MaxSlopeDegrees { get; set; }Gravity 双端
csharp
public Vector3 Gravity { get; set; }Velocity 双端
csharp
public Vector3 Velocity { get; }DesiredVelocity 双端
csharp
public Vector3 DesiredVelocity { get; }LastStepPosition 双端
csharp
public Vector3 LastStepPosition { get; }UseCharacterCollisionRoles 双端
csharp
public bool UseCharacterCollisionRoles { get; set; }IsGrounded 双端
csharp
public bool IsGrounded { get; }CollisionLayer 双端
csharp
public uint CollisionLayer { get; set; }CollisionMask 双端
csharp
public uint CollisionMask { get; set; }方法
Move 双端
csharp
public void Move(Vector3 desiredVelocity)Stop 双端
csharp
public void Stop()Jump 双端
csharp
public void Jump(float verticalSpeed)Warp 双端
csharp
public void Warp(Vector3 position)SetCollisionLayerAndMask 双端
csharp
public void SetCollisionLayerAndMask(uint layer, uint mask)DrawDebugGeometry 仅客户端
csharp
public void DrawDebugGeometry(bool depthTest = true)PhysicsWorld 双端
命名空间 GameGraph.NodeSystem.Component.Physics
csharp
public sealed class PhysicsWorld : EngineNodeComponent, INodeComponent, IDisposable构造函数
PhysicsWorld 双端
csharp
public PhysicsWorld()属性
Gravity 双端
csharp
public Vector3 Gravity { get; set; }重力
Fps 双端
csharp
public int Fps { get; set; }物理模拟帧率
UpdateEnabled 双端
csharp
public bool UpdateEnabled { get; set; }是否启用物理更新
Interpolation 双端
csharp
public bool Interpolation { get; set; }是否启用插值
MaxSubSteps 双端
csharp
public int MaxSubSteps { get; set; }最大子步数
NumIterations 双端
csharp
public int NumIterations { get; set; }求解器迭代次数
SplitImpulse 双端
csharp
public bool SplitImpulse { get; set; }是否启用分裂冲量
InternalEdge 双端
csharp
public bool InternalEdge { get; set; }是否启用内部边缘处理
MaxNetworkAngularVelocity 双端
csharp
public float MaxNetworkAngularVelocity { get; set; }网络角速度上限
方法
Raycast 双端
csharp
public PhysicsRaycastResult? Raycast(Vector3 position, Vector3 direction, float maxDistance, uint collisionMask = uint.MaxValue)射线检测,返回距离最近的结果
position— 射线原点direction— 射线矢量方向maxDistance— 射线检测最大距离collisionMask— 碰撞遮罩
返回: 返回距离最近的结果
RaycastAll 双端
csharp
public PhysicsRaycastResult[] RaycastAll(Vector3 position, Vector3 direction, float maxDistance, uint collisionMask = uint.MaxValue)射线检测,返回所有满足条件的结果
position— 射线原点direction— 射线矢量方向maxDistance— 射线检测最大距离collisionMask— 碰撞遮罩
返回: 返回所有满足条件的结果,无结果时返回空数组
SphereCast 双端
csharp
public PhysicsRaycastResult? SphereCast(Vector3 origin, float radius, Vector3 direction, float maxDistance, uint collisionMask = uint.MaxValue)球形扫掠检测,返回距离最近的结果
origin— 球中心点radius— 球半径direction— 方向maxDistance— 检测最大距离collisionMask— 碰撞遮罩
返回: 返回距离最近的结果
OverlapSphere 双端
csharp
public RigidBody[] OverlapSphere(Vector3 origin, float radius, uint collisionMask = uint.MaxValue)查询球形范围内的刚体
origin— 球中心点radius— 球半径collisionMask— 碰撞遮罩
返回: 刚体数组,无结果时返回空数组
OverlapBox 双端
csharp
public RigidBody[] OverlapBox(Vector3 aabbMin, Vector3 aabbMax, uint collisionMask = uint.MaxValue)查询Box范围内的刚体
aabbMin— Box最小坐标aabbMax— Box最大坐标collisionMask— 碰撞遮罩
返回: 刚体数组,无结果时返回空数组
OverlapBox 双端
csharp
public RigidBody[] OverlapBox(Vector3 aabbMin, Vector3 aabbMax, Quaternion rotation, uint collisionMask = uint.MaxValue)查询带世界旋转的盒体范围内的刚体。
DrawDebugGeometry 双端
csharp
public void DrawDebugGeometry(bool depthTest)绘制物理调试几何体
Update 双端
csharp
public void Update(float timeStep)手动步进物理模拟
UpdateCollisions 双端
csharp
public void UpdateCollisions()手动更新碰撞检测
RemoveCachedGeometry 仅客户端
csharp
public void RemoveCachedGeometry(Mesh model)清除指定模型的客户端物理几何缓存,使后续碰撞形状重新构建。
RaycastSegmented 双端
csharp
public PhysicsRaycastResult? RaycastSegmented(Vector3 position, Vector3 direction, float maxDistance, float segmentDistance, uint collisionMask = uint.MaxValue, float overlapDistance = 0.1f)分段射线检测
ConvexCast 双端
csharp
public PhysicsRaycastResult? ConvexCast(CollisionShape shape, Vector3 startPos, Quaternion startRot, Vector3 endPos, Quaternion endRot, uint collisionMask = uint.MaxValue)凸体扫掠检测
GetCollidingBodies 双端
csharp
public RigidBody[] GetCollidingBodies(RigidBody body)获取指定刚体的碰撞体列表
返回: 碰撞刚体数组,无结果时返回空数组
QueryContacts 双端
csharp
public RigidBody[] QueryContacts(RigidBody body)立即对指定刚体执行 Bullet contactTest,并返回当前接触的刚体。 与 GetCollidingBodies 使用上一物理步碰撞事件缓存的语义不同。
PrebakedCollisionOptions 仅服务端
命名空间 GameGraph.NodeSystem.Component.Physics
csharp
public sealed class PrebakedCollisionOptions预烘焙模型碰撞实例参数。
构造函数
PrebakedCollisionOptions 仅服务端
csharp
public PrebakedCollisionOptions()属性
Default 仅服务端
csharp
public static PrebakedCollisionOptions Default { get; }LocalScale 仅服务端
csharp
public Vector3 LocalScale { get; set; }额外本地缩放。默认 One;会与目标节点 transform 叠加。
ApplyAssetLayerScale 仅服务端
csharp
public bool ApplyAssetLayerScale { get; set; }是否自动把 AssetLayerScale 应用到碰撞实例。
Mass 仅服务端
csharp
public float Mass { get; set; }刚体质量。StaticTriangleMesh 必须保持 0;动态刚体应使用 ConvexHull 或 CompoundConvex。
CollisionLayer 仅服务端
csharp
public uint CollisionLayer { get; set; }碰撞层。默认 4,与现有场景静态碰撞一致。
CollisionMask 仅服务端
csharp
public uint CollisionMask { get; set; }碰撞遮罩。
IsTrigger 仅服务端
csharp
public bool IsTrigger { get; set; }是否作为 trigger。
Kinematic 仅服务端
csharp
public bool Kinematic { get; set; }是否设置为 kinematic rigid body。
Friction 仅服务端
csharp
public float Friction { get; set; }摩擦系数。
Restitution 仅服务端
csharp
public float Restitution { get; set; }弹性恢复系数。
PrebakedModelCollision 仅服务端
命名空间 GameGraph.NodeSystem.Component.Physics
csharp
public static class PrebakedModelCollision预烘焙模型碰撞运行时入口。
方法
ApplyPrebakedCollision 仅服务端
csharp
public static PrebakedModelCollisionApplyResult ApplyPrebakedCollision(Node node, IGameLink<GameDataModel> model, PrebakedCollisionOptions? options = null)从服务端预烘焙产物创建模型碰撞实例,并返回完整结果。
备注
该 API 只在服务端可用。客户端应直接从模型或 Prefab 资源创建本地表现,不读取 block/model_collision 下的服务端碰撞产物。 ConvexHull 和 CompoundConvex 会把刚体与碰撞形状直接附着到 ,使动态物理 transform 与 replicated 表现共享同一节点;目标节点不能已有 RigidBody 或 CollisionShape。静态三角网格仍在目标节点下创建静态碰撞子节点。
PrebakedModelCollisionApplyResult 仅服务端
命名空间 GameGraph.NodeSystem.Component.Physics
csharp
public enum PrebakedModelCollisionApplyResult服务端预烘焙模型碰撞的创建结果。
枚举值
Success— 碰撞产物已成功加载并实例化。ModelDataUnavailable— 模型链接无法解析到 。BakeConfigurationMissing— 模型未配置 。BakeDisabled— 模型的碰撞烘焙配置已显式关闭。UnsupportedBakeMode— 当前运行时尚不支持配置的烘焙模式。InvalidParentNode— 目标父节点已失效,native 无法在其下创建碰撞节点。CollisionArtifactOpenFailed— 对应的服务端碰撞二进制不存在或无法打开。InvalidCollisionArtifact— 碰撞二进制存在,但格式、版本或内容无效。PhysicsInstanceCreationFailed— 碰撞数据已加载,但创建刚体或碰撞形状失败。UnknownNativeResult— native 返回了当前 SDK 尚未识别的结果值。InvalidBakeConfiguration— 碰撞烘焙配置值非法,例如凸包顶点上限越界。DynamicTriangleMeshNotSupported— 静态三角网格被请求创建为有质量的动态刚体;动态对象应使用凸包或复合凸包。
RaycastVehicle 双端
命名空间 GameGraph.NodeSystem.Component.Physics
csharp
public sealed class RaycastVehicle : EngineNodeComponent, INodeComponent, IDisposable射线投射载具组件
构造函数
RaycastVehicle 双端
csharp
public RaycastVehicle()属性
NumWheels 双端
csharp
public int NumWheels { get; }车轮数量
CoordinateSystem 双端
csharp
public (int Right, int Up, int Forward) CoordinateSystem { get; set; }坐标系(右轴、上轴、前轴索引)
InAirRPM 双端
csharp
public float InAirRPM { get; set; }空中转速
MaxSideSlipSpeed 双端
csharp
public float MaxSideSlipSpeed { get; set; }最大侧滑速度
方法
Init 双端
csharp
public void Init()初始化载具
AddWheel 双端
csharp
public void AddWheel(Node wheelNode, Vector3 wheelDirection, Vector3 wheelAxle, float restLength, float wheelRadius, bool frontWheel)添加车轮
SetEngineForce 双端
csharp
public void SetEngineForce(int wheel, float force)GetEngineForce 双端
csharp
public float GetEngineForce(int wheel)SetBrake 双端
csharp
public void SetBrake(int wheel, float force)GetBrake 双端
csharp
public float GetBrake(int wheel)SetSteeringValue 双端
csharp
public void SetSteeringValue(int wheel, float steeringValue)GetSteeringValue 双端
csharp
public float GetSteeringValue(int wheel)SetWheelSuspensionStiffness 双端
csharp
public void SetWheelSuspensionStiffness(int wheel, float stiffness)GetWheelSuspensionStiffness 双端
csharp
public float GetWheelSuspensionStiffness(int wheel)SetWheelDampingCompression 双端
csharp
public void SetWheelDampingCompression(int wheel, float compression)GetWheelDampingCompression 双端
csharp
public float GetWheelDampingCompression(int wheel)SetWheelDampingRelaxation 双端
csharp
public void SetWheelDampingRelaxation(int wheel, float damping)GetWheelDampingRelaxation 双端
csharp
public float GetWheelDampingRelaxation(int wheel)SetWheelFrictionSlip 双端
csharp
public void SetWheelFrictionSlip(int wheel, float slip)GetWheelFrictionSlip 双端
csharp
public float GetWheelFrictionSlip(int wheel)SetWheelRollInfluence 双端
csharp
public void SetWheelRollInfluence(int wheel, float rollInfluence)GetWheelRollInfluence 双端
csharp
public float GetWheelRollInfluence(int wheel)SetMaxSuspensionTravel 双端
csharp
public void SetMaxSuspensionTravel(int wheel, float maxSuspensionTravel)GetMaxSuspensionTravel 双端
csharp
public float GetMaxSuspensionTravel(int wheel)SetWheelRadius 双端
csharp
public void SetWheelRadius(int wheel, float radius)GetWheelRadius 双端
csharp
public float GetWheelRadius(int wheel)SetWheelRestLength 双端
csharp
public void SetWheelRestLength(int wheel, float length)GetWheelRestLength 双端
csharp
public float GetWheelRestLength(int wheel)SetWheelDirection 双端
csharp
public void SetWheelDirection(int wheel, Vector3 direction)GetWheelDirection 双端
csharp
public Vector3 GetWheelDirection(int wheel)SetWheelAxle 双端
csharp
public void SetWheelAxle(int wheel, Vector3 axle)GetWheelAxle 双端
csharp
public Vector3 GetWheelAxle(int wheel)GetWheelNode 双端
csharp
public Node? GetWheelNode(int wheel)GetWheelPosition 双端
csharp
public Vector3 GetWheelPosition(int wheel)GetWheelRotation 双端
csharp
public Quaternion GetWheelRotation(int wheel)GetWheelConnectionPoint 双端
csharp
public Vector3 GetWheelConnectionPoint(int wheel)GetContactPosition 双端
csharp
public Vector3 GetContactPosition(int wheel)GetContactNormal 双端
csharp
public Vector3 GetContactNormal(int wheel)GetWheelSideSlipSpeed 双端
csharp
public float GetWheelSideSlipSpeed(int wheel)GetWheelSkidInfo 双端
csharp
public float GetWheelSkidInfo(int wheel)SetWheelSkidInfo 双端
csharp
public void SetWheelSkidInfo(int wheel, float factor)GetWheelSkidInfoCumulative 双端
csharp
public float GetWheelSkidInfoCumulative(int wheel)SetWheelSkidInfoCumulative 双端
csharp
public void SetWheelSkidInfoCumulative(int wheel, float skid)IsFrontWheel 双端
csharp
public bool IsFrontWheel(int wheel)WheelIsGrounded 双端
csharp
public bool WheelIsGrounded(int wheel)UpdateWheelTransform 双端
csharp
public void UpdateWheelTransform(int wheel, bool interpolated)ResetSuspension 双端
csharp
public void ResetSuspension()重置悬挂系统
ResetWheels 双端
csharp
public void ResetWheels()重置所有车轮
ApplyAttributes 双端
csharp
public new void ApplyAttributes()应用属性更改
RigidBody 双端
命名空间 GameGraph.NodeSystem.Component.Physics
csharp
public sealed class RigidBody : EngineNodeComponent, INodeComponent, IDisposable构造函数
RigidBody 双端
csharp
public RigidBody()属性
LinearVelocity 双端
csharp
public Vector3 LinearVelocity { get; set; }线性速度
AngularVelocity 双端
csharp
public Vector3 AngularVelocity { get; set; }角速度
Mass 双端
csharp
public float Mass { get; set; }质量
LinearDamping 双端
csharp
public float LinearDamping { get; set; }线性阻尼
AngularDamping 双端
csharp
public float AngularDamping { get; set; }角度阻尼
Friction 双端
csharp
public float Friction { get; set; }摩檫力
RollingFriction 双端
csharp
public float RollingFriction { get; set; }滚动摩檫力
Restitution 双端
csharp
public float Restitution { get; set; }恢复系数
UseGravity 双端
csharp
public bool UseGravity { get; set; }是否使用重力
Kinematic 双端
csharp
public bool Kinematic { set; }动力学模式 在动力学模式下,物体不受任何力的影响
IsTrigger 双端
csharp
public bool IsTrigger { get; set; }触发模式 在触发模式下,物体不受任何力的影响,但是会触发碰撞事件
PhysicsWorld 双端
csharp
public PhysicsWorld? PhysicsWorld { get; }当前刚体所属的 3D 物理世界。
CollisionLayer 双端
csharp
public uint CollisionLayer { get; set; }碰撞层级
CollisionMask 双端
csharp
public uint CollisionMask { get; set; }碰撞遮罩
AngularFactor 双端
csharp
public Vector3 AngularFactor { get; set; }角速度因子(限制各轴的角速度)
LinearFactor 双端
csharp
public Vector3 LinearFactor { get; set; }线性速度因子(限制各轴的线性速度)
AngularRestThreshold 双端
csharp
public float AngularRestThreshold { get; set; }角速度休眠阈值
LinearRestThreshold 双端
csharp
public float LinearRestThreshold { get; set; }线性速度休眠阈值
AnisotropicFriction 双端
csharp
public Vector3 AnisotropicFriction { get; set; }各向异性摩擦力
CcdMotionThreshold 双端
csharp
public float CcdMotionThreshold { get; set; }CCD(连续碰撞检测)运动阈值
CcdRadius 双端
csharp
public float CcdRadius { get; set; }CCD 扫掠球半径
CenterOfMass 双端
csharp
public Vector3 CenterOfMass { get; }质心位置(只读)
CollisionEventMode 双端
csharp
public CollisionEventMode CollisionEventMode { get; set; }碰撞事件模式
ContactProcessingThreshold 双端
csharp
public float ContactProcessingThreshold { get; set; }碰撞处理阈值
GravityOverride 双端
csharp
public Vector3 GravityOverride { get; set; }重力覆盖值(设为 Zero 则使用世界重力)
Position 双端
csharp
public Vector3 Position { get; set; }刚体在物理世界中的位置
Rotation 双端
csharp
public Quaternion Rotation { get; set; }刚体在物理世界中的旋转
IsActive 双端
csharp
public bool IsActive { get; }是否处于活跃状态(只读)
IsKinematic 双端
csharp
public bool IsKinematic { get; }是否为运动学模式(只读 getter)
方法
ApplyForce 双端
csharp
public void ApplyForce(Vector3 force)施加力
force— 力
AddForceAtPosition 双端
csharp
public void AddForceAtPosition(Vector3 force, Vector3 position)在位置position上施加力
force— 力position— 位置
ApplyTorque 双端
csharp
public void ApplyTorque(Vector3 torque)施加扭矩力
torque—
ApplyImpulse 双端
csharp
public void ApplyImpulse(Vector3 impulse)施加动量
impulse— 动量
ApplyImpulseAtPosition 双端
csharp
public void ApplyImpulseAtPosition(Vector3 impulse, Vector3 position)在位置position上施加动量
impulse— 动量position— 位置
ApplyTorqueImpulse 双端
csharp
public void ApplyTorqueImpulse(Vector3 torque)施加扭矩动量
torque—
WakeUp 双端
csharp
public void WakeUp()唤醒物体进入活跃状态
Sleep 双端
csharp
public void Sleep()让物体进入休眠状态
IsSleep 双端
csharp
public bool IsSleep()获取物体是否在休眠状态
返回: 休眠状态
SetCollisionFilter 双端
csharp
public void SetCollisionFilter(CollisionFilter? filter)设置碰撞点过滤器
filter— 过滤函数。传 null 会清除过滤器。
GetVelocityAtPoint 双端
csharp
public Vector3 GetVelocityAtPoint(Vector3 position)获取指定位置处的速度
SetTransform 双端
csharp
public void SetTransform(Vector3 position, Quaternion rotation)设置位置和旋转
SetCollisionLayerAndMask 双端
csharp
public void SetCollisionLayerAndMask(uint layer, uint mask)同时设置碰撞层和遮罩
ResetForces 双端
csharp
public void ResetForces()重置所有力和扭矩
DisableMassUpdate 双端
csharp
public void DisableMassUpdate()禁用质量自动更新
EnableMassUpdate 双端
csharp
public void EnableMassUpdate()启用质量自动更新
ReAddBodyToWorld 双端
csharp
public void ReAddBodyToWorld()重新将刚体加入物理世界
DisposeUnmanaged 双端
csharp
protected override void DisposeUnmanaged(bool finalizing)ShapeType 双端
命名空间 GameGraph.NodeSystem.Component.Physics
csharp
public enum ShapeType枚举值
BoxSphereStaticPlaneCylinderCapsuleConeTriangleMeshConvexHullTerrainGImpactMesh
BodyType2D 双端
命名空间 GameGraph.NodeSystem.Component.Physics.Physics2D
csharp
public enum BodyType2D2D刚体类型枚举
枚举值
Static— 静态刚体,不会移动,用于地面、墙壁等Kinematic— 运动学刚体,可以通过代码控制移动,不受物理力影响Dynamic— 动态刚体,完全受物理引擎控制
CollisionBox2D 双端
命名空间 GameGraph.NodeSystem.Component.Physics.Physics2D
csharp
public sealed class CollisionBox2D : CollisionShape2D, INodeComponent, IDisposable2D盒形碰撞组件
构造函数
CollisionBox2D 双端
csharp
public CollisionBox2D()属性
Size 双端
csharp
public Vector2 Size { get; set; }盒子尺寸
Center 双端
csharp
public Vector2 Center { get; set; }盒子中心位置
Angle 双端
csharp
public float Angle { get; set; }盒子旋转角度(弧度)
方法
SetSize 双端
csharp
public void SetSize(float width, float height)设置盒子尺寸
width— 宽度height— 高度
SetCenter 双端
csharp
public void SetCenter(float x, float y)设置盒子中心位置
x— X坐标y— Y坐标
CollisionChain2D 双端
命名空间 GameGraph.NodeSystem.Component.Physics.Physics2D
csharp
public sealed class CollisionChain2D : CollisionShape2D, INodeComponent, IDisposable2D链形碰撞组件,用于创建连续的边缘序列
构造函数
CollisionChain2D 双端
csharp
public CollisionChain2D()属性
Loop 双端
csharp
public bool Loop { get; set; }是否为闭合链
Vertices 双端
csharp
public VertexArray Vertices { get; }顶点数组,用于获取/设置顶点数量、通过索引访问顶点、批量设置顶点
方法
SetVertices 双端
csharp
public void SetVertices(Vector2[] vertices)设置所有顶点
vertices— 顶点数组
CollisionCircle2D 双端
命名空间 GameGraph.NodeSystem.Component.Physics.Physics2D
csharp
public sealed class CollisionCircle2D : CollisionShape2D, INodeComponent, IDisposable2D圆形碰撞组件
构造函数
CollisionCircle2D 双端
csharp
public CollisionCircle2D()属性
Center 双端
csharp
public Vector2 Center { get; set; }圆心位置
Radius 双端
csharp
public float Radius { get; set; }圆的半径
方法
SetCenter 双端
csharp
public void SetCenter(float x, float y)设置圆心位置
x— X坐标y— Y坐标
CollisionEdge2D 双端
命名空间 GameGraph.NodeSystem.Component.Physics.Physics2D
csharp
public sealed class CollisionEdge2D : CollisionShape2D, INodeComponent, IDisposable2D边缘碰撞组件
构造函数
CollisionEdge2D 双端
csharp
public CollisionEdge2D()属性
Vertex1 双端
csharp
public Vector2 Vertex1 { get; set; }边缘的第一个顶点
Vertex2 双端
csharp
public Vector2 Vertex2 { get; set; }边缘的第二个顶点
方法
SetVertices 双端
csharp
public void SetVertices(Vector2 vertex1, Vector2 vertex2)设置边缘的两个顶点
vertex1— 第一个顶点vertex2— 第二个顶点
CollisionPolygon2D 双端
命名空间 GameGraph.NodeSystem.Component.Physics.Physics2D
csharp
public sealed class CollisionPolygon2D : CollisionShape2D, INodeComponent, IDisposable2D多边形碰撞组件
构造函数
CollisionPolygon2D 双端
csharp
public CollisionPolygon2D()属性
Vertices 双端
csharp
public VertexArray Vertices { get; }顶点数组,用于获取/设置顶点数量、通过索引访问顶点、批量设置顶点
方法
SetVertices 双端
csharp
public void SetVertices(Vector2[] vertices)设置所有顶点
vertices— 顶点数组
CollisionShape2D 双端
命名空间 GameGraph.NodeSystem.Component.Physics.Physics2D
csharp
public abstract class CollisionShape2D : EngineNodeComponent2D碰撞形状基类
构造函数
CollisionShape2D 双端
csharp
protected CollisionShape2D()属性
IsTrigger 双端
csharp
public bool IsTrigger { get; set; }是否为触发器
CategoryBits 双端
csharp
public int CategoryBits { get; set; }碰撞类别位
MaskBits 双端
csharp
public int MaskBits { get; set; }碰撞遮罩位
GroupIndex 双端
csharp
public int GroupIndex { get; set; }碰撞组索引
Density 双端
csharp
public float Density { get; set; }密度
Friction 双端
csharp
public float Friction { get; set; }摩擦系数
Restitution 双端
csharp
public float Restitution { get; set; }恢复系数
Mass 双端
csharp
public float Mass { get; }质量(只读)
Inertia 双端
csharp
public float Inertia { get; }转动惯量(只读)
MassCenter 双端
csharp
public Vector2 MassCenter { get; }质心位置(只读)
Constraint2D 双端
命名空间 GameGraph.NodeSystem.Component.Physics.Physics2D
csharp
public abstract class Constraint2D : EngineNodeComponent2D约束基类
构造函数
Constraint2D 双端
csharp
protected Constraint2D()属性
CollideConnected 双端
csharp
public bool CollideConnected { get; set; }是否允许连接的刚体相互碰撞
OwnerBody 双端
csharp
public RigidBody2D? OwnerBody { get; }获取拥有此约束的刚体
OtherBody 双端
csharp
public RigidBody2D? OtherBody { get; set; }获取或设置约束连接的另一个刚体
ConstraintDistance2D 双端
命名空间 GameGraph.NodeSystem.Component.Physics.Physics2D
csharp
public sealed class ConstraintDistance2D : Constraint2D, INodeComponent, IDisposable2D距离约束,保持两个刚体锚点之间的距离
构造函数
ConstraintDistance2D 双端
csharp
public ConstraintDistance2D()属性
OwnerBodyAnchor 双端
csharp
public Vector2 OwnerBodyAnchor { get; set; }拥有者刚体的锚点
OtherBodyAnchor 双端
csharp
public Vector2 OtherBodyAnchor { get; set; }另一个刚体的锚点
Length 双端
csharp
public float Length { get; set; }约束长度
FrequencyHz 双端
csharp
public float FrequencyHz { get; set; }弹簧频率(Hz)
DampingRatio 双端
csharp
public float DampingRatio { get; set; }阻尼比
ConstraintFriction2D 双端
命名空间 GameGraph.NodeSystem.Component.Physics.Physics2D
csharp
public sealed class ConstraintFriction2D : Constraint2D, INodeComponent, IDisposable2D摩擦约束,用于模拟顶视图摩擦
构造函数
ConstraintFriction2D 双端
csharp
public ConstraintFriction2D()属性
Anchor 双端
csharp
public Vector2 Anchor { get; set; }锚点位置
MaxForce 双端
csharp
public float MaxForce { get; set; }最大摩擦力
MaxTorque 双端
csharp
public float MaxTorque { get; set; }最大摩擦扭矩
ConstraintGear2D 双端
命名空间 GameGraph.NodeSystem.Component.Physics.Physics2D
csharp
public sealed class ConstraintGear2D : Constraint2D, INodeComponent, IDisposable2D齿轮约束,连接两个旋转或移动约束
构造函数
ConstraintGear2D 双端
csharp
public ConstraintGear2D()属性
OwnerConstraint 双端
csharp
public Constraint2D? OwnerConstraint { get; set; }拥有者约束
OtherConstraint 双端
csharp
public Constraint2D? OtherConstraint { get; set; }另一个约束
Ratio 双端
csharp
public float Ratio { get; set; }齿轮比
ConstraintMotor2D 双端
命名空间 GameGraph.NodeSystem.Component.Physics.Physics2D
csharp
public sealed class ConstraintMotor2D : Constraint2D, INodeComponent, IDisposable2D电机约束,控制刚体之间的相对运动
构造函数
ConstraintMotor2D 双端
csharp
public ConstraintMotor2D()属性
LinearOffset 双端
csharp
public Vector2 LinearOffset { get; set; }线性偏移
AngularOffset 双端
csharp
public float AngularOffset { get; set; }角度偏移
MaxForce 双端
csharp
public float MaxForce { get; set; }最大力
MaxTorque 双端
csharp
public float MaxTorque { get; set; }最大扭矩
CorrectionFactor 双端
csharp
public float CorrectionFactor { get; set; }修正系数
ConstraintMouse2D 双端
命名空间 GameGraph.NodeSystem.Component.Physics.Physics2D
csharp
public sealed class ConstraintMouse2D : Constraint2D, INodeComponent, IDisposable2D鼠标约束,用于将刚体拖向目标点
构造函数
ConstraintMouse2D 双端
csharp
public ConstraintMouse2D()属性
Target 双端
csharp
public Vector2 Target { get; set; }目标点位置
MaxForce 双端
csharp
public float MaxForce { get; set; }最大力
FrequencyHz 双端
csharp
public float FrequencyHz { get; set; }弹簧频率(Hz)
DampingRatio 双端
csharp
public float DampingRatio { get; set; }阻尼比
ConstraintPrismatic2D 双端
命名空间 GameGraph.NodeSystem.Component.Physics.Physics2D
csharp
public sealed class ConstraintPrismatic2D : Constraint2D, INodeComponent, IDisposable2D棱柱约束(滑动约束),允许刚体沿轴线滑动
构造函数
ConstraintPrismatic2D 双端
csharp
public ConstraintPrismatic2D()属性
Anchor 双端
csharp
public Vector2 Anchor { get; set; }锚点位置
Axis 双端
csharp
public Vector2 Axis { get; set; }滑动轴方向
EnableLimit 双端
csharp
public bool EnableLimit { get; set; }是否启用移动限制
LowerTranslation 双端
csharp
public float LowerTranslation { get; set; }移动下限
UpperTranslation 双端
csharp
public float UpperTranslation { get; set; }移动上限
EnableMotor 双端
csharp
public bool EnableMotor { get; set; }是否启用电机
MotorSpeed 双端
csharp
public float MotorSpeed { get; set; }电机速度
MaxMotorForce 双端
csharp
public float MaxMotorForce { get; set; }电机最大力
ConstraintPulley2D 双端
命名空间 GameGraph.NodeSystem.Component.Physics.Physics2D
csharp
public sealed class ConstraintPulley2D : Constraint2D, INodeComponent, IDisposable2D滑轮约束,模拟滑轮系统
构造函数
ConstraintPulley2D 双端
csharp
public ConstraintPulley2D()属性
OwnerBodyGroundAnchor 双端
csharp
public Vector2 OwnerBodyGroundAnchor { get; set; }拥有者刚体的地面锚点
OtherBodyGroundAnchor 双端
csharp
public Vector2 OtherBodyGroundAnchor { get; set; }另一个刚体的地面锚点
OwnerBodyAnchor 双端
csharp
public Vector2 OwnerBodyAnchor { get; set; }拥有者刚体的锚点
OtherBodyAnchor 双端
csharp
public Vector2 OtherBodyAnchor { get; set; }另一个刚体的锚点
Ratio 双端
csharp
public float Ratio { get; set; }滑轮比
ConstraintRevolute2D 双端
命名空间 GameGraph.NodeSystem.Component.Physics.Physics2D
csharp
public sealed class ConstraintRevolute2D : Constraint2D, INodeComponent, IDisposable2D旋转约束(铰链约束),允许刚体围绕锚点旋转
构造函数
ConstraintRevolute2D 双端
csharp
public ConstraintRevolute2D()属性
Anchor 双端
csharp
public Vector2 Anchor { get; set; }锚点位置
EnableLimit 双端
csharp
public bool EnableLimit { get; set; }是否启用角度限制
LowerAngle 双端
csharp
public float LowerAngle { get; set; }角度下限(弧度)
UpperAngle 双端
csharp
public float UpperAngle { get; set; }角度上限(弧度)
EnableMotor 双端
csharp
public bool EnableMotor { get; set; }是否启用电机
MotorSpeed 双端
csharp
public float MotorSpeed { get; set; }电机速度
MaxMotorTorque 双端
csharp
public float MaxMotorTorque { get; set; }电机最大扭矩
ConstraintRope2D 双端
命名空间 GameGraph.NodeSystem.Component.Physics.Physics2D
csharp
public sealed class ConstraintRope2D : Constraint2D, INodeComponent, IDisposable2D绳索约束,限制两个锚点之间的最大距离
构造函数
ConstraintRope2D 双端
csharp
public ConstraintRope2D()属性
OwnerBodyAnchor 双端
csharp
public Vector2 OwnerBodyAnchor { get; set; }拥有者刚体的锚点
OtherBodyAnchor 双端
csharp
public Vector2 OtherBodyAnchor { get; set; }另一个刚体的锚点
MaxLength 双端
csharp
public float MaxLength { get; set; }最大长度
ConstraintWeld2D 双端
命名空间 GameGraph.NodeSystem.Component.Physics.Physics2D
csharp
public sealed class ConstraintWeld2D : Constraint2D, INodeComponent, IDisposable2D焊接约束,将两个刚体焊接在一起
构造函数
ConstraintWeld2D 双端
csharp
public ConstraintWeld2D()属性
Anchor 双端
csharp
public Vector2 Anchor { get; set; }锚点位置
FrequencyHz 双端
csharp
public float FrequencyHz { get; set; }弹簧频率(Hz)
DampingRatio 双端
csharp
public float DampingRatio { get; set; }阻尼比
ConstraintWheel2D 双端
命名空间 GameGraph.NodeSystem.Component.Physics.Physics2D
csharp
public sealed class ConstraintWheel2D : Constraint2D, INodeComponent, IDisposable2D车轮约束,模拟车辆悬挂系统
构造函数
ConstraintWheel2D 双端
csharp
public ConstraintWheel2D()属性
Anchor 双端
csharp
public Vector2 Anchor { get; set; }锚点位置
Axis 双端
csharp
public Vector2 Axis { get; set; }悬挂轴方向
EnableMotor 双端
csharp
public bool EnableMotor { get; set; }是否启用电机
MotorSpeed 双端
csharp
public float MotorSpeed { get; set; }电机速度
MaxMotorTorque 双端
csharp
public float MaxMotorTorque { get; set; }电机最大扭矩
FrequencyHz 双端
csharp
public float FrequencyHz { get; set; }弹簧频率(Hz)
DampingRatio 双端
csharp
public float DampingRatio { get; set; }阻尼比
PhysicsRaycastResult2D 双端
命名空间 GameGraph.NodeSystem.Component.Physics.Physics2D
csharp
public struct PhysicsRaycastResult2D2D物理射线检测结果
属性
Position 双端
csharp
public Vector2 Position { get; set; }碰撞点位置
Normal 双端
csharp
public Vector2 Normal { get; set; }碰撞点法线
Distance 双端
csharp
public float Distance { get; set; }射线起点到碰撞点的距离
Body 双端
csharp
public RigidBody2D? Body { get; set; }被碰撞的刚体
PhysicsWorld2D 双端
命名空间 GameGraph.NodeSystem.Component.Physics.Physics2D
csharp
public sealed class PhysicsWorld2D : EngineNodeComponent, INodeComponent, IDisposable2D物理世界组件,管理2D物理模拟
构造函数
PhysicsWorld2D 双端
csharp
public PhysicsWorld2D()属性
Gravity 双端
csharp
public Vector2 Gravity { get; set; }重力向量
AllowSleeping 双端
csharp
public bool AllowSleeping { get; set; }是否允许休眠
WarmStarting 双端
csharp
public bool WarmStarting { get; set; }是否启用热启动
ContinuousPhysics 双端
csharp
public bool ContinuousPhysics { get; set; }是否启用连续物理
SubStepping 双端
csharp
public bool SubStepping { get; set; }是否启用子步进
AutoClearForces 双端
csharp
public bool AutoClearForces { get; set; }是否自动清除力
VelocityIterations 双端
csharp
public int VelocityIterations { get; set; }速度迭代次数
PositionIterations 双端
csharp
public int PositionIterations { get; set; }位置迭代次数
UpdateEnabled 双端
csharp
public bool UpdateEnabled { get; set; }是否启用物理更新
DrawShape 双端
csharp
public bool DrawShape { get; set; }是否绘制形状
DrawJoint 双端
csharp
public bool DrawJoint { get; set; }是否绘制关节
DrawAabb 双端
csharp
public bool DrawAabb { get; set; }是否绘制AABB
DrawPair 双端
csharp
public bool DrawPair { get; set; }是否绘制碰撞对
DrawCenterOfMass 双端
csharp
public bool DrawCenterOfMass { get; set; }是否绘制质心
方法
DrawDebugGeometry 双端
csharp
public void DrawDebugGeometry()绘制调试几何体
Update 双端
csharp
public void Update(float timeStep)手动推进 2D 物理世界。
RaycastAll 双端
csharp
public PhysicsRaycastResult2D[] RaycastAll(Vector2 startPoint, Vector2 endPoint, uint collisionMask = uint.MaxValue)射线检测,返回所有满足条件的结果
startPoint— 射线起点endPoint— 射线终点collisionMask— 碰撞遮罩
返回: 返回所有满足条件的结果,无结果时返回空数组
RaycastSingle 双端
csharp
public PhysicsRaycastResult2D? RaycastSingle(Vector2 startPoint, Vector2 endPoint, uint collisionMask = uint.MaxValue)射线检测,返回距离最近的结果
startPoint— 射线起点endPoint— 射线终点collisionMask— 碰撞遮罩
返回: 返回距离最近的结果,无结果时返回null
GetRigidBody 双端
csharp
public RigidBody2D? GetRigidBody(Vector2 point, uint collisionMask = uint.MaxValue)获取指定点处的刚体
point— 查询点collisionMask— 碰撞遮罩
返回: 刚体,无结果时返回null
GetRigidBody 双端
csharp
public RigidBody2D? GetRigidBody(int screenX, int screenY, uint collisionMask = uint.MaxValue)获取指定屏幕坐标处的刚体
screenX— 屏幕X坐标screenY— 屏幕Y坐标collisionMask— 碰撞遮罩
返回: 刚体,无结果时返回null
QueryAABB 双端
csharp
public RigidBody2D[] QueryAABB(RectangleF aabb, uint collisionMask = uint.MaxValue)查询指定AABB范围内的所有刚体
aabb— 查询范围(轴对齐包围盒)collisionMask— 碰撞遮罩
返回: 刚体数组,无结果时返回空数组
RigidBody2D 双端
命名空间 GameGraph.NodeSystem.Component.Physics.Physics2D
csharp
public sealed class RigidBody2D : EngineNodeComponent, INodeComponent, IDisposable2D刚体组件
构造函数
RigidBody2D 双端
csharp
public RigidBody2D()属性
BodyType 双端
csharp
public BodyType2D BodyType { get; set; }刚体类型
Mass 双端
csharp
public float Mass { get; set; }质量
Inertia 双端
csharp
public float Inertia { get; set; }转动惯量
MassCenter 双端
csharp
public Vector2 MassCenter { get; set; }质心位置
UseFixtureMass 双端
csharp
public bool UseFixtureMass { get; set; }是否使用夹具质量
LinearDamping 双端
csharp
public float LinearDamping { get; set; }线性阻尼
AngularDamping 双端
csharp
public float AngularDamping { get; set; }角度阻尼
AllowSleep 双端
csharp
public bool AllowSleep { get; set; }是否允许休眠
FixedRotation 双端
csharp
public bool FixedRotation { get; set; }是否固定旋转
Bullet 双端
csharp
public bool Bullet { get; set; }是否为子弹模式(启用CCD)
GravityScale 双端
csharp
public float GravityScale { get; set; }重力缩放系数
Awake 双端
csharp
public bool Awake { get; set; }是否处于唤醒状态
LinearVelocity 双端
csharp
public Vector2 LinearVelocity { get; set; }线性速度
AngularVelocity 双端
csharp
public float AngularVelocity { get; set; }角速度
方法
ApplyForce 双端
csharp
public void ApplyForce(Vector2 force, Vector2 point, bool wake = true)施加力
force— 力point— 作用点wake— 是否唤醒刚体
ApplyForceToCenter 双端
csharp
public void ApplyForceToCenter(Vector2 force, bool wake = true)在质心施加力
force— 力wake— 是否唤醒刚体
ApplyTorque 双端
csharp
public void ApplyTorque(float torque, bool wake = true)施加扭矩
torque— 扭矩wake— 是否唤醒刚体
ApplyLinearImpulse 双端
csharp
public void ApplyLinearImpulse(Vector2 impulse, Vector2 point, bool wake = true)施加线性冲量
impulse— 冲量point— 作用点wake— 是否唤醒刚体
ApplyLinearImpulseToCenter 双端
csharp
public void ApplyLinearImpulseToCenter(Vector2 impulse, bool wake = true)在质心施加线性冲量
impulse— 冲量wake— 是否唤醒刚体
ApplyAngularImpulse 双端
csharp
public void ApplyAngularImpulse(float impulse, bool wake = true)施加角冲量
impulse— 角冲量wake— 是否唤醒刚体
ScriptComponent 双端
命名空间 GameGraph.NodeSystem.Component.Scripts
csharp
public class ScriptComponent : EngineNodeComponent, INodeComponent, IDisposable构造函数
ScriptComponent 双端
csharp
public ScriptComponent()方法
Setup 双端
csharp
public override void Setup()OnStart 双端
csharp
protected virtual void OnStart()组件插入 Node 后调用。只有派生类 override 时才会注册 native 回调。
OnDelayedStart 双端
csharp
protected virtual void OnDelayedStart()组件插入场景后第一帧 Update 时调用。只有派生类 override 时才会注册 native 回调。
OnStop 双端
csharp
protected virtual void OnStop()组件从 Node 删除后调用。只有派生类 override 时才会注册 native 回调。
OnUpdate 双端
csharp
protected virtual void OnUpdate(float timeStep)帧 Update。只有派生类 override 时才会注册 native 回调。
timeStep— 帧耗时。
OnPostUpdate 双端
csharp
protected virtual void OnPostUpdate(float timeStep)帧 PostUpdate。只有派生类 override 时才会注册 native 回调。
timeStep— 帧耗时。
OnFixedUpdate 双端
csharp
protected virtual void OnFixedUpdate(float timeStep)物理帧 Update。只有派生类 override 时才会注册 native 回调。
timeStep— 帧耗时。
OnFixedPostUpdate 双端
csharp
protected virtual void OnFixedPostUpdate(float timeStep)物理帧 PostUpdate。只有派生类 override 时才会注册 native 回调。
timeStep— 帧耗时。
DisposeUnmanaged 双端
csharp
protected override void DisposeUnmanaged(bool finalizing)SceneNavigation 双端
命名空间 GameGraph.NodeSystem.Navigation
csharp
public sealed class SceneNavigationQuery API for the authoritative SCE scene navigation backend.
备注
This API is available only on the server for SceneGraph instances that are bound to an SCE scene with loaded Nav3D data. Client-side graphs, isolated script-created graphs, and scenes without Nav3D report unsupported navigation. The API is intentionally query-only; agent movement, off-mesh links, falling behavior, and Urho Navigation replacement are outside this API.
属性
SceneGraph 双端
csharp
public SceneGraph SceneGraph { get; }The SceneGraph queried by this navigation API.
IsSupported 双端
csharp
public bool IsSupported { get; }Whether the current SceneGraph can resolve to an SCE scene with Nav3D data.
方法
FindPath 双端
csharp
public SceneNavigationPathResult FindPath(Vector3 start, Vector3 target, int walkType = 0)Finds a path between two world-space positions on the scene navigation mesh.
start— World-space start position.target— World-space target position.walkType— Walk type passed to the native backend. Phase 1 supports the default value 0.
返回: A path result with points ordered from start to target when successful.
FindNearestWalkablePoint 双端
csharp
public SceneNavigationQueryStatus FindNearestWalkablePoint(Vector3 center, float radius, out Vector3 point, float collisionRadius = 0f, bool ignoreUnit = true)Finds the nearest walkable point around a world-space center position.
center— World-space search center.radius— Search radius. Negative values are invalid.point— Receives the nearest walkable point when the query succeeds.collisionRadius— Optional collision radius used by the native placement query. Negative values are invalid.ignoreUnit— Whether dynamic unit occupancy should be ignored by the placement query.
返回: The navigation query status.
TryFindNearestWalkablePoint 双端
csharp
public bool TryFindNearestWalkablePoint(Vector3 center, float radius, out Vector3 point, float collisionRadius = 0f, bool ignoreUnit = true)Tries to find the nearest walkable point around a world-space center position.
center— World-space search center.radius— Search radius. Negative values are invalid.point— Receives the nearest walkable point when the query succeeds.collisionRadius— Optional collision radius used by the native placement query. Negative values are invalid.ignoreUnit— Whether dynamic unit occupancy should be ignored by the placement query.
返回: True when a point was found.
FindNearestPoly 双端
csharp
public SceneNavigationQueryStatus FindNearestPoly(Vector3 position, Vector3 halfExtents, out Vector3 point)Finds the nearest navigation polygon around a world-space position.
position— World-space query position.halfExtents— Half extents of the native nearest-poly search box. Negative components are invalid.point— Receives the nearest point on the navigation polygon when the query succeeds.
返回: The navigation query status.
TryFindNearestPoly 双端
csharp
public bool TryFindNearestPoly(Vector3 position, Vector3 halfExtents, out Vector3 point)Tries to find the nearest navigation polygon around a world-space position.
position— World-space query position.halfExtents— Half extents of the native nearest-poly search box. Negative components are invalid.point— Receives the nearest point on the navigation polygon when the query succeeds.
返回: True when a nearest polygon was found.
GetGridHeight 双端
csharp
public SceneNavigationQueryStatus GetGridHeight(Vector3 position, out float height, SceneNavigationHeightPolicy policy = SceneNavigationHeightPolicy.Nearest)Queries the navigation grid height at a world-space position.
position— World-space query position.height— Receives the matching navigation grid height when the query succeeds.policy— Selection policy used when multiple heights match.
返回: The navigation query status.
TryGetGridHeight 双端
csharp
public bool TryGetGridHeight(Vector3 position, out float height, SceneNavigationHeightPolicy policy = SceneNavigationHeightPolicy.Nearest)Tries to query the navigation grid height at a world-space position.
position— World-space query position.height— Receives the matching navigation grid height when the query succeeds.policy— Selection policy used when multiple heights match.
返回: True when a height was found.
Raycast 双端
csharp
public SceneNavigationQueryStatus Raycast(Vector3 start, Vector3 target, out SceneNavigationRaycastHit hit)Casts a segment across the navigation mesh and reports whether it is blocked.
start— World-space segment start.target— World-space segment target.hit— Receives the navigation raycast hit data when the query succeeds.
返回: The navigation query status.
TryRaycast 双端
csharp
public bool TryRaycast(Vector3 start, Vector3 target, out SceneNavigationRaycastHit hit)Tries to cast a segment across the navigation mesh and reports whether it is blocked.
start— World-space segment start.target— World-space segment target.hit— Receives the navigation raycast hit data when the query succeeds.
返回: True when the raycast query completed successfully.
SceneNavigationHeightPolicy 双端
命名空间 GameGraph.NodeSystem.Navigation
csharp
public enum SceneNavigationHeightPolicyPolicy used when more than one navigation grid height may match the requested position.
枚举值
Nearest— Return the height nearest to the requested position.Lowest— Return the lowest matching height.Highest— Return the highest matching height.
SceneNavigationPathResult 双端
命名空间 GameGraph.NodeSystem.Navigation
csharp
public readonly struct SceneNavigationPathResultResult returned by a scene navigation path query.
构造函数
SceneNavigationPathResult 双端
csharp
public SceneNavigationPathResult(SceneNavigationQueryStatus status, Vector3[] points)Creates a path query result.
status— The path query status.points— Path points ordered from start to target when the query succeeds.
属性
Status 双端
csharp
public SceneNavigationQueryStatus Status { get; }The path query status.
Points 双端
csharp
public Vector3[] Points { get; }Path points ordered from start to target. Empty when no path was found or navigation is unsupported.
Found 双端
csharp
public bool Found { get; }Whether the query succeeded and returned at least one path point.
SceneNavigationQueryStatus 双端
命名空间 GameGraph.NodeSystem.Navigation
csharp
public enum SceneNavigationQueryStatusScene navigation query result status.
枚举值
Success = 0— The query completed successfully.Unsupported = -1— The current SceneGraph is not backed by an SCE scene with Nav3D data.InvalidQuery = -2— The query parameters are invalid, for example a negative radius or unsupported policy value.NotFound = -3— The query is valid, but no matching navigation result was found.NativeError = -4— The native navigation backend returned an unknown or unexpected result.
SceneNavigationRaycastHit 双端
命名空间 GameGraph.NodeSystem.Navigation
csharp
public readonly struct SceneNavigationRaycastHitResult returned by a scene navigation raycast query.
构造函数
SceneNavigationRaycastHit 双端
csharp
public SceneNavigationRaycastHit(bool blocked, float hitFraction)Creates a raycast query result.
blocked— Whether a navigation polygon blocked the segment.hitFraction— Hit fraction along the requested segment.
属性
Blocked 双端
csharp
public bool Blocked { get; }Whether the requested segment is blocked by navigation geometry.
HitFraction 双端
csharp
public float HitFraction { get; }Detour raycast hit fraction along the requested segment. MaxValue means no blocking polygon was hit.