Skip to content

WorldService ​

成员函数 ​

void  PrintLog (string szLog)
打印日志
获取当前所在chunk的首尾 xz 的坐标
获取UI布局的缩放尺寸
table  RaycastClosest (SandboxVector3 origin, SandboxVector3 unitDir, float distance, bool isIgnoreTrigger, table filterGroup)
射线段检测,返回最近的碰撞物
table  RaycastAll (SandboxVector3 origin, SandboxVector3 unitDir, float distance, bool isIgnoreTrigger, table filterGroup)
射线段检测,返回所有碰撞物,最多128个
table  SweepBoxAll (SandboxVector3 center, SandboxVector3 shape, SandboxVector3 direction, SandboxVector3 angle, float distance, bool isIgnoreTrigger, table filterGroup)
扫描全部
table  SweepCapsuleAll (float radius, SandboxVector3 p0, SandboxVector3 p1, SandboxVector3 dir, float distance, bool isIgnoreTrigger, table filterGroup)
扫描胶囊全部
table  SweepSphereAll (float radius, SandboxVector3 center, SandboxVector3 direction, float distance, bool isIgnoreTrigger, table filterGroup)
扫描球全部
table  OverlapBox (SandboxVector3 shape, SandboxVector3 pos, SandboxVector3 angle, bool isIgnoreTrigger, table filterGroup)
重叠框
table  OverlapCapsule (float radius, SandboxVector3 p0, SandboxVector3 p1, bool isIgnoreTrigger, table filterGroup)
重叠胶囊
table  OverlapSphere (float radius, SandboxVector3 pos, bool isIgnoreTrigger, table filterGroup)
重叠球体
table  RayCastClosest2D (Vector2 point1, Vector2 point2, bool isIgnoreTrigger, table filterGroup)
2D射线检测,返回最近的碰撞物
table  RayCastAll2D (Vector2 point1, Vector2 point2, bool isIgnoreTrigger, table filterGroup)
2D射线检测,返回所有碰撞物
table  OverlapBox2D (Vector2 lowerBound, Vector2 upperBound, bool isIgnoreTrigger, table filterGroup)
2D矩形区域查询,返回与矩形重叠的所有碰撞物
table  OverlapCircle2D (Vector2 center, float radius, bool isIgnoreTrigger, table filterGroup)
2D圆形区域查询,返回与圆形重叠的所有碰撞物
2D非物理点查询,在指定世界坐标处查找渲染层级最高的可见2D节点(基于场景空间索引,非物理碰撞体)
table  FindNodesInBox2D (Vector2 lowerBound, Vector2 upperBound)
2D非物理矩形查询,在指定矩形区域内查找所有可见2D节点,按渲染层级从高到低排序(基于场景空间索引,非物理碰撞体)
2D非物理圆形查询,在指定圆形区域内查找所有可见2D节点,按渲染层级从高到低排序(基于场景空间索引,非物理碰撞体)
用于隐藏显示游戏内置UI
获取UI布局的尺寸
用于主动触发minigame 老的 esc 流程
传送玩家到地图
SandboxNode  CreatePath (table Radius,Heigh,StepOffset,SlopLimit,CollideGroupID)
创建一个路径基于想要模拟的actor的参数.
设置当前worldservice的world的SceneId
获取当前worldservice的world的SceneId