Members
terrainObstacles :Uint8Array
场景地形障碍数据(地面:0, 水面:1, 墙块: 2)
Type:
-
Uint8Array
Methods
callEvent(type) → {EventHandler|undefined}
调用场景事件
Parameters:
| Name | Type | Description |
|---|---|---|
type |
string
|
场景事件类型 |
Returns:
- Type:
-
EventHandler|undefined
emit(type)
调用场景事件和脚本
Parameters:
| Name | Type | Description |
|---|---|---|
type |
string
|
场景事件类型 |
getActor($) → {Actor|undefined}
获取场景指定区域中的角色
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
$ |
Object
|
||
$.x |
number
|
选择区域中心X |
|
$.y |
number
|
选择区域中心Y |
|
$.area |
string
|
<optional> |
选择区域 |
$.size |
number
|
<optional> |
正方形区域边长 |
$.radius |
number
|
<optional> |
圆形区域半径 |
$.selector |
string
|
<optional> |
选择器 |
$.teamId |
string
|
<optional> |
选择器队伍ID |
$.condition |
string
|
<optional> |
条件 |
$.attribute |
string
|
<optional> |
属性键 |
$.divisor |
string
|
<optional> |
除数属性键 |
$.activation |
string
|
<optional> |
激活状态条件 |
$.exclusionActor |
Actor
|
null
|
<optional> |
排除角色 |
$.exclusionTeamId |
string
|
<optional> |
排除队伍ID |
getMultipleActors($) → {Actor|undefined}
获取场景指定区域中的多个角色
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
$ |
Object
|
||
$.x |
number
|
选择区域中心X |
|
$.y |
number
|
选择区域中心Y |
|
$.area |
string
|
<optional> |
选择区域 |
$.width |
number
|
<optional> |
矩形区域宽度 |
$.height |
number
|
<optional> |
矩形区域高度 |
$.radius |
number
|
<optional> |
圆形区域半径 |
$.selector |
string
|
<optional> |
选择器 |
$.teamId |
string
|
<optional> |
选择器队伍ID |
$.activation |
string
|
<optional> |
激活状态条件 |
getWallPosByRay(sx, sy, dx, dy) → {Object|null}
获取两点之间射线的第一个墙块位置
Parameters:
| Name | Type | Description |
|---|---|---|
sx |
number
|
起点场景X |
sy |
number
|
起点场景Y |
dx |
number
|
终点场景X |
dy |
number
|
终点场景Y |
Returns:
- Type:
-
Object|null
isInLineOfSight(sx, sy, dx, dy) → {boolean}
判断起点和终点是否在视线内可见
Parameters:
| Name | Type | Description |
|---|---|---|
sx |
number
|
起点场景X |
sy |
number
|
起点场景Y |
dx |
number
|
终点场景X |
dy |
number
|
终点场景Y |
Returns:
- Type:
-
boolean
isInWallBlock(x, y) → {boolean}
判断目标点是否在墙块中
Parameters:
| Name | Type | Description |
|---|---|---|
x |
number
|
场景坐标X |
y |
number
|
场景坐标Y |
Returns:
- Type:
-
boolean
loadObjects(objectList, scenePath) → {Array}
加载初始场景对象
Parameters:
| Name | Type | Description |
|---|---|---|
objectList |
Array
|
场景对象数据列表 |
scenePath |
string
|
场景路径 |
(async) loadSubscene(sceneId, offsetXopt, offsetYopt)
加载子场景
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
sceneId |
string
|
场景ID |
||
offsetX |
number
|
<optional> |
0 |
对象偏移X |
offsetY |
number
|
<optional> |
0 |
对象偏移Y |
setAmbientLight(red, green, blue, easingIdopt, durationopt)
设置场景环境光
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
red |
number
|
红[0-255] |
|
green |
number
|
绿[0-255] |
|
blue |
number
|
蓝[0-255] |
|
easingId |
number
|
<optional> |
过渡曲线ID |
duration |
number
|
<optional> |
持续时间(毫秒) |
unloadSubscene(sceneId)
卸载子场景
Parameters:
| Name | Type | Description |
|---|---|---|
sceneId |
string
|
场景ID |
update(deltaTime)
更新场景模块
Parameters:
| Name | Type | Description |
|---|---|---|
deltaTime |
number
|
时间增量(毫秒) |