mw
mw Namespace
数据存储
MemoryStorage
Table of contents
Enumerations
Classes
Interfaces
| CameraShakeInfo |
|---|
| 抖动数据 |
| CollisionQueryParams |
| 空间查询碰撞参数 |
| DataStorageResult |
| 数据储存返回值 |
| GameObjectInfo |
| 构建物体的信息 |
| ProjectileMovementConfig |
| 投掷物配置类型 |
| QueueReadDataResult |
| 数据存储 |
| RenderQueryParams |
| 空间查询渲染参数 |
| RequestInit |
| HTTP请求信息的对象 |
| Response |
| HTTP响应信息的对象 |
| RoomInfo |
| 玩家所在的房间信息 |
| SortedMapGetDataResult |
| 数据存储 |
| SortedMapGetRangeDataResult |
| 数据存储 |
| SortedMapGetRankResult |
| 数据存储 |
| TeleportOptions |
| 传送时可额外提供的信息 |
| TeleportResult |
| 传送请求的结果 |
| TypeName |
类定义,使用这个可以省去类参数繁琐的类型声明 如:fun<T>(c:{new():T}) 可以写成 fun<T>(c:Class<T>) |
Type Aliases
BalanceInfo: Object |
|---|
| 账户余额信息 |
BoolCallback: (value: boolean) => void |
| 返回Bool的回调 |
BoolResponse: (success: boolean) => void |
| 返回bool的回调 |
BroadcastMessageResult: Object |
| 发送消息的结果 |
ChatEvent: (jsonData: string) => void |
| 收到MGS事件调用 |
CommodityInfo: Object |
| 使用placeOrder接口下单时用于描述商品信息的类型 |
CommodityListObj: Object |
| 通过接口查询符合要求的商品列表时,会返回的对象类型。 |
CustomPropertyType: number boolean string Vector2 Vector Vector4 Rotation LinearColor |
| 自定义属性类型 |
DelegateFuncType: (...arg: unknown[]) => unknown other |
| 代理回调函数签名 |
DownloadDataResponse: () => void |
| 下载角色形象的回调,无参数 |
EmptyCallback: () => void |
| 空的回调函数类型 |
HttpResponse: (result: boolean, content: string, responseCode: number) => void |
| Http请求的回调消息格式 |
LoadAppearanceDataAllCompletedCallback: () => void |
| 角色编辑器数据加载完成后的回调 |
LocalUGCGameInfo: Object |
| 本地工程信息。如果该工程发布过UGC消费态的游戏,那gameId不为空。 |
MGSEvent: (jsonData: string) => void |
| 收到MGS事件调用 |
MGSResponse: (isSuccess: boolean, jsonData: string) => void |
| GameService的回调 |
OnArkBalanceUpdated: (amount: number) => void |
| 客户端接收余额更新的消息格式 |
OnDescriptionChange: (operationCode: number, index: number, value: unknown) => void |
| 外观加载细节变化委托 |
OnDescriptionComplete: (character: Character) => void |
| 外观加载完成委托 |
OnKeyConsume: (player: Player, orderId: string, boxId: string, amount: number, confirmOrder: (bReceived: boolean) => void) => void |
| 大会员钥匙扣除服务端接收发货通知的消息格式 |
OnLoadDescriptionFailed: (Character: Character) => void |
| 外观主体(前发,后发,头,上衣,下衣,手套,鞋)加载失败委托 |
OnMovementModeChange: (mode: MovementMode) => void |
| 移动状态切换委托 |
OnOrderDelivered: (playerId: number, orderId: string, commodityId: string, amount: number, confirmOrder: (bReceived: boolean, message?: string) => void) => void |
| 服务端接收发货通知的消息格式 |
OnViewLayoutSwitched: (newState: number) => void |
| 窗口显示模式切换的消息格式 |
OnViewRefreshed: () => void |
| 窗口刷新的消息格式 |
PublishedUGCGameInfo: Object |
| 发布成功的UGC消费态游戏信息 |
RechargeInfo: Object |
| 充值信息 |
RedeemResponse: Object |
| status : 兑换状态。 |
SetAppearanceDataCallback: (APIName: string) => void |
| 设置编辑数据完成的回调 |
ShipOrderResponse: Object |
| 发货回调 |
StringCallback: (str: string) => void |
| 返回String的回调 |
StringResponse: (dataString: string) => void |
| 返回string的回调 |
TabGroupOnClickedProps: Object |
| 选项卡组-点击事件type |
TeamMatchFailureInfo: Object |
| 组队跳游戏请求失败回调 |
TeleportData: string string[] Record<string, any> Record<string, any>[] |
| 传送时可携带的数据类型 |
TransactionType: (isSuccess: boolean, content: string) => void |
| 商城通信回调消息格式 |
TweenEasingFunction: (amount: number) => number |
| 缓动函数的类型定义 |
TweenInterpolationFunction: (v: number[], k: number) => number |
| 插值函数的类型定义 |
TweenUnknownProps: Record<string, any> |
| 补间属性的定义,用户可以自由扩展 |
UGCTemplateInfo: Object |
| UGC模板信息 |
UploadDataResponse: (success: boolean) => void |
| 下载角色形象的回调消息格式 |
VehicleGearDataNew: Object |
| 四轮载具挡位属性 |
VehicleWheelDataNew: Object |
| 四轮载具车轮属性 |
VoidResponse: () => void |
| 返回无参数的回调 |
downloadCharacterDataStringCallback: (dataString: string) => void |
| 下载平台数据回调 |
keyUsageInfo: Object |
| 大会员消费钥匙订单。orderId:订单ID,boxId:宝箱ID,number:购买宝箱数量,shipTime:发货时间,毫秒级时间戳 |
maskWordCheckResult: Object |
| 屏蔽字检测的结果 |
onAppearanceDataChanged: (GUID: string) => void |
| 角色身上GUID切换成功回调 |
Variables
Client: FunctionOption |
|---|
| 客户端 |
Multicast: FunctionOption |
| 多播 |
Result: FunctionOption |
| 与Client Server配合实现RPC函数返回值 |
Server: FunctionOption |
| 服务端 |
UILayerBottom: 1 |
| 底层 zOrder开始于100000 |
UILayerDialog: 5 |
| 对话 zOrder开始于500000 |
UILayerError: 7 |
| 错误 这个层级不可以使用,需要增加层级可以使用addUILayerMap zOrder开始于700000 |
UILayerMiddle: 2 |
| 中层 zOrder开始于200000 |
UILayerOwn: 3 |
| 独享层(调用此层会自动隐藏Bottom和Middle层) zOrder开始于300000 |
UILayerScene: 0 |
| 场景 zOrder开始于0 |
UILayerSystem: 6 |
| 系统 zOrder开始于600000 |
UILayerTop: 4 |
| 顶层 zOrder开始于400000 |
Unreliable: FunctionOption |
| 不可靠rpc |
Functions
Component<T: extends typeof Script>(component: T): T: extends typeof Script |
|---|
| 将类声明为mwclass |
Property(option?): (target: object, key: string) => void |
| 属性支持同步 |
RemoteFunction(...options): (target: unknown, propertyKey: string, descriptor: PropertyDescriptor) => void |
| 函数支持Rpc调用 |
Serializable<T: extends ConstructorType>(type: T): T: extends ConstructorType |
| 类型支持属性同步 |
absoluteToLocal(geometry: Geometry, absolutePosition: Vector2): Vector2 client |
| 转化绝对坐标到相对坐标 |
absoluteToViewport(absoluteDesktopPosition: Vector2, outPixelPosition: Vector2, outViewportPosition: Vector2): void client |
| 将桌面空间中几何图形的绝对坐标转换为本地视口坐标 |
asyncCreateUI<T: extends UIScript<T>>(UIPrefabName: string, panelClass: () => T): Promise<T: extends UIScript<T>> client |
| 异步创建UI |
asyncCreateUIByName(UIPath: string): Promise<UserWidget> client |
| 异步创建UI,失败返回空 |
cancelDragDrop(): void client |
| 中断所有的DragDrop |
createUI<T: extends UIScript<T>>(UIPrefabName: string, panelClass: () => T): T: extends UIScript<T> client |
| 创建UIPrefab |
createUIByName(UIPrefabName: string): UserWidget client |
| 创建 UIPrefab |
createUIByPath(UIPath: string): UserWidget client |
| 创建 UIPrefab |
createUIOnlyClass<T: extends UIScript<T>>(panelClass: () => T): T: extends UIScript<T> client |
| 创建空的 UI |
endDragDrop(InReply: EventReply): void client |
| 中断一个拖拽事件, 传入一个操作的事件 |
fetch(url: string, init?: RequestInit): Promise<Response> |
| HTTP请求 |
findUIScript(UI: Widget): UIScript client |
| 获取 UI 脚本 |
generalHttpRequest(response: HttpResponse, requestUrl: HttpRequestURL, param: string, jsonContent: any, requestType: HttpRequestType): boolean |
| 通用 Http 请求 |
getAbsoluteSize(geometry: Geometry): Vector2 client |
| 返回绝对空间中几何图形的大小 |
getAssetIconDataByAssetID(asset: string, size?: AssetIconSize): AssetIconData client |
| 获取资源的 ICON 信息 |
getCurrentMousePosition(): Vector2 client |
| 获取当前鼠标所在的绝对位置 |
getDragDroppingContent(): DragDropOperation client |
| 获取当前的DragDrop事件 |
getForcedMovementHits(character: Character): HitResult[] |
| 获取强制更新移动时检测到的碰撞结果 |
getLastMousePosition(): Vector2 client |
| 获取上一次鼠标所在的绝对位置 |
getLocalSize(geometry: Geometry): Vector2 client |
| 返回局部空间中几何图形的大小 |
getLocalTopLeft(geometry: Geometry): Vector2 client |
| 返回局部空间中几何图形的局部顶部/左侧 |
getMousePositionOnPlatform(): Vector2 client |
| 获取平台的鼠标光标位置。这是鼠标的绝对桌面位置。 |
getMousePositionOnViewport(): Vector2 client |
| 获取平台的鼠标光标在视口控件的本地空间中的位置。 |
getPlayerScreenWidgetGeometry(player: Player): Geometry client |
| 获取包含添加到“player screen”的所有控件的控件的几何形状。你可以使用这个几何图形在绝对和本地空间的控件之间转换控件。 |
getResolutionChanged(Delegate: MulticastDelegate<(x: number, y: number) => void>): void client |
| 分辨率改变时的回调 |
getUrlParameter(url: string, parameterName: string): string |
| 获取 url 参数 |
getViewportScale(): number client |
| 获取应用于视口和所有小部件的当前DPI Scale。 |
getViewportSize(): Vector2 client |
| 获取游戏视口的大小。 |
getViewportWidgetGeometry(): Geometry client |
| 获取包含添加到“视口”中的所有控件的控件的几何形状。你可以使用这个几何图形在绝对和本地空间的控件之间转换控件。 |
httpRequestTransmitData(response: HttpResponse, paramUrl: string, jsonContent: string, requestType: HttpRequestType): boolean |
| Http请求接口 |
isDragDropping(): boolean client |
| 判断当前是否有一个DragDrop事件 |
isUnderLocation(geometry: Geometry, absolutePosition: Vector2): boolean client |
| 判定给定坐标是否在geometry下 |
localToAbsolute(geometry: Geometry, localPosition: Vector2): Vector2 client |
| 将局部坐标转换为绝对坐标,绝对坐标可以是桌面空间,也可以是窗口空间,这取决于小部件层次结构的根所在的空间。 |
localToViewport(geometry: Geometry, localPosition: Vector2, outPixelPosition: Vector2, outViewportPosition: Vector2): void client |
| 将几何体的局部坐标转换为局部视口坐标。 |
releaseTextureFromCache(id: string): void client |
| 尝试标记资源的ICON或则一个URL地址用于释放本地缓存的资源数据 |
screenToViewport(screenPosition: Vector2): Vector2 client |
| 将屏幕位置(以像素为单位)转换为视口控件的本地空间。 |
screenToWidgetAbsolute(screenPosition: Vector2, isIncludeWindowPosition?: boolean): Vector2 client |
| 将屏幕位置(像素)转换为绝对桌面程序坐标。如果bIncludeWindowPosition为真,那么这个方法也将移除游戏窗口的位置(在窗口模式下有用)。 |
screenToWidgetLocal(geometry: Geometry, screenPosition: Vector2, isIncludeWindowPosition?: boolean): Vector2 client |
| 将屏幕位置(以像素为单位)转换为具有给定几何形状的小部件的本地空间。如果bIncludeWindowPosition为真,那么这个方法也将移除游戏窗口的位置(在窗口模式下有用)。 |
setFocusToGameViewport(): void client |
| 设置关注游戏窗口 |
setInputModeGameAndUI(InWidgetToFocus?: Widget, InMouseLockMode?: MouseLockMode, hideCursorDuringCapture?: boolean): void client |
| 设置一个输入模式,只允许UI响应用户输入,如果UI不处理它,玩家输入/玩家控制器就有机会 |
setInputModeGameOnly(): void client |
| 设置一个输入模式,只允许玩家输入/玩家控制器响应用户输入 |
setInputModeUIOnly(InWidgetToFocus?: Widget, InMouseLockMode?: MouseLockMode): void client |
| 设置只允许UI响应用户输入的输入模式。 |
startRecord(screenX: number, screenY: number, screenW: number, screenH: number): string client |
| 录屏 |
stopRecord(): void client |
| 停止录屏 |
transformVectorAbsoluteToLocal(geometry: Geometry, absoluteVector: Vector2): Vector2 client |
| 转化绝对空间下矢量到局部空间下 |
transformVectorLocalToAbsolute(geometry: Geometry, localVector: Vector2): Vector2 client |
| 转化局部空间下矢量到绝对空间下 |
urlDecode(str: string): string |
| url解码 |
urlEncode(str: string): string |
| url转码 |
vibrate(enable: boolean): void client |
| 振动开关 |
Type Aliases
BalanceInfo
Ƭ BalanceInfo: Object
账户余额信息
Type declaration
coin number | 代币余额 |
|---|---|
point number | 积分余额 |
BoolCallback
Ƭ BoolCallback: (value: boolean) => void
Type declaration
• (value): void
返回Bool的回调
Parameters
value | boolean |
|---|
Returns
void
BoolResponse
Ƭ BoolResponse: (success: boolean) => void
Type declaration
• (success): void
返回bool的回调
Parameters
success | boolean |
|---|
Returns
void
BroadcastMessageResult
Ƭ BroadcastMessageResult: Object
发送消息的结果
Type declaration
code MessageState | 发送消息的状态 |
|---|---|
message string | 详细信息 |
ChatEvent
Ƭ ChatEvent: (jsonData: string) => void
Type declaration
• (jsonData): void
收到MGS事件调用
Parameters
jsonData | string |
|---|
Returns
void
CommodityInfo
Ƭ CommodityInfo: Object
使用placeOrder接口下单时用于描述商品信息的类型
Type declaration
commodityId string | 商品Id |
|---|---|
number number | 商品数量 |
CommodityListObj
Ƭ CommodityListObj: Object
通过接口查询符合要求的商品列表时,会返回的对象类型。
Type declaration
data any | 商品数据 |
|---|---|
errorCode number | 查询出错时的错误码 |
message string | 查询出错时的错误消息 |
CustomPropertyType
Ƭ CustomPropertyType: number boolean string Vector2 Vector Vector4 Rotation LinearColor
自定义属性类型
DelegateFuncType
Ƭ DelegateFuncType: (...arg: unknown[]) => unknown other
Type declaration
• (...arg): unknown
代理回调函数签名
DownloadDataResponse
Ƭ DownloadDataResponse: () => void
Type declaration
• (): void
下载角色形象的回调,无参数
Returns
void
EmptyCallback
Ƭ EmptyCallback: () => void
Type declaration
• (): void
空的回调函数类型
Returns
void
HttpResponse
Ƭ HttpResponse: (result: boolean, content: string, responseCode: number) => void
Type declaration
• (result, content, responseCode): void
Http请求的回调消息格式
Precautions
无需主动销毁,生命周期由UObject管理
Parameters
result boolean | 请求否成功 |
|---|---|
content string | 消息内容 |
responseCode number | 状态码 |
Returns
void
LoadAppearanceDataAllCompletedCallback
Ƭ LoadAppearanceDataAllCompletedCallback: () => void
Type declaration
• (): void
角色编辑器数据加载完成后的回调
Returns
void
LocalUGCGameInfo
Ƭ LocalUGCGameInfo: Object
本地工程信息。如果该工程发布过UGC消费态的游戏,那gameId不为空。
Type declaration
gameId string | UGC消费态游戏的MW侧gameId,"U_xxx" 格式 |
|---|---|
parentId string | 父模板游戏的内容库gameId |
path string | 本地工程路径,不需要做拼接,直接传给其他接口即可 |
MGSEvent
Ƭ MGSEvent: (jsonData: string) => void
Type declaration
• (jsonData): void
收到MGS事件调用
Parameters
jsonData | string |
|---|
Returns
void
MGSResponse
Ƭ MGSResponse: (isSuccess: boolean, jsonData: string) => void
Type declaration
• (isSuccess, jsonData): void
GameService的回调
Parameters
isSuccess | boolean |
|---|---|
jsonData | string |
Returns
void
OnArkBalanceUpdated
Ƭ OnArkBalanceUpdated: (amount: number) => void
Type declaration
• (amount): void
客户端接收余额更新的消息格式
Parameters
amount number | 新的余额 |
|---|
Returns
void
OnDescriptionChange
Ƭ OnDescriptionChange: (operationCode: number, index: number, value: unknown) => void
Type declaration
• (operationCode, index, value): void
外观加载细节变化委托
Parameters
operationCode | number |
|---|---|
index | number |
value | unknown |
Returns
void
OnDescriptionComplete
Ƭ OnDescriptionComplete: (character: Character) => void
Type declaration
• (character): void
外观加载完成委托
Precautions
当角色外观加载完成时执行绑定函数
Parameters
character | Character |
|---|
Returns
void
OnKeyConsume
Ƭ OnKeyConsume: (player: Player, orderId: string, boxId: string, amount: number, confirmOrder: (bReceived: boolean) => void) => void
Type declaration
• (player, orderId, boxId, amount, confirmOrder): void
大会员钥匙扣除服务端接收发货通知的消息格式
Parameters
player Player | 下单的玩家Player |
|---|---|
orderId string | 订单Id |
boxId string | 宝箱Id |
amount number | 数量 |
confirmOrder (bReceived: boolean) => void | 是否收到货的回调,会发给订单服务器。如果回调false,服务器会认定未收到货,下次玩家进入游戏,还会收到该通知 |
Returns
void
OnLoadDescriptionFailed
Ƭ OnLoadDescriptionFailed: (Character: Character) => void
Type declaration
• (Character): void
外观主体(前发,后发,头,上衣,下衣,手套,鞋)加载失败委托
Precautions
当角色外观加载失败时执行绑定函数
Parameters
Character | Character |
|---|
Returns
void
OnMovementModeChange
Ƭ OnMovementModeChange: (mode: MovementMode) => void
Type declaration
• (mode): void
移动状态切换委托
Parameters
mode | MovementMode |
|---|
Returns
void
OnOrderDelivered
Ƭ OnOrderDelivered: (playerId: number, orderId: string, commodityId: string, amount: number, confirmOrder: (bReceived: boolean, message?: string) => void) => void
Type declaration
• (playerId, orderId, commodityId, amount, confirmOrder): void
服务端接收发货通知的消息格式
Parameters
playerId number | 下单的玩家playerId |
|---|---|
orderId string | 订单Id |
commodityId string | 商品Id |
amount number | 数量 |
confirmOrder (bReceived: boolean, message?: string) => void | 是否收到货的回调,会发给订单服务器。如果回调false,服务器会认定未收到货,下次玩家进入游戏,还会收到该通知 |
Returns
void
OnViewLayoutSwitched
Ƭ OnViewLayoutSwitched: (newState: number) => void
Type declaration
• (newState): void
窗口显示模式切换的消息格式
Parameters
newState number | 新的窗口模式。1 为“角色展示模式”,2 为“角色编辑模式” |
|---|
Returns
void
OnViewRefreshed
Ƭ OnViewRefreshed: () => void
Type declaration
• (): void
窗口刷新的消息格式
Returns
void
PublishedUGCGameInfo
Ƭ PublishedUGCGameInfo: Object
发布成功的UGC消费态游戏信息
Type declaration
end boolean | 接口data为空/网络请求失败时,end会返回true |
|---|---|
games [{ banner: string;id: string;likeIt: boolean;loveQuantity: number;packageName: string;ugcGameName: string }] | 接口data为空/网络请求失败时,games会返回空列表 |
RechargeInfo
Ƭ RechargeInfo: Object
充值信息
Type declaration
amount number | 充值金额,单位:分 |
|---|---|
code number | 充值状态码 200-充值成功 |
message string | 状态消息,充值失败时为具体失败原因 |
productList? CommodityInfo[] | 商品清单。触发这次充值的订单商品信息 |
source number | 充值来源。0-代币充值,1-会员充值 |
RedeemResponse
Ƭ RedeemResponse: Object
status : 兑换状态。
200 : 兑换成功
400 : 兑换失败(兑换码不存在)
423 : 兑换失败(请求频繁)
1002 :兑换失败(兑换码不在使用期限内)
1010 :兑换失败(兑换码已使用)
1011 :兑换失败(兑换超时)
1012 :兑换失败(礼包库存不足)
1013 :兑换失败(超出兑换次数)
1014 :兑换失败(数据库失败)
1015 :兑换失败(非本游戏道具)
message : 兑换信息
当兑换状态为成功时:兑换信息为礼包内容道具详情。
当兑换状态为失败时:兑换信息为失败详情,例如:兑换码不存在。
Type declaration
message | string |
|---|---|
player | Player |
status | number |
SetAppearanceDataCallback
Ƭ SetAppearanceDataCallback: (APIName: string) => void
Type declaration
• (APIName): void
设置编辑数据完成的回调
Parameters
APIName | string |
|---|
Returns
void
ShipOrderResponse
Ƭ ShipOrderResponse: Object
发货回调
Type declaration
message string | 发货的具体信息 |
|---|---|
orderId string | 订单Id |
status boolean | 发货成功返回true 购买已拥有的商品/其他服务器错误 返回false |
userId string | 玩家UserId |
StringCallback
Ƭ StringCallback: (str: string) => void
Type declaration
• (str): void
返回String的回调
Parameters
str | string |
|---|
Returns
void
StringResponse
Ƭ StringResponse: (dataString: string) => void
Type declaration
• (dataString): void
返回string的回调
Parameters
dataString | string |
|---|
Returns
void
TabGroupOnClickedProps
Ƭ TabGroupOnClickedProps: Object
选项卡组-点击事件type
TeamMatchFailureInfo
Ƭ TeamMatchFailureInfo: Object
组队跳游戏请求失败回调
Type declaration
failedReason string | 失败原因 |
|---|---|
playerIds number[] | 组队玩家的playerId数组 |
TeleportData
Ƭ TeleportData: string string[] Record<string, any> Record<string, any>[]
传送时可携带的数据类型
TransactionType
Ƭ TransactionType: (isSuccess: boolean, content: string) => void
Type declaration
• (isSuccess, content): void
商城通信回调消息格式
Parameters
isSuccess boolean | 通信结果 |
|---|---|
content string | 消息内容 |
Returns
void
TweenEasingFunction
Ƭ TweenEasingFunction: (amount: number) => number
Type declaration
• (amount): number
缓动函数的类型定义
Parameters
amount | number |
|---|
Returns
number
TweenInterpolationFunction
Ƭ TweenInterpolationFunction: (v: number[], k: number) => number
Type declaration
• (v, k): number
插值函数的类型定义
Parameters
v | number[] |
|---|---|
k | number |
Returns
number
TweenUnknownProps
Ƭ TweenUnknownProps: Record<string, any>
补间属性的定义,用户可以自由扩展
UGCTemplateInfo
Ƭ UGCTemplateInfo: Object
UGC模板信息
Type declaration
fileUrl { assetDataListUrl: string;zipUrl: string } | 下载链接 |
|---|---|
fileUrl.assetDataListUrl string | 模板assetDataList文件下载链接 |
fileUrl.zipUrl string | 模板工程下载链接 |
gameIdentity string | MW侧gameId |
gid string | 内容库gameId |
icon string | 模板Icon下载链接 |
id number | 分页用的id |
name string | 模板名称 |
packageName string | 模板包名 |
version string | 模板版本号 |
UploadDataResponse
Ƭ UploadDataResponse: (success: boolean) => void
Type declaration
• (success): void
下载角色形象的回调消息格式
Parameters
success boolean | 上传是否成功 |
|---|
Returns
void
VehicleGearDataNew
Ƭ VehicleGearDataNew: Object
四轮载具挡位属性
Type declaration
gearDownRatio number | 下齿比值 |
|---|---|
gearLevel number | 挡位级别 |
gearRatio number | 齿比值 |
gearUpRatio number | 上齿比值 |
VehicleWheelDataNew
Ƭ VehicleWheelDataNew: Object
四轮载具车轮属性
Type declaration
wheelAngle number | 车轮最大转向角度 |
|---|---|
wheelModel string | 车轮绑定对象ID |
wheelRadius number | 车轮半径 |
VoidResponse
Ƭ VoidResponse: () => void
Type declaration
• (): void
返回无参数的回调
Returns
void
downloadCharacterDataStringCallback
Ƭ downloadCharacterDataStringCallback: (dataString: string) => void
Type declaration
• (dataString): void
下载平台数据回调
Parameters
dataString | string |
|---|
Returns
void
keyUsageInfo
Ƭ keyUsageInfo: Object
大会员消费钥匙订单。orderId:订单ID,boxId:宝箱ID,number:购买宝箱数量,shipTime:发货时间,毫秒级时间戳
Type declaration
boxId | string |
|---|---|
consumeTime | number |
number | number |
orderId | string |
maskWordCheckResult
Ƭ maskWordCheckResult: Object
屏蔽字检测的结果
Type declaration
hits string[] | 命中的文本,如果通过检测则为空 |
|---|---|
result boolean | 是否通过,true - 通过、false - 不通过 |
onAppearanceDataChanged
Ƭ onAppearanceDataChanged: (GUID: string) => void
Type declaration
• (GUID): void
角色身上GUID切换成功回调
Parameters
GUID | string |
|---|
Returns
void
Variables
Client
• Const Client: FunctionOption
客户端
Multicast
• Const Multicast: FunctionOption
多播
Result
• Const Result: FunctionOption
与Client Server配合实现RPC函数返回值
Server
• Const Server: FunctionOption
服务端
UILayerBottom
• Const UILayerBottom: 1
底层 zOrder开始于100000
UILayerDialog
• Const UILayerDialog: 5
对话 zOrder开始于500000
UILayerError
• Const UILayerError: 7
错误 这个层级不可以使用,需要增加层级可以使用addUILayerMap zOrder开始于700000
UILayerMiddle
• Const UILayerMiddle: 2
中层 zOrder开始于200000
UILayerOwn
• Const UILayerOwn: 3
独享层(调用此层会自动隐藏Bottom和Middle层) zOrder开始于300000
UILayerScene
• Const UILayerScene: 0
场景 zOrder开始于0
UILayerSystem
• Const UILayerSystem: 6
系统 zOrder开始于600000
UILayerTop
• Const UILayerTop: 4
顶层 zOrder开始于400000
Unreliable
• Const Unreliable: FunctionOption
不可靠rpc
Functions
Component
• Component<T>(component): T
将类声明为mwclass
Type parameters
T | extends typeof Script |
|---|
Parameters
component T | 自定义类 |
|---|
Returns
T | 自定义类 |
|---|
Property
• Property(option?): (target: object, key: string) => void
属性支持同步
Parameters
option? IPropertyOptions | 配置 default:配置 |
|---|
Returns
fn | void |
|---|
RemoteFunction
• RemoteFunction(...options): (target: unknown, propertyKey: string, descriptor: PropertyDescriptor) => void
函数支持Rpc调用
Parameters
...options FunctionOption[] | Rpc调用方式 |
|---|
Returns
fn | void |
|---|
Serializable
• Serializable<T>(type): T
类型支持属性同步
Type parameters
T | extends ConstructorType |
|---|
Parameters
type T | 自定义类 |
|---|
Returns
T | 自定义类 |
|---|
absoluteToLocal
• absoluteToLocal(geometry, absolutePosition): Vector2 client
转化绝对坐标到相对坐标
Parameters
geometry Geometry | 几何体 |
|---|---|
absolutePosition Vector2 | 绝对坐标 |
Returns
Vector2 | 相对坐标 |
|---|
absoluteToViewport
• absoluteToViewport(absoluteDesktopPosition, outPixelPosition, outViewportPosition): void client
将桌面空间中几何图形的绝对坐标转换为本地视口坐标
Parameters
absoluteDesktopPosition Vector2 | 绝对桌面坐标 |
|---|---|
outPixelPosition Vector2 | 可用于线的轨迹和其他用途,你需要在视口分辨率单位的空间坐标 |
outViewportPosition Vector2 | 如果你想添加另一个小部件到视口空间相同的位置 |
asyncCreateUI
• asyncCreateUI<T>(UIPrefabName, panelClass): Promise<T> client
异步创建UI
Type parameters
T | extends UIScript<T> |
|---|
Parameters
UIPrefabName string | 指定 UI 自定义控件的相对于工程的路径或则相对于 UI 目录的路径 range: 无 |
|---|---|
panelClass () => T | 继承至 UI 身上脚本的派生类 |
Returns
Promise<T> | 对应的UI |
|---|
asyncCreateUIByName
• asyncCreateUIByName(UIPath): Promise<UserWidget> client
异步创建UI,失败返回空
Parameters
UIPath string | 创建 UI 的完整路径 range: 路径长度 |
|---|
Returns
Promise<UserWidget> | 对应的UI |
|---|
cancelDragDrop
• cancelDragDrop(): void client
中断所有的DragDrop
createUI
• createUI<T>(UIPrefabName, panelClass): T client
创建UIPrefab
Type parameters
T | extends UIScript<T> |
|---|
Parameters
UIPrefabName string | 指定 UI 自定义控件的相对于工程的路径或则相对于 UI 目录的路径,为空的话等于 createUIOnlyClass range: 路径长度不做限制 |
|---|---|
panelClass () => T | 继承至 UI 身上脚本的派生类 |
Returns
T | 对应的UI |
|---|
createUIByName
• createUIByName(UIPrefabName): UserWidget client
创建 UIPrefab
Parameters
UIPrefabName string | 指定 UI 自定义控件的相对于工程的路径或则相对于 UI 目录的路径 range: 路径长度不做限制 |
|---|
Returns
UserWidget | 对应的UI |
|---|
createUIByPath
• createUIByPath(UIPath): UserWidget client
创建 UIPrefab
Parameters
UIPath string | 创建 UI 的完整路径 range: 路径长度 |
|---|
Returns
UserWidget | 对应的UI |
|---|
createUIOnlyClass
• createUIOnlyClass<T>(panelClass): T client
创建空的 UI
Type parameters
T | extends UIScript<T> |
|---|
Parameters
panelClass () => T | 指定 UI 控件身上的行为脚本 |
|---|
Returns
T | 对应的UI |
|---|
endDragDrop
• endDragDrop(InReply): void client
中断一个拖拽事件, 传入一个操作的事件
Parameters
InReply EventReply | 事件 |
|---|
fetch
• fetch(url, init?): Promise<Response>
HTTP请求
Parameters
url string | url range: 不做限制 |
|---|---|
init? RequestInit | 请求信息 default:请求信息 |
Returns
Promise<Response> | 响应信息 |
|---|
findUIScript
• findUIScript(UI): UIScript client
获取 UI 脚本
Parameters
UI Widget | UI控件 |
|---|
Returns
UIScript | UI绑定的脚本 |
|---|
generalHttpRequest
• generalHttpRequest(response, requestUrl, param, jsonContent, requestType): boolean
通用 Http 请求
使用示例:发送Http请求ts
generalHttpRequest(Response,Url,Param,JsonContent)generalHttpRequest(Response,Url,Param,JsonContent)Parameters
response HttpResponse | OnHttpResponse |
|---|---|
requestUrl HttpRequestURL | EHttpRequestURL |
param string | string range: 不做限制 |
jsonContent any | any |
requestType HttpRequestType | 0是Get 1是Post |
Returns
boolean | bool |
|---|
getAbsoluteSize
• getAbsoluteSize(geometry): Vector2 client
返回绝对空间中几何图形的大小
Parameters
geometry Geometry | 几何体 |
|---|
Returns
Vector2 | 返回Size |
|---|
getAssetIconDataByAssetID
• getAssetIconDataByAssetID(asset, size?): AssetIconData client
获取资源的 ICON 信息
Parameters
asset string | 指定资源的 id range: 依据资源 ID 长度而定。 |
|---|---|
size? AssetIconSize | 指定资源的分辨率尺寸 default: AssetIconSize.Icon_128px |
Returns
AssetIconData | 资源的ICON信息 |
|---|
getCurrentMousePosition
• getCurrentMousePosition(): Vector2 client
获取当前鼠标所在的绝对位置
Returns
Vector2 | 绝对位置 |
|---|
getDragDroppingContent
• getDragDroppingContent(): DragDropOperation client
获取当前的DragDrop事件
Returns
DragDropOperation | 返回当前的DragDrop事件 |
|---|
getForcedMovementHits
• getForcedMovementHits(character): HitResult[]
获取强制更新移动时检测到的碰撞结果
Parameters
character Character | 需要获取碰撞结果的角色 default: null 必填参数 type: Character |
|---|
Returns
HitResult[] | 强制移动检测到的碰撞数据 |
|---|
getLastMousePosition
• getLastMousePosition(): Vector2 client
获取上一次鼠标所在的绝对位置
Returns
Vector2 | 绝对位置 |
|---|
getLocalSize
• getLocalSize(geometry): Vector2 client
返回局部空间中几何图形的大小
Parameters
geometry Geometry | 几何体 |
|---|
Returns
Vector2 | 返回Size |
|---|
getLocalTopLeft
• getLocalTopLeft(geometry): Vector2 client
返回局部空间中几何图形的局部顶部/左侧
Parameters
geometry Geometry | 几何体 |
|---|
Returns
Vector2 | 返回LeftTop |
|---|
getMousePositionOnPlatform
• getMousePositionOnPlatform(): Vector2 client
获取平台的鼠标光标位置。这是鼠标的绝对桌面位置。
Returns
Vector2 | 返回平台的鼠标光标位置。这是鼠标的绝对桌面位置。 |
|---|
getMousePositionOnViewport
• getMousePositionOnViewport(): Vector2 client
获取平台的鼠标光标在视口控件的本地空间中的位置。
Returns
Vector2 | 返回平台的鼠标光标在视口控件的本地空间中的位置。 |
|---|
getPlayerScreenWidgetGeometry
• getPlayerScreenWidgetGeometry(player): Geometry client
获取包含添加到“player screen”的所有控件的控件的几何形状。你可以使用这个几何图形在绝对和本地空间的控件之间转换控件。
Parameters
player Player | 玩家在游戏世界中的位置投射到屏幕上的控制器 |
|---|
Returns
Geometry | 返回所有控件的控件的几何形状 |
|---|
getResolutionChanged
• getResolutionChanged(Delegate): void client
分辨率改变时的回调
Parameters
Delegate MulticastDelegate<(x: number, y: number) => void> | 传入回调函数 |
|---|
getUrlParameter
• getUrlParameter(url, parameterName): string
获取 url 参数
Parameters
url string | url range: 不做限制,依据具体的 url 的长度 |
|---|---|
parameterName string | 参数名 range: 不做限制 |
Returns
string | 参数值 |
|---|
getViewportScale
• getViewportScale(): number client
获取应用于视口和所有小部件的当前DPI Scale。
Returns
number | 返回应用于视口和所有小部件的当前DPI Scale。 |
|---|
getViewportSize
• getViewportSize(): Vector2 client
获取游戏视口的大小。
Returns
Vector2 | 返回游戏视口的大小。 |
|---|
getViewportWidgetGeometry
• getViewportWidgetGeometry(): Geometry client
获取包含添加到“视口”中的所有控件的控件的几何形状。你可以使用这个几何图形在绝对和本地空间的控件之间转换控件。
Returns
Geometry | 返回所有控件的控件的几何形状 |
|---|
httpRequestTransmitData
• httpRequestTransmitData(response, paramUrl, jsonContent, requestType): boolean
Http请求接口
Parameters
response HttpResponse | 请求的回调 |
|---|---|
paramUrl string | 请求的参数和值 range: 不做限制 |
jsonContent string | 请求数据内容,json格式 range: 不做限制 |
requestType HttpRequestType | 请求类型。HttpRequestType枚举值 |
Returns
boolean | 请求是否发送成功 |
|---|
isDragDropping
• isDragDropping(): boolean client
判断当前是否有一个DragDrop事件
Returns
boolean | boolean |
|---|
isUnderLocation
• isUnderLocation(geometry, absolutePosition): boolean client
判定给定坐标是否在geometry下
Parameters
geometry Geometry | 几何体 |
|---|---|
absolutePosition Vector2 | 绝对坐标 |
Returns
boolean | 坐标是否在geometry下 |
|---|
localToAbsolute
• localToAbsolute(geometry, localPosition): Vector2 client
将局部坐标转换为绝对坐标,绝对坐标可以是桌面空间,也可以是窗口空间,这取决于小部件层次结构的根所在的空间。
Parameters
geometry Geometry | 几何体 |
|---|---|
localPosition Vector2 | 相对坐标 |
Returns
Vector2 | 绝对坐标 |
|---|
localToViewport
• localToViewport(geometry, localPosition, outPixelPosition, outViewportPosition): void client
将几何体的局部坐标转换为局部视口坐标。
Parameters
geometry Geometry | 几何体 |
|---|---|
localPosition Vector2 | 局部坐标 |
outPixelPosition Vector2 | 可用于线的轨迹和其他用途,你需要在视口分辨率单位的空间坐标。 |
outViewportPosition Vector2 | 如果你想添加另一个控件到视口空间相同的位置 |
releaseTextureFromCache
• releaseTextureFromCache(id): void client
尝试标记资源的ICON或则一个URL地址用于释放本地缓存的资源数据
Parameters
id string | 指定资源的 id range: 依据资源 ID 长度而定。 |
|---|
screenToViewport
• screenToViewport(screenPosition): Vector2 client
将屏幕位置(以像素为单位)转换为视口控件的本地空间。
Parameters
screenPosition Vector2 | 屏幕位置 |
|---|
Returns
Vector2 | 本地位置 |
|---|
screenToWidgetAbsolute
• screenToWidgetAbsolute(screenPosition, isIncludeWindowPosition?): Vector2 client
将屏幕位置(像素)转换为绝对桌面程序坐标。如果bIncludeWindowPosition为真,那么这个方法也将移除游戏窗口的位置(在窗口模式下有用)。
Parameters
screenPosition Vector2 | 屏幕位置 |
|---|---|
isIncludeWindowPosition? boolean | 是否移除游戏窗口位置(在窗口模式下有用) default:false |
Returns
Vector2 | 绝对桌面程序坐标 |
|---|
screenToWidgetLocal
• screenToWidgetLocal(geometry, screenPosition, isIncludeWindowPosition?): Vector2 client
将屏幕位置(以像素为单位)转换为具有给定几何形状的小部件的本地空间。如果bIncludeWindowPosition为真,那么这个方法也将移除游戏窗口的位置(在窗口模式下有用)。
Parameters
geometry Geometry | 集合体 |
|---|---|
screenPosition Vector2 | 屏幕位置 |
isIncludeWindowPosition? boolean | 是否移除游戏窗口位置(在窗口模式下有用) default: false |
Returns
Vector2 | 控件的本地位置 |
|---|
setFocusToGameViewport
• setFocusToGameViewport(): void client
设置关注游戏窗口
setInputModeGameAndUI
• setInputModeGameAndUI(InWidgetToFocus?, InMouseLockMode?, hideCursorDuringCapture?): void client
设置一个输入模式,只允许UI响应用户输入,如果UI不处理它,玩家输入/玩家控制器就有机会
Parameters
InWidgetToFocus? Widget | 响应输入模式的widget default:null |
|---|---|
InMouseLockMode? MouseLockMode | 鼠标锁定的输入模式 default:UIType.MouseLockMode.DoNotLock |
hideCursorDuringCapture? boolean | 是否隐藏光标 default:true |
setInputModeGameOnly
• setInputModeGameOnly(): void client
设置一个输入模式,只允许玩家输入/玩家控制器响应用户输入
setInputModeUIOnly
• setInputModeUIOnly(InWidgetToFocus?, InMouseLockMode?): void client
设置只允许UI响应用户输入的输入模式。
Parameters
InWidgetToFocus? Widget | 响应输入模式的widget default:null |
|---|---|
InMouseLockMode? MouseLockMode | 鼠标锁定的输入模式 default:UIType.MouseLockMode.DoNotLock |
startRecord
• startRecord(screenX, screenY, screenW, screenH): string client
录屏
Parameters
screenX number | 屏幕左上角 X 值 default: null 必填参数 range: 不限制 type: 浮点数 |
|---|---|
screenY number | 屏幕左上角 Y 值 default: null 必填参数 range: 不限制 type: 浮点数 |
screenW number | 录制图像宽度 default: null 必填参数 range: 不限制 type: 浮点数 |
screenH number | 录制图像高度 default: null 必填参数 range: 不限制 type: 浮点数 |
Returns
string | mp4 文件路径。文件路径固定,不同平台路径会有些许差别。 |
|---|
stopRecord
• stopRecord(): void client
停止录屏
transformVectorAbsoluteToLocal
• transformVectorAbsoluteToLocal(geometry, absoluteVector): Vector2 client
转化绝对空间下矢量到局部空间下
Parameters
geometry Geometry | 几何体 |
|---|---|
absoluteVector Vector2 | 绝对空间矢量 |
Returns
Vector2 | 局部空间下矢量 |
|---|
transformVectorLocalToAbsolute
• transformVectorLocalToAbsolute(geometry, localVector): Vector2 client
转化局部空间下矢量到绝对空间下
Parameters
geometry Geometry | 几何体 |
|---|---|
localVector Vector2 | 局部空间下矢量 |
Returns
Vector2 | 绝对空间矢量 |
|---|
urlDecode
• urlDecode(str): string
url解码
Parameters
str string | 内容 range: 不做限制 |
|---|
Returns
string | 解码后的内容 |
|---|
urlEncode
• urlEncode(str): string
url转码
Parameters
str string | 内容 range: 不做限制 |
|---|
Returns
string | 转码后的内容 |
|---|
vibrate
• vibrate(enable): void client
振动开关
Parameters
enable boolean | -true:开启震动,-false:关闭震动 |
|---|