CLASS
AIBasicCommand
AI基础命令类型
Ability
技能
AbilityKey
技能编号
AbilityLimitation
技能使用限制
AbilitySlot
技能槽位
AbilityStyleKey
技能控件样式编号
Achievement
自定义成就
AnimKey
动画编号
AnimationStyleKey
动效样式编号
Archive
自定义存档
ArchiveType
存档类型
BagSlotStyleKey
物品格样式编号
BattleShopKey
商店
BindType
绑定类型
Bool
布尔值
BtnStyleKey
按钮样式编号
BuffState
状态
CameraBindMode
相机绑定模式
CameraProjectionType
相机投影类型
CameraPropertyType
相机属性预设
CameraShakeType
屏幕震动类型
Camp
阵营
CampID
阵营ID
Character
角色
CharacterKey
角色编号
ChessType
麻将/扑克花色
CollisionLimitType
碰撞限制枚举
Color
颜色
Creature
生物
CreatureKey
生物编号
CustomTriggerSpace
触发区域
CustomTriggerSpaceKey
触发区域编号
DamageSchema
伤害方案
DecorationKey
装饰物编号
Dict
字典
DirectionType
方向枚举
E3DLayer
场景UI实例
E3DLayerKey
场景UI预设
EAnimationState
UI动画状态
EBagSlot
UI物品槽位节点
EButton
UI按钮节点
EEffectNode
UI动效节点
EImage
UI图片节点
EInputField
UI输入节点
ELabel
UI文本节点
ENode
UI节点
EProgressbar
UI进度条节点
ETypeMeta
None
EmojiKey
气泡表情编号
Equipment
物品
EquipmentKey
物品编号
EquipmentSlot
物品槽位
EquipmentSlotType
物品槽位类型
Fixed
定点数
FontKey
字体key
FriendshipType
好友关系
Function
函数
ImageKey
图片编号
InputStyleKey
输入框样式编号
Int
整型
InteractBtnID
交互按钮编号
InteractBtnType
交互按钮类型
JointAssistantKey
关节预设编号
JointAssistantProperty
关节属性
LabelStyleKey
文本样式编号
LevelKey
关卡编号
LifeEntity
生命体
List
列表
ListAIBasicCommand
AI基础命令类型列表
ListFixed
定点数列表
ListStr
字符串列表
ListUnitType
单位类型列表
ListVector3
向量列表
ModelSocket
部位
Modifier
效果
ModifierKey
效果编号
MontageKey
剧情动画编号
MoveMode
AI移动模式
Obstacle
组件
ObstacleKey
组件编号
PaintArea
染色区域
PathID
路径ID
PathPointID
路点ID
PatrolType
AI巡逻类型
PlaneType
拖动平面
Point3
坐标点
ProgressBarStyleKey
条形进度条样式编号
ProgressTimerStyleKey
环形进度条样式编号
Quaternion
四元数
Role
玩家
RoleID
玩家ID
SfxID
特效ID
SfxKey
特效编号
SheetID
表格
Skeleton
骨骼
SkyBoxBackground
天空盒背景
SkyBoxGradualType
天空盒渐变类型
SoundID
音效ID
SoundKey
音效编号
Str
字符串
Timer
计时器
Timestamp
时间戳
TriggerSpaceKey
逻辑体编号
UIPreset
UIPreset
UgcCommodity
道具
UgcGoods
商品
Unit
单位
UnitGroupKey
组件组编号
UnitID
单位ID
UnitKey
单位编号
UnitType
单位类型
ValueType
值类型
Vector3
向量
Vehicle
载具
VehicleKey
单位编号(载具)
WindFieldShapeType
风场形状
ENUM
UnitType 单位类型
CREATURE 4 生物
CUSTOMTRIGGERSPACE 8 触发区域
CHARACTER 128 角色
OBSTACLE 256 组件
TRIGGERSPACE 512 逻辑体
DECORATION 1024 装饰物
EQUIPMENT 32768 物品
ValueType 值类型
AIBasicCommand AIBasicCommand AI基础命令类型
Ability Ability 技能
AbilityAnchorID AbilityAnchorID 技能锚点ID
AbilityIndex AbilityIndex 技能槽位(内部)
AbilityKey AbilityKey 技能编号
AbilityLimitation AbilityLimitation 技能使用限制
AbilityPointerType AbilityPointerType 技能指示器类型
AbilitySlot AbilitySlot 技能槽位
AbilityStyleKey AbilityStyleKey 技能控件样式编号
Achievement Achievement 自定义成就
Actor Actor Actor
AnimKey AnimKey 动画编号
AnimationStyleKey AnimationStyleKey 动效样式编号
Archive Archive 自定义存档
ArchiveType ArchiveType 存档类型
BagSlotStyleKey BagSlotStyleKey 物品格样式编号
BattleShopKey BattleShopKey 商店
BindType BindType 绑定类型
Bool Bool 布尔值
BtnStyleKey BtnStyleKey 按钮样式编号
BuffState BuffState 状态
CameraBindMode CameraBindMode 相机绑定模式
CameraDragType CameraDragType 相机拖动类型
CameraProjectionType CameraProjectionType 相机投影类型
CameraPropertyType CameraPropertyType 相机属性预设
CameraShakeCurve CameraShakeCurve 屏幕震动曲线
CameraShakeType CameraShakeType 屏幕震动类型
Camp Camp 阵营
CampID CampID 阵营ID
CampRelationType CampRelationType 阵营关系类型
Character Character 角色
CharacterID CharacterID 角色ID
CharacterKey CharacterKey 角色编号
ChessType ChessType 麻将/扑克花色
CollisionLimitType CollisionLimitType 碰撞限制枚举
Color Color 颜色
Creature Creature 生物
CreatureID CreatureID 生物ID
CreatureKey CreatureKey 生物编号
CustomTriggerSpace CustomTriggerSpace 触发区域
CustomTriggerSpaceID CustomTriggerSpaceID 触发区域ID
CustomTriggerSpaceKey CustomTriggerSpaceKey 触发区域编号
Damage Damage 伤害
DamageSchema DamageSchema 伤害方案
Decoration Decoration 装饰物
DecorationKey DecorationKey 装饰物编号
DirectionType DirectionType 方向枚举
DynamicTextID DynamicTextID 动态文字ID
E3DLayer E3DLayer 场景UI实例
E3DLayerKey E3DLayerKey 场景UI预设
EAnimationState EAnimationState UI动画状态
EBagSlot EBagSlot UI物品槽位节点
EButton EButton UI按钮节点
ECanvas ECanvas UI画布节点
EEffectNode EEffectNode UI动效节点
EImage EImage UI图片节点
EInputField EInputField UI输入节点
ELabel ELabel UI文本节点
ENode ENode UI节点
ENodeTouchEventType ENodeTouchEventType 界面交互事件类型
EProgressbar EProgressbar UI进度条节点
EmojiKey EmojiKey 气泡表情编号
Equipment Equipment 物品
EquipmentID EquipmentID 物品ID
EquipmentKey EquipmentKey 物品编号
EquipmentSlot EquipmentSlot 物品槽位
EquipmentSlotType EquipmentSlotType 物品槽位类型
EquipmentType EquipmentType 物品类型
FaceExpressionKey FaceExpressionKey 面部表情编号
FaceStatusKey FaceStatusKey 动态表情key
FashionKey FashionKey 时装编号
Fixed Fixed 定点数
FontKey FontKey 字体key
FriendshipType FriendshipType 好友关系
GameResult GameResult 游戏结局
HpBarDisplayMode HpBarDisplayMode 血条显示模式
ImageKey ImageKey 图片编号
InputStyleKey InputStyleKey 输入框样式编号
Int Int 整型
InteractBtnID InteractBtnID 交互按钮编号
InteractBtnType InteractBtnType 交互按钮类型
JointAssistant JointAssistant 关节
JointAssistantKey JointAssistantKey 关节预设编号
JointAssistantProperty JointAssistantProperty 关节属性
JointAssistantType JointAssistantType 关节类型
LabelStyleKey LabelStyleKey 文本样式编号
LevelKey LevelKey 关卡编号
LifeEntity LifeEntity 生命体
LifeEntityKey LifeEntityKey 生命体编号
ListAIBasicCommand ListAIBasicCommand AI基础命令类型列表
ListAbility ListAbility 技能列表
ListAbilityAnchorID ListAbilityAnchorID 技能锚点ID列表
ListAbilityIndex ListAbilityIndex 技能槽位(内部)列表
ListAbilityKey ListAbilityKey 技能编号列表
ListAbilityLimitation ListAbilityLimitation 技能使用限制列表
ListAbilityPointerType ListAbilityPointerType 技能指示器类型列表
ListAbilitySlot ListAbilitySlot 技能槽位列表
ListAbilityStyleKey ListAbilityStyleKey 技能控件样式编号列表
ListAchievement ListAchievement 自定义成就列表
ListActor ListActor Actor列表
ListAnimKey ListAnimKey 动画编号列表
ListAnimationStyleKey ListAnimationStyleKey 动效样式编号列表
ListArchive ListArchive 自定义存档列表
ListArchiveType ListArchiveType 存档类型列表
ListBagSlotStyleKey ListBagSlotStyleKey 物品格样式编号列表
ListBattleShopKey ListBattleShopKey 商店列表
ListBindType ListBindType 绑定类型列表
ListBool ListBool 布尔值列表
ListBtnStyleKey ListBtnStyleKey 按钮样式编号列表
ListBuffState ListBuffState 状态列表
ListCameraBindMode ListCameraBindMode 相机绑定模式列表
ListCameraDragType ListCameraDragType 相机拖动类型列表
ListCameraProjectionType ListCameraProjectionType 相机投影类型列表
ListCameraPropertyType ListCameraPropertyType 相机属性预设列表
ListCameraShakeCurve ListCameraShakeCurve 屏幕震动曲线列表
ListCameraShakeType ListCameraShakeType 屏幕震动类型列表
ListCamp ListCamp 阵营列表
ListCampID ListCampID 阵营ID列表
ListCampRelationType ListCampRelationType 阵营关系类型列表
ListCharacter ListCharacter 角色列表
ListCharacterID ListCharacterID 角色ID列表
ListCharacterKey ListCharacterKey 角色编号列表
ListChessType ListChessType 麻将/扑克花色列表
ListCollisionLimitType ListCollisionLimitType 碰撞限制枚举列表
ListColor ListColor 颜色列表
ListCreature ListCreature 生物列表
ListCreatureID ListCreatureID 生物ID列表
ListCreatureKey ListCreatureKey 生物编号列表
ListCustomTriggerSpace ListCustomTriggerSpace 触发区域列表
ListCustomTriggerSpaceID ListCustomTriggerSpaceID 触发区域ID列表
ListCustomTriggerSpaceKey ListCustomTriggerSpaceKey 触发区域编号列表
ListDamage ListDamage 伤害列表
ListDamageSchema ListDamageSchema 伤害方案列表
ListDecoration ListDecoration 装饰物列表
ListDecorationKey ListDecorationKey 装饰物编号列表
ListDirectionType ListDirectionType 方向枚举列表
ListDynamicTextID ListDynamicTextID 动态文字ID列表
ListE3DLayer ListE3DLayer 场景UI实例列表
ListE3DLayerKey ListE3DLayerKey 场景UI预设列表
ListEAnimationState ListEAnimationState UI动画状态列表
ListEBagSlot ListEBagSlot UI物品槽位节点列表
ListEButton ListEButton UI按钮节点列表
ListECanvas ListECanvas UI画布节点列表
ListEEffectNode ListEEffectNode UI动效节点列表
ListEImage ListEImage UI图片节点列表
ListEInputField ListEInputField UI输入节点列表
ListELabel ListELabel UI文本节点列表
ListENode ListENode UI节点列表
ListENodeTouchEventType ListENodeTouchEventType 界面交互事件类型列表
ListEProgressbar ListEProgressbar UI进度条节点列表
ListEmojiKey ListEmojiKey 气泡表情编号列表
ListEquipment ListEquipment 物品列表
ListEquipmentID ListEquipmentID 物品ID列表
ListEquipmentKey ListEquipmentKey 物品编号列表
ListEquipmentSlot ListEquipmentSlot 物品槽位列表
ListEquipmentSlotType ListEquipmentSlotType 物品槽位类型列表
ListEquipmentType ListEquipmentType 物品类型列表
ListFaceExpressionKey ListFaceExpressionKey 面部表情编号列表
ListFaceStatusKey ListFaceStatusKey 动态表情key列表
ListFashionKey ListFashionKey 时装编号列表
ListFixed ListFixed 定点数列表
ListFontKey ListFontKey 字体key列表
ListFriendshipType ListFriendshipType 好友关系列表
ListGameResult ListGameResult 游戏结局列表
ListHpBarDisplayMode ListHpBarDisplayMode 血条显示模式列表
ListImageKey ListImageKey 图片编号列表
ListInputStyleKey ListInputStyleKey 输入框样式编号列表
ListInt ListInt 整型列表
ListInteractBtnID ListInteractBtnID 交互按钮编号列表
ListInteractBtnType ListInteractBtnType 交互按钮类型列表
ListJointAssistant ListJointAssistant 关节列表
ListJointAssistantKey ListJointAssistantKey 关节预设编号列表
ListJointAssistantProperty ListJointAssistantProperty 关节属性列表
ListJointAssistantType ListJointAssistantType 关节类型列表
ListLabelStyleKey ListLabelStyleKey 文本样式编号列表
ListLevelKey ListLevelKey 关卡编号列表
ListLifeEntity ListLifeEntity 生命体列表
ListLifeEntityKey ListLifeEntityKey 生命体编号列表
ListModelSocket ListModelSocket 部位列表
ListModifier ListModifier 效果列表
ListModifierKey ListModifierKey 效果编号列表
ListMontageKey ListMontageKey 剧情动画编号列表
ListMoveMode ListMoveMode AI移动模式列表
ListObstacle ListObstacle 组件列表
ListObstacleID ListObstacleID 组件ID列表
ListObstacleKey ListObstacleKey 组件编号列表
ListOrientationType ListOrientationType 方位枚举列表
ListPaintArea ListPaintArea 染色区域列表
ListPathID ListPathID 路径ID列表
ListPathPointID ListPathPointID 路点ID列表
ListPatrolType ListPatrolType AI巡逻类型列表
ListPlaneType ListPlaneType 拖动平面列表
ListProgressBarStyleKey ListProgressBarStyleKey 条形进度条样式编号列表
ListProgressTimerStyleKey ListProgressTimerStyleKey 环形进度条样式编号列表
ListQuaternion ListQuaternion 四元数列表
ListRigidBodyType ListRigidBodyType 物理类型列表
ListRole ListRole 玩家列表
ListRoleID ListRoleID 玩家ID列表
ListSfxID ListSfxID 特效ID列表
ListSfxKey ListSfxKey 特效编号列表
ListSheetID ListSheetID 表格列表
ListSkeleton ListSkeleton 骨骼列表
ListSkyBoxBackground ListSkyBoxBackground 天空盒背景列表
ListSkyBoxGradualType ListSkyBoxGradualType 天空盒渐变类型列表
ListSound3DKey ListSound3DKey 3D音效编号列表
ListSoundID ListSoundID 音效ID列表
ListSoundKey ListSoundKey 音效编号列表
ListStr ListStr 字符串列表
ListTimer ListTimer 计时器列表
ListTimestamp ListTimestamp 时间戳列表
ListTrigger ListTrigger 触发器列表
ListTriggerSpace ListTriggerSpace 逻辑体列表
ListTriggerSpaceEventType ListTriggerSpaceEventType 触发区域类型列表
ListTriggerSpaceID ListTriggerSpaceID 逻辑体ID列表
ListTriggerSpaceKey ListTriggerSpaceKey 逻辑体编号列表
ListUIPreset ListUIPreset UIPreset列表
ListUIPresetNode ListUIPresetNode UI预设节点列表
ListUgcCommodity ListUgcCommodity 道具列表
ListUgcGoods ListUgcGoods 商品列表
ListUnit ListUnit 单位列表
ListUnitGroup ListUnitGroup 物理组件组列表
ListUnitGroupKey ListUnitGroupKey 组件组编号列表
ListUnitID ListUnitID 单位ID列表
ListUnitKey ListUnitKey 单位编号列表
ListUnitType ListUnitType 单位类型列表
ListValueType ListValueType 值类型列表
ListVector3 ListVector3 向量列表
ListVehicle ListVehicle 载具列表
ListVehicleKey ListVehicleKey 单位编号(载具)列表
ListWindFieldShapeType ListWindFieldShapeType 风场形状列表
ModelSocket ModelSocket 部位
Modifier Modifier 效果
ModifierKey ModifierKey 效果编号
MontageKey MontageKey 剧情动画编号
MoveMode MoveMode AI移动模式
Obstacle Obstacle 组件
ObstacleID ObstacleID 组件ID
ObstacleKey ObstacleKey 组件编号
OrientationType OrientationType 方位枚举
PaintArea PaintArea 染色区域
PathID PathID 路径ID
PathPointID PathPointID 路点ID
PatrolType PatrolType AI巡逻类型
PlaneType PlaneType 拖动平面
ProgressBarStyleKey ProgressBarStyleKey 条形进度条样式编号
ProgressTimerStyleKey ProgressTimerStyleKey 环形进度条样式编号
Quaternion Quaternion 四元数
RigidBodyType RigidBodyType 物理类型
Role Role 玩家
RoleID RoleID 玩家ID
SfxID SfxID 特效ID
SfxKey SfxKey 特效编号
SheetID SheetID 表格
Skeleton Skeleton 骨骼
SkyBoxBackground SkyBoxBackground 天空盒背景
SkyBoxGradualType SkyBoxGradualType 天空盒渐变类型
Sound3DKey Sound3DKey 3D音效编号
SoundID SoundID 音效ID
SoundKey SoundKey 音效编号
Str Str 字符串
Timer Timer 计时器
Timestamp Timestamp 时间戳
Trigger Trigger 触发器
TriggerSpace TriggerSpace 逻辑体
TriggerSpaceEventType TriggerSpaceEventType 触发区域类型
TriggerSpaceID TriggerSpaceID 逻辑体ID
TriggerSpaceKey TriggerSpaceKey 逻辑体编号
UIPreset UIPreset UIPreset
UIPresetNode UIPresetNode UI预设节点
UgcCommodity UgcCommodity 道具
UgcGoods UgcGoods 商品
Unit Unit 单位
UnitGroup UnitGroup 物理组件组
UnitGroupKey UnitGroupKey 组件组编号
UnitID UnitID 单位ID
UnitKey UnitKey 单位编号
UnitType UnitType 单位类型
ValueType ValueType 值类型
Vector3 Vector3 向量
Vehicle Vehicle 载具
VehicleKey VehicleKey 单位编号(载具)
WindFieldShapeType WindFieldShapeType 风场形状
ArchiveType 存档类型
Bool Bool 布尔值
Fixed Fixed 定点数
Int Int 整型
SheetID SheetID 表格
Str Str 字符串
Timestamp Timestamp 时间戳
JointAssistantKey 关节预设编号
SPRING 3400000 SPRING
ROPE 3400001 ROPE
SLIDER 3400002 SLIDER
HINGE 3400003 HINGE
BALL_SOCKET 3400004 BALL_SOCKET
D6 3400005 D6
FIXED 3400006 FIXED
ModelSocket 部位
socket_abdomen socket_abdomen 腹部
socket_belly socket_belly 鱼腹
socket_body socket_body 身体
socket_calf_l socket_calf_l 左小腿
socket_calf_r socket_calf_r 右小腿
socket_chest socket_chest 胸部
socket_claw_l socket_claw_l 左钳
socket_claw_r socket_claw_r 右钳
socket_eye_l socket_eye_l 左眼
socket_eye_r socket_eye_r 右眼
socket_fin_back socket_fin_back 背后鳍
socket_fin_dorsal socket_fin_dorsal 背鳍
socket_fin_l socket_fin_l 左鳍
socket_fin_lb socket_fin_lb 左后鳍
socket_fin_r socket_fin_r 右鳍
socket_fin_rb socket_fin_rb 右后鳍
socket_fin_tail socket_fin_tail 尾鳍
socket_fin_ventral socket_fin_ventral 腹鳍
socket_fin_ventral_l socket_fin_ventral_l 左腹鳍
socket_fin_ventral_r socket_fin_ventral_r 右腹鳍
socket_foot_l socket_foot_l 左脚
socket_foot_lb socket_foot_lb 左后脚
socket_foot_lf socket_foot_lf 左前脚
socket_foot_lm socket_foot_lm 左中脚
socket_foot_r socket_foot_r 右脚
socket_foot_rb socket_foot_rb 右后脚
socket_foot_rf socket_foot_rf 右前脚
socket_foot_rm socket_foot_rm 右中脚
socket_forearm_l socket_forearm_l 左臂
socket_forearm_r socket_forearm_r 右臂
socket_hand_l socket_hand_l 左手
socket_hand_r socket_hand_r 右手
socket_head socket_head 头部
socket_lowerarm_l socket_lowerarm_l 左小臂
socket_lowerarm_r socket_lowerarm_r 右小臂
socket_lowerlimb_lb socket_lowerlimb_lb 左后下肢
socket_lowerlimb_lf socket_lowerlimb_lf 左前下肢
socket_lowerlimb_rb socket_lowerlimb_rb 右后下肢
socket_lowerlimb_rf socket_lowerlimb_rf 右前下肢
socket_mouth socket_mouth 鱼嘴
socket_origin socket_origin 底面中心点
socket_tail socket_tail 尾巴
socket_tail_end socket_tail_end 尾巴末端
socket_thigh_l socket_thigh_l 左大腿
socket_thigh_r socket_thigh_r 右大腿
socket_torso_b socket_torso_b 躯干后部
socket_torso_f socket_torso_f 躯干前部
socket_upperarm_l socket_upperarm_l 左大臂
socket_upperarm_r socket_upperarm_r 右大臂
socket_upperlimb_lb socket_upperlimb_lb 左后上肢
socket_upperlimb_lf socket_upperlimb_lf 左前上肢
socket_upperlimb_rb socket_upperlimb_rb 右后上肢
socket_upperlimb_rf socket_upperlimb_rf 右前上肢
socket_weapon_l socket_weapon_l 左手武器
socket_weapon_r socket_weapon_r 右手武器
ColorPaintAreaType 染色区域
AREA_1 1 染色区域1
AREA_2 2 染色区域2
AREA_3 3 染色区域3
AREA_4 4 染色区域4
LuaAPI
LuaAPI.ability_register_creation_handler
描述: 注册技能创建回调
LuaAPI.ability_register_creation_handler(_ability_key, _callback)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_ability_key | AbilityKey | 技能编号 |
_callback | Function | 回调 |
示例:
LuaAPI.ability_register_creation_handler(150001, function() end)LuaAPI.ability_unregister_creation_handler
描述: 注销技能创建回调
LuaAPI.ability_unregister_creation_handler(_ability_key)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_ability_key | AbilityKey | 技能编号 |
示例:
LuaAPI.ability_unregister_creation_handler(150001)LuaAPI.call_delay_frame
描述: 延迟调用函数(按帧数)
LuaAPI.call_delay_frame(_interval, _callback)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_interval | Int | 间隔帧数 |
_callback | Function | 回调 |
示例:
LuaAPI.call_delay_frame(1, function() end)LuaAPI.call_delay_time
描述: 延迟调用函数(按时间)
LuaAPI.call_delay_time(_interval, _callback)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_interval | Fixed | 间隔时间(秒) |
_callback | Function | 回调 |
示例:
LuaAPI.call_delay_time(1.0, function() end)LuaAPI.dispatch_flush
描述: 执行所有已添加并行任务
LuaAPI.dispatch_flush()示例:
LuaAPI.dispatch_flush()LuaAPI.dispatch_init
描述: 初始化并行数
LuaAPI.dispatch_init(_count)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_count | Int | 并行数 |
示例:
LuaAPI.dispatch_init(1)LuaAPI.dispatch_queue
描述: 添加并行任务
LuaAPI.dispatch_queue(_i, _name, _args)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_i | Int | 线程ID |
_name | Str | 函数名 |
_args | Dict | 参数 |
返回值:
- 类型:
Int - 说明: 任务ID
示例:
local task_id = LuaAPI.dispatch_queue(1, "batch_process_units", {
process_type = "damage_calc"
})LuaAPI.enable_developer_mode
描述: 启用开发者模式
LuaAPI.enable_developer_mode()返回值:
- 类型:
Bool - 说明: 是否启用成功
示例:
local result = LuaAPI.enable_developer_mode()LuaAPI.enable_error_interruption_mode
描述: 启用错误中断模式
LuaAPI.enable_error_interruption_mode(_enable)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_enable | Bool | 是否启用 |
示例:
LuaAPI.enable_error_interruption_mode(true)LuaAPI.get_component_list
描述: 获取子部件列表(慢)
LuaAPI.get_component_list(_obj)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_obj | Unit | 单位 |
返回值:
- 类型:
ListStr - 说明: 组件名称列表
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = LuaAPI.get_component_list(role)LuaAPI.get_current_unit
描述: 获取当前单位
LuaAPI.get_current_unit()返回值:
- 类型:
Unit - 说明: 当前单位
示例:
local result = LuaAPI.get_current_unit()LuaAPI.get_dispatch_count
描述: 获取并行数
LuaAPI.get_dispatch_count()返回值:
- 类型:
Int - 说明: 并行数
示例:
local result = LuaAPI.get_dispatch_count()LuaAPI.get_global_var
描述: 获取全局变量
LuaAPI.get_global_var(_var_name)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_var_name | Str | 变量名 |
返回值:
- 类型:
ETypeMeta - 说明: 变量
示例:
local result = LuaAPI.get_global_var("平凡蛋0")LuaAPI.get_unit_id
描述: 获得单位的ID
LuaAPI.get_unit_id(_unit)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_unit | Unit | 单位 |
返回值:
- 类型:
Int - 说明: 单位ID
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = LuaAPI.get_unit_id(role)LuaAPI.get_value_type
描述: 获取变量类型
LuaAPI.get_value_type(_value)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_value | ETypeMeta | 变量 |
返回值:
- 类型:
Str - 说明: 类型
示例:
local result = LuaAPI.get_value_type(nil --[[ETypeMeta]])LuaAPI.global_register_custom_event
描述: 注册全局自定义事件监听
LuaAPI.global_register_custom_event(_event_name, _callback)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_event_name | Str | 自定义事件名 |
_callback | Function | 回调 |
返回值:
- 类型:
Int - 说明: 注册ID
示例:
local result = LuaAPI.global_register_custom_event("平凡蛋0", function() end)LuaAPI.global_register_trigger_event
描述: 注册全局触发器
LuaAPI.global_register_trigger_event(_event_desc, _callback)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_event_desc | List | 事件名及注册参数 |
_callback | Function | 回调 |
返回值:
- 类型:
Int - 说明: 注册ID
示例:
local result = LuaAPI.global_register_trigger_event({}, function() end)LuaAPI.global_send_custom_event
描述: 发送全局自定义事件
LuaAPI.global_send_custom_event(_event_name, _data)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_event_name | Str | 自定义事件名 |
_data | Dict | 附带参数 |
示例:
LuaAPI.global_send_custom_event("player_joined", {
player_id = 10001,
player_name = "蛋仔玩家",
team_id = 1,
join_time = os.time()
})LuaAPI.global_unregister_custom_event
描述: 注销全局自定义事件监听
LuaAPI.global_unregister_custom_event(_id)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_id | Int | 注册ID |
示例:
LuaAPI.global_unregister_custom_event(1)LuaAPI.global_unregister_trigger_event
描述: 注销全局触发器
LuaAPI.global_unregister_trigger_event(_id)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_id | Int | 注册ID |
示例:
LuaAPI.global_unregister_trigger_event(1)LuaAPI.has_component
描述: 是否含有指定子部件
LuaAPI.has_component(_object, _name)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_object | Unit | 单位 |
_name | Str | 组件名 |
返回值:
- 类型:
Bool - 说明: 是否含有指定子组件
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = LuaAPI.has_component(role, "平凡蛋0")LuaAPI.log
描述: 输出日志(Lua)
LuaAPI.log(_content, _log_level)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_content | Str | 日志内容 |
_log_level | Int | 日志级别 |
示例:
LuaAPI.log("示例内容", 1)LuaAPI.modifier_register_creation_handler
描述: 注册效果创建回调
LuaAPI.modifier_register_creation_handler(_modifier_key, _callback)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_modifier_key | ModifierKey | 效果编号 |
_callback | Function | 回调 |
示例:
LuaAPI.modifier_register_creation_handler(600001, function() end)LuaAPI.modifier_unregister_creation_handler
描述: 注销效果创建回调
LuaAPI.modifier_unregister_creation_handler(_modifier_key)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_modifier_key | ModifierKey | 效果编号 |
示例:
LuaAPI.modifier_unregister_creation_handler(600001)LuaAPI.query_ui_node
描述: 查询UI单位(慢)
LuaAPI.query_ui_node(_name)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_name | Str | 名字 |
返回值:
- 类型:
ENode - 说明: UI名称
示例:
local result = LuaAPI.query_ui_node("平凡蛋0")LuaAPI.query_ui_nodes
描述: 批量查询UI单位(慢)
LuaAPI.query_ui_nodes(_name_list)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_name_list | ListStr | 名字列表 |
返回值:
- 类型:
ListENode - 说明: UI名称列表
示例:
local result = LuaAPI.query_ui_nodes({"平凡蛋0", "平凡蛋1"})LuaAPI.query_unit
描述: 查询组件单位(慢)
LuaAPI.query_unit(_name)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_name | Str | 名字 |
返回值:
- 类型:
Unit - 说明: 组件
示例:
local result = LuaAPI.query_unit("平凡蛋0")LuaAPI.query_units
描述: 批量查询单位(按名称)
LuaAPI.query_units(_name_list)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_name_list | ListStr | 名字列表 |
返回值:
- 类型:
ListUnit - 说明: 组件列表
示例:
local result = LuaAPI.query_units({"平凡蛋0", "平凡蛋1"})LuaAPI.query_units_by_type
描述: 批量查询单位(按类型、预设)
LuaAPI.query_units_by_type(_unit_type, _unit_eid)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_unit_type | UnitType | 单位类型 |
_unit_eid | Int | 预设ID |
返回值:
- 类型:
ListUnit - 说明: 组件
示例:
local result = LuaAPI.query_units_by_type(Enums.UnitType.CHARACTER, 1)LuaAPI.rand
描述: 生成随机数
LuaAPI.rand()返回值:
- 类型:
Int - 说明: 随机数
示例:
local result = LuaAPI.rand()LuaAPI.set_deadloop_check_enabled
描述: 启用死循环检测
LuaAPI.set_deadloop_check_enabled(_enable, _max_instruction_count)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_enable | Bool | 启用 |
_max_instruction_count | Int | 最大指令数限制 |
返回值:
- 类型:
Bool - 说明: 是否启用成功
示例:
local result = LuaAPI.set_deadloop_check_enabled(true, 1)LuaAPI.set_tick_handler
描述: 设置帧前帧后回调
LuaAPI.set_tick_handler(_pre_handler, _post_handler)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_pre_handler | Function | 帧前回调 |
_post_handler | Function | 帧后回调 |
示例:
LuaAPI.set_tick_handler(function() end, function() end)LuaAPI.unit_register_creation_handler
描述: 注册单位创建回调
LuaAPI.unit_register_creation_handler(_unit_type, _unit_eid, _callback)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_unit_type | UnitType | 单位类型 |
_unit_eid | Int | 预设ID |
_callback | Function | 回调 |
示例:
LuaAPI.unit_register_creation_handler(Enums.UnitType.CHARACTER, 1, function() end)LuaAPI.unit_register_custom_event
描述: 注册单位自定义事件监听
LuaAPI.unit_register_custom_event(_unit, _event_name, _callback)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_unit | Unit | 单位 |
_event_name | Str | 自定义事件名 |
_callback | Function | 回调 |
返回值:
- 类型:
Int - 说明: 注册ID
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = LuaAPI.unit_register_custom_event(role, "平凡蛋0", function() end)LuaAPI.unit_register_trigger_event
描述: 注册单位触发器
LuaAPI.unit_register_trigger_event(_unit, _event_desc, _callback)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_unit | Unit | 单位 |
_event_desc | List | 事件名及注册参数 |
_callback | Function | 回调 |
返回值:
- 类型:
Int - 说明: 触发器ID
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = LuaAPI.unit_register_trigger_event(role, {}, function() end)LuaAPI.unit_send_custom_event
描述: 发送单位自定义事件
LuaAPI.unit_send_custom_event(_unit, _event_name, _data)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_unit | Unit | 单位 |
_event_name | Str | 自定义事件名 |
_data | Dict | 附带参数 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
LuaAPI.unit_send_custom_event(role, "use_item", {
item_id = 1001,
item_count = 1,
target_pos = {x = 100, y = 0, z = 200}
})LuaAPI.unit_unregister_creation_handler
描述: 注销单位创建回调
LuaAPI.unit_unregister_creation_handler(_unit_type, _unit_eid)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_unit_type | UnitType | 单位类型 |
_unit_eid | Int | 预设ID |
示例:
LuaAPI.unit_unregister_creation_handler(Enums.UnitType.CHARACTER, 1)LuaAPI.unit_unregister_custom_event
描述: 注销单位自定义事件监听
LuaAPI.unit_unregister_custom_event(_unit, _id)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_unit | Unit | 单位 |
_id | Int | 注册ID |
示例:
local role = GameAPI.get_all_valid_roles()[1]
LuaAPI.unit_unregister_custom_event(role, 1)LuaAPI.unit_unregister_trigger_event
描述: 注销单位触发器
LuaAPI.unit_unregister_trigger_event(_unit, _id)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_unit | Unit | 单位 |
_id | Int | 注册ID |
示例:
local role = GameAPI.get_all_valid_roles()[1]
LuaAPI.unit_unregister_trigger_event(role, 1)GlobalAPI
GlobalAPI.add_kill_broadcast
描述: 添加击杀播报
GlobalAPI.add_kill_broadcast(_kill_char, _dead_char, _duration)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_kill_char | Character | 击杀角色 |
_dead_char | Character | 死亡角色 |
_duration | Fixed | 持续时间 |
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- Character 继承自 LifeEntity,代表NPC角色单位
GlobalAPI.add_kill_broadcast(npc, nil --[[Character]], 1.0)GlobalAPI.set_render_color
描述: 改变色彩滤镜
GlobalAPI.set_render_color(_hue, _brightness, _saturation, _contrast, _amount, _mid_tones, _mid_tones_power, _shadows, _shadows_power, _highlight, _highlight_power, _duration)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_hue | Fixed | 色相 |
_brightness | Fixed | 明度 |
_saturation | Fixed | 饱和度 |
_contrast | Fixed | 对比度 |
_amount | Fixed | 整体偏色程度 |
_mid_tones | Color | 中灰偏色 |
_mid_tones_power | Fixed | 中灰偏色程度 |
_shadows | Color | 暗部偏色 |
_shadows_power | Fixed | 暗部偏色程度 |
_highlight | Color | 亮部偏色 |
_highlight_power | Fixed | 亮部偏色程度 |
_duration | Fixed | 变换时长 |
示例:
GlobalAPI.set_render_color(1.0, 1.0, 1.0, 1.0, 1.0, math.Color(1, 0, 0, 1), 1.0, math.Color(1, 0, 0, 1), 1.0, math.Color(1, 0, 0, 1), 1.0, 1.0)GlobalAPI.debug
描述: Debug窗口打印日志
GlobalAPI.debug(_content)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_content | Str | 内容 |
示例:
GlobalAPI.debug("示例内容")GlobalAPI.destroy_sfx
描述: 销毁特效
GlobalAPI.destroy_sfx(_sfx_id, _fade_out)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_sfx_id | SfxID | 特效ID |
_fade_out | Bool | 是否淡出 |
示例:
local sfx_id = GameAPI.play_sfx_by_key(700001, math.Vector3(0,0,0), math.Quaternion(0,0,0), 1.0, 1.0, 1.0, true)
GlobalAPI.destroy_sfx(sfx_id, true)GlobalAPI.error
描述: Debug窗口打印错误日志
GlobalAPI.error(_content)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_content | Str | 内容 |
示例:
GlobalAPI.error("示例内容")GlobalAPI.get_point_to_line_perpendicular_point
描述: 获取点到直线的垂线交点
GlobalAPI.get_point_to_line_perpendicular_point(_point_1, _point_2, _point_3)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_point_1 | Vector3 | 点1 |
_point_2 | Vector3 | 点2 |
_point_3 | Vector3 | 点3 |
返回值:
- 类型:
Vector3 - 说明: 交点坐标
示例:
local result = GlobalAPI.get_point_to_line_perpendicular_point(math.Vector3(0, 0, 0), math.Vector3(0, 0, 0), math.Vector3(0, 0, 0))GlobalAPI.get_lines_intersection_point_on_plane
描述: 获取两条直线在指定平面的交点
GlobalAPI.get_lines_intersection_point_on_plane(_point_1, _point_2, _point_3, _point_4, _value, _plane_type)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_point_1 | Vector3 | 点1 |
_point_2 | Vector3 | 点2 |
_point_3 | Vector3 | 点3 |
_point_4 | Vector3 | 点4 |
_value | Fixed | 校正值 |
_plane_type | PlaneType | 平面 |
返回值:
- 类型:
Vector3 - 说明: 交点坐标
示例:
local result = GlobalAPI.get_lines_intersection_point_on_plane(math.Vector3(0, 0, 0), math.Vector3(0, 0, 0), math.Vector3(0, 0, 0), math.Vector3(0, 0, 0), 1.0, Enums.PlaneType.XZ)GlobalAPI.get_vector_projection
描述: 获取向量投影
GlobalAPI.get_vector_projection(_vec, _direction)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_vec | Vector3 | 向量 |
_direction | Vector3 | 投影方向 |
返回值:
- 类型:
Vector3 - 说明: 投影后向量
示例:
local result = GlobalAPI.get_vector_projection(math.Vector3(0, 0, 0), math.Vector3(0, 0, 0))GlobalAPI.str_contains
描述: 是否含有子字符串
GlobalAPI.str_contains(_str1, _str2)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_str1 | Str | 父字符串 |
_str2 | Str | 子字符串 |
返回值:
- 类型:
Bool - 说明: 布尔值
示例:
local result = GlobalAPI.str_contains("示例字符串", "示例字符串")GlobalAPI.is_none
描述: 判断对象是否为空
GlobalAPI.is_none(_obj)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_obj | Unit | 对象 |
返回值:
- 类型:
Bool - 说明: 是否为空
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = GlobalAPI.is_none(role)GlobalAPI.is_not_none
描述: 判断对象是否为空
GlobalAPI.is_not_none(_obj)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_obj | Unit | 对象 |
返回值:
- 类型:
Bool - 说明: 是否不为空
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = GlobalAPI.is_not_none(role)GlobalAPI.mute_sfx_sound
描述: 去除特效的音效
GlobalAPI.mute_sfx_sound(_sfx_id)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_sfx_id | SfxID | 特效ID |
示例:
local sfx_id = GameAPI.play_sfx_by_key(700001, math.Vector3(0,0,0), math.Quaternion(0,0,0), 1.0, 1.0, 1.0, true)
GlobalAPI.mute_sfx_sound(sfx_id)GlobalAPI.set_sfx_orientation
描述: 设置特效旋转
GlobalAPI.set_sfx_orientation(_sfx_id, _orientation)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_sfx_id | SfxID | 特效ID |
_orientation | Quaternion | 旋转 |
示例:
local sfx_id = GameAPI.play_sfx_by_key(700001, math.Vector3(0,0,0), math.Quaternion(0,0,0), 1.0, 1.0, 1.0, true)
GlobalAPI.set_sfx_orientation(sfx_id, math.Quaternion(0, 0, 0))GlobalAPI.set_sfx_position
描述: 设置特效坐标
GlobalAPI.set_sfx_position(_sfx_id, _pos)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_sfx_id | SfxID | 特效ID |
_pos | Vector3 | 位置 |
示例:
local sfx_id = GameAPI.play_sfx_by_key(700001, math.Vector3(0,0,0), math.Quaternion(0,0,0), 1.0, 1.0, 1.0, true)
GlobalAPI.set_sfx_position(sfx_id, math.Vector3(0, 0, 0))GlobalAPI.set_sfx_rate
描述: 设置特效播放速率
GlobalAPI.set_sfx_rate(_sfx_id, _rate)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_sfx_id | SfxID | 特效ID |
_rate | Fixed | 播放速率 |
示例:
local sfx_id = GameAPI.play_sfx_by_key(700001, math.Vector3(0,0,0), math.Quaternion(0,0,0), 1.0, 1.0, 1.0, true)
GlobalAPI.set_sfx_rate(sfx_id, 1.0)GlobalAPI.set_sfx_scale
描述: 设置特效缩放
GlobalAPI.set_sfx_scale(_sfx_id, _scale)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_sfx_id | SfxID | 特效ID |
_scale | Vector3 | 缩放 |
示例:
local sfx_id = GameAPI.play_sfx_by_key(700001, math.Vector3(0,0,0), math.Quaternion(0,0,0), 1.0, 1.0, 1.0, true)
GlobalAPI.set_sfx_scale(sfx_id, math.Vector3(0, 0, 0))GlobalAPI.set_sfx_visible
描述: 设置特效是否可见
GlobalAPI.set_sfx_visible(_sfx_id, _visible)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_sfx_id | SfxID | 特效ID |
_visible | Bool | 是否可见 |
示例:
local sfx_id = GameAPI.play_sfx_by_key(700001, math.Vector3(0,0,0), math.Quaternion(0,0,0), 1.0, 1.0, 1.0, true)
GlobalAPI.set_sfx_visible(sfx_id, true)GlobalAPI.show_message_marquee
描述: 跑马灯信息
GlobalAPI.show_message_marquee(_content)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_content | Str | 字符串 |
示例:
GlobalAPI.show_message_marquee("示例内容")GlobalAPI.warning
描述: Debug窗口打印警告日志
GlobalAPI.warning(_content)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_content | Str | 内容 |
示例:
GlobalAPI.warning("示例内容")GlobalAPI.set_direct_light
描述: 修改直接光参数
GlobalAPI.set_direct_light(_param_dict, _duration)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_param_dict | Dict | 切换参数 |
_duration | Fixed | 持续时间 |
示例:
GlobalAPI.set_direct_light({
-- 直接光参数
intensity = 2.0, -- 光照强度
color = {r = 255, g = 240, b = 200}, -- 光照颜色(RGB)
pitch = 45.0, -- 俯仰角(太阳高度角)
yaw = 135.0, -- 偏航角(太阳方向角)
-- 环境光参数
env_light_intensity = 0.8, -- 环境光强度
env_light_color = {r = 200, g = 200, b = 220}, -- 环境光颜色(RGB)
-- Bloom效果参数
skylight_bloom_cube = 1, -- Bloom立方体
skylight_bloom_exposure_scale = 1.0, -- 曝光缩放
skylight_bloom_threshold = 0.8, -- Bloom阈值
skylight_bloom_intensity = 0.5, -- Bloom强度
skylight_bloom_width = 0.3 -- Bloom宽度
}, 2.0)GlobalAPI.set_skybox_texture
描述: 改变天空盒贴图
GlobalAPI.set_skybox_texture(_texture_key, _change_type, _duration)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_texture_key | SkyBoxBackground | 天空盒背景 |
_change_type | SkyBoxGradualType | 切换方式 |
_duration | Fixed | 持续时间 |
示例:
GlobalAPI.set_skybox_texture(Enums.SkyBoxBackground.DEFAULT, Enums.SkyBoxGradualType.DEFAULT, 1.0)GlobalAPI.set_skyfog
描述: 改变天空雾效
GlobalAPI.set_skyfog(_param_dict, _duration)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_param_dict | Dict | 切换参数 |
_duration | Fixed | 变换时长 |
示例:
GlobalAPI.set_skyfog({
-- 大气雾参数
atmosphericfog_color = {r = 200, g = 220, b = 255}, -- 大气雾颜色(RGB)
atmosphericfog_intensity = 1.0, -- 大气雾亮度
atmosphericfog_density = 0.5, -- 大气雾浓度
atmosphericfog_visibility = 1000.0, -- 大气雾可见度
-- 高度雾参数
heightfog_color = {r = 180, g = 200, b = 230}, -- 高度雾颜色(RGB)
heightfog_density = 0.3, -- 高度雾浓度
heightfog_attenuation_begin_height = 50.0, -- 高度雾衰减起始高度
heightfog_disappearance_height = 200.0, -- 高度雾消失高度
-- 散射参数
skyfog_scatter_color = {r = 255, g = 240, b = 220}, -- 散射颜色(RGB)
skyfog_scatter_exponent = 2.0, -- 散射指数
skyfog_scatter_start_dis = 100.0, -- 散射起始距离
skyfog_affect_skybox = true -- 是否影响天空盒
}, 2.0)GlobalAPI.show_tips
描述: 游戏内飘字信息
GlobalAPI.show_tips(_content, _duration)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_content | Str | 字符串 |
_duration | Fixed | 时长 |
示例:
GlobalAPI.show_tips("示例内容", 1.0)GameAPI
GameAPI.add_pathpoint
描述: 为游戏全局添加路点(路径)
GameAPI.add_pathpoint(_path_id, _index, _point_id)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_path_id | PathID | 路径 |
_index | Int | 路点索引 |
_point_id | PathPointID | 路点 |
示例:
local path_id = 10001
GameAPI.add_pathpoint(path_id, 1, 20001)GameAPI.deal_damage
描述: 造成伤害
GameAPI.deal_damage(_dst, _dmg, _src, _schema, _data)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_dst | LifeEntity | 目标单位 |
_dmg | Fixed | 伤害 |
_src | Unit | 伤害来源 |
_schema | DamageSchema | 伤害类型 |
_data | Dict | 参数 |
示例:
GameAPI.deal_damage(npc, 200.0, role, schema, {
show_damage_tips = true,
is_critical = true, -- 是否暴击(自定义参数)
skill_id = 1001, -- 技能ID(自定义参数)
damage_tag = "fire" -- 伤害标签(自定义参数)
})GameAPI.destroy_unit_with_children
描述: 销毁单位,可选是否销毁子组件
GameAPI.destroy_unit_with_children(_unit, _destroy_children)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_unit | Unit | 单位 |
_destroy_children | Bool | 是否销毁子组件 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
GameAPI.destroy_unit_with_children(role, true)GameAPI.clear_sheet
描述: 清空表
GameAPI.clear_sheet(_sheet_id)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_sheet_id | SheetID | 表格 |
示例:
local sheet = GameAPI.create_sheet()
GameAPI.clear_sheet(sheet)GameAPI.add_sheet_column
描述: 表添加列
GameAPI.add_sheet_column(_sheet_id, _key, _type_name)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_sheet_id | SheetID | 表格 |
_key | Str | 列名 |
_type_name | Str | 类型 |
示例:
local sheet = GameAPI.create_sheet()
GameAPI.add_sheet_column(sheet, "key_001", "平凡蛋0")GameAPI.copy_sheet
描述: 复制表
GameAPI.copy_sheet(_sheet_id)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_sheet_id | SheetID | 表格 |
返回值:
- 类型:
SheetID - 说明: 表格
示例:
local sheet = GameAPI.create_sheet()
local result = GameAPI.copy_sheet(sheet)GameAPI.copy_vehicle
描述: 复制载具
GameAPI.copy_vehicle(_vehicle, _pos, _direction, _role)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_vehicle | Vehicle | 载具 |
_pos | Point3 | 位置 |
_direction | Point3 | 朝向 |
_role | Role | 所属玩家 |
返回值:
- 类型:
Vehicle - 说明: 创建出的载具
示例:
local vehicle = GameAPI.create_vehicle(500001, math.Vector3(0,0,0), math.Vector3(0,0,1), nil)
local role = GameAPI.get_all_valid_roles()[1]
local result = GameAPI.copy_vehicle(vehicle, math.Vector3(0, 0, 0), math.Vector3(0, 0, 0), role)GameAPI.create_sheet
描述: 创建表
GameAPI.create_sheet()返回值:
- 类型:
SheetID - 说明: 表格
示例:
local result = GameAPI.create_sheet()GameAPI.create_constant_wind_field
描述: 创建一个固定风场单位
GameAPI.create_constant_wind_field(_pos, _wind_type, _wind_range, _duration)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_pos | Point3 | 位置 |
_wind_type | WindFieldShapeType | 形状 |
_wind_range | Fixed | 范围 |
_duration | Fixed | 持续时间 |
示例:
GameAPI.create_constant_wind_field(math.Vector3(0, 0, 0), Enums.WindFieldShapeType.BOX, 1.0, 1.0)GameAPI.create_creature_fixed_scale
描述: 创建一个生物
GameAPI.create_creature_fixed_scale(_u_key, _pos, _rotation, _scale_ratio, _role)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_u_key | UnitKey | 单位编号 |
_pos | Point3 | 位置 |
_rotation | Quaternion | 旋转 |
_scale_ratio | Fixed | 缩放大小 |
_role | Role | 所属玩家 |
返回值:
- 类型:
Creature - 说明: 创建出的生物
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = GameAPI.create_creature_fixed_scale(100001, math.Vector3(0, 0, 0), math.Quaternion(0, 0, 0), 1.0, role)GameAPI.create_customtriggerspace
描述: 创建一个触发区域
GameAPI.create_customtriggerspace(_u_key, _pos, _rotation, _scale, _role)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_u_key | CustomTriggerSpaceKey | 触发区域编号 |
_pos | Vector3 | 位置 |
_rotation | Quaternion | 旋转 |
_scale | Vector3 | 缩放 |
_role | Role | 所属玩家 |
返回值:
- 类型:
CustomTriggerSpace - 说明: 创建出的触发区域
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = GameAPI.create_customtriggerspace(110001, math.Vector3(0, 0, 0), math.Quaternion(0, 0, 0), math.Vector3(0, 0, 0), role)GameAPI.create_decoration
描述: 创建一个装饰物
GameAPI.create_decoration(_u_key, _pos, _rotation, _scale, _parent)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_u_key | DecorationKey | 单位编号 |
_pos | Vector3 | 位置 |
_rotation | Quaternion | 旋转 |
_scale | Vector3 | 缩放 |
_parent | Unit | 绑定对象 |
返回值:
- 类型:
Decoration - 说明: 创建的装饰物
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = GameAPI.create_decoration(300001, math.Vector3(0, 0, 0), math.Quaternion(0, 0, 0), math.Vector3(0, 0, 0), role)GameAPI.create_equipment
描述: 创建物品到坐标点
GameAPI.create_equipment(_equipment_eid, _pos)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_equipment_eid | EquipmentKey | 物品编号 |
_pos | Point3 | 位置 |
返回值:
- 类型:
Equipment - 说明: 物品
示例:
local result = GameAPI.create_equipment(400001, math.Vector3(0, 0, 0))GameAPI.create_scene_ui_at_point
描述: 创建场景界面到坐标点
GameAPI.create_scene_ui_at_point(_layer_key, _pos, _duration)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_layer_key | E3DLayerKey | 场景界面预设编号 |
_pos | Point3 | 坐标点 |
_duration | Fixed | 持续事件 |
返回值:
- 类型:
E3DLayer - 说明: 场景界面
示例:
local result = GameAPI.create_scene_ui_at_point(120001, math.Vector3(0, 0, 0), 1.0)GameAPI.create_eui_ability_at_position
描述: 创建技能控件
GameAPI.create_eui_ability_at_position(_ability_style_key, _parent, _x, _y, _width, _height, _show_when_empty, _show_name, _name)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_ability_style_key | AbilityStyleKey | 技能预设编号 |
_parent | ENode | 父节点 |
_x | Fixed | X |
_y | Fixed | Y |
_width | Fixed | 宽 |
_height | Fixed | 高 |
_show_when_empty | Bool | 未关联技能时显示 |
_show_name | Bool | 显示技能名称 |
_name | Str | 名称 |
返回值:
- 类型:
EButton - 说明: 技能控件
示例:
local node = LuaAPI.query_ui_node(role, "panel_main")
local result = GameAPI.create_eui_ability_at_position(230001, parent, 1.0, 1.0, 1.0, 1.0, true, true, "平凡蛋0")GameAPI.create_eui_effect_at_position
描述: 创建动效节点
GameAPI.create_eui_effect_at_position(_animation_style_key, _parent, _x, _y, _width, _height, _is_loop, _name)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_animation_style_key | AnimationStyleKey | 动效预设编号 |
_parent | ENode | 父节点 |
_x | Fixed | X |
_y | Fixed | Y |
_width | Fixed | 宽 |
_height | Fixed | 高 |
_is_loop | Bool | 循环播放 |
_name | Str | 名称 |
返回值:
- 类型:
EEffectNode - 说明: 动效节点
示例:
local node = LuaAPI.query_ui_node(role, "panel_main")
local result = GameAPI.create_eui_effect_at_position(230001, parent, 1.0, 1.0, 1.0, 1.0, true, "平凡蛋0")GameAPI.create_eui_bagslot_at_position
描述: 创建物品格控件
GameAPI.create_eui_bagslot_at_position(_parent, _x, _y, _width, _height, _bag_slot_style_key, _name)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_parent | ENode | 父节点 |
_x | Fixed | X |
_y | Fixed | Y |
_width | Fixed | 宽 |
_height | Fixed | 高 |
_bag_slot_style_key | BagSlotStyleKey | 物品格预设编号 |
_name | Str | 名称 |
返回值:
- 类型:
EBagSlot - 说明: 物品格控件
示例:
local node = LuaAPI.query_ui_node(role, "panel_main")
local result = GameAPI.create_eui_bagslot_at_position(parent, 1.0, 1.0, 1.0, 1.0, 240001, "平凡蛋0")GameAPI.create_eui_button_at_position
描述: 创建按钮节点
GameAPI.create_eui_button_at_position(_btn_style_key, _parent, _x, _y, _width, _height, _name)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_btn_style_key | BtnStyleKey | 按钮预设编号 |
_parent | ENode | 父节点 |
_x | Fixed | X |
_y | Fixed | Y |
_width | Fixed | 宽 |
_height | Fixed | 高 |
_name | Str | 名称 |
返回值:
- 类型:
ENode - 说明: 按钮节点
示例:
local node = LuaAPI.query_ui_node(role, "panel_main")
local result = GameAPI.create_eui_button_at_position(160001, parent, 1.0, 1.0, 1.0, 1.0, "平凡蛋0")GameAPI.create_eui_clipping_at_position
描述: 创建遮罩节点
GameAPI.create_eui_clipping_at_position(_parent, _x, _y, _width, _height, _name, _clipping_path)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_parent | ENode | 父节点 |
_x | Fixed | X |
_y | Fixed | Y |
_width | Fixed | 宽 |
_height | Fixed | 高 |
_name | Str | 名称 |
_clipping_path | ImageKey | 蒙版图片ID |
返回值:
- 类型:
ENode - 说明: 遮罩节点
示例:
local node = LuaAPI.query_ui_node(role, "panel_main")
local result = GameAPI.create_eui_clipping_at_position(parent, 1.0, 1.0, 1.0, 1.0, "平凡蛋0", 170001)GameAPI.create_eui_image_at_position
描述: 创建图片节点
GameAPI.create_eui_image_at_position(_image_key, _parent, _x, _y, _width, _height, _name)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_image_key | ImageKey | 图片预设编号 |
_parent | ENode | 父节点 |
_x | Fixed | X |
_y | Fixed | Y |
_width | Fixed | 宽 |
_height | Fixed | 高 |
_name | Str | 名称 |
返回值:
- 类型:
EImage - 说明: 图片节点
示例:
local node = LuaAPI.query_ui_node(role, "panel_main")
local result = GameAPI.create_eui_image_at_position(170001, parent, 1.0, 1.0, 1.0, 1.0, "平凡蛋0")GameAPI.create_eui_input_at_position
描述: 创建输入框节点
GameAPI.create_eui_input_at_position(_input_style_key, _parent, _x, _y, _width, _height, _name, _text)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_input_style_key | InputStyleKey | 输入框预设编号 |
_parent | ENode | 父节点 |
_x | Fixed | X |
_y | Fixed | Y |
_width | Fixed | 宽 |
_height | Fixed | 高 |
_name | Str | 名称 |
_text | Str | 默认文本 |
返回值:
- 类型:
ENode - 说明: 输入框节点
示例:
local node = LuaAPI.query_ui_node(role, "panel_main")
local result = GameAPI.create_eui_input_at_position(190001, parent, 1.0, 1.0, 1.0, 1.0, "平凡蛋0", "示例文本")GameAPI.create_eui_label_at_position
描述: 创建文本节点
GameAPI.create_eui_label_at_position(_label_style_key, _parent, _x, _y, _width, _height, _name, _text)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_label_style_key | LabelStyleKey | 文本预设编号 |
_parent | ENode | 父节点 |
_x | Fixed | X |
_y | Fixed | Y |
_width | Fixed | 宽 |
_height | Fixed | 高 |
_name | Str | 名称 |
_text | Str | 文本内容 |
返回值:
- 类型:
ENode - 说明: 文本节点
示例:
local node = LuaAPI.query_ui_node(role, "panel_main")
local result = GameAPI.create_eui_label_at_position(180001, parent, 1.0, 1.0, 1.0, 1.0, "平凡蛋0", "示例文本")GameAPI.create_eui_listview_at_position
描述: 创建列表节点
GameAPI.create_eui_listview_at_position(_parent, _x, _y, _width, _height, _name)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_parent | ENode | 父节点 |
_x | Fixed | X |
_y | Fixed | Y |
_width | Fixed | 宽 |
_height | Fixed | 高 |
_name | Str | 名称 |
返回值:
- 类型:
ENode - 说明: 列表节点
示例:
local node = LuaAPI.query_ui_node(role, "panel_main")
local result = GameAPI.create_eui_listview_at_position(parent, 1.0, 1.0, 1.0, 1.0, "平凡蛋0")GameAPI.create_eui_progresstimer_at_position
描述: 创建环形进度条节点
GameAPI.create_eui_progresstimer_at_position(_progress_timer_style_key, _parent, _x, _y, _width, _height, _name)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_progress_timer_style_key | ProgressTimerStyleKey | 环形进度条预设编号 |
_parent | ENode | 父节点 |
_x | Fixed | X |
_y | Fixed | Y |
_width | Fixed | 宽 |
_height | Fixed | 高 |
_name | Str | 名称 |
返回值:
- 类型:
ENode - 说明: 环形进度条节点
示例:
local node = LuaAPI.query_ui_node(role, "panel_main")
local result = GameAPI.create_eui_progresstimer_at_position(220001, parent, 1.0, 1.0, 1.0, 1.0, "平凡蛋0")GameAPI.create_eui_progress_at_position
描述: 创建条形进度条节点
GameAPI.create_eui_progress_at_position(_progress_bar_style_key, _parent, _x, _y, _width, _height, _name)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_progress_bar_style_key | ProgressBarStyleKey | 条形进度条预设编号 |
_parent | ENode | 父节点 |
_x | Fixed | X |
_y | Fixed | Y |
_width | Fixed | 宽 |
_height | Fixed | 高 |
_name | Str | 名称 |
返回值:
- 类型:
ENode - 说明: 进度条节点
示例:
local node = LuaAPI.query_ui_node(role, "panel_main")
local result = GameAPI.create_eui_progress_at_position(210001, parent, 1.0, 1.0, 1.0, 1.0, "平凡蛋0")GameAPI.create_joint_assistant
描述: 创建关节助手
GameAPI.create_joint_assistant(_unit_key, _unit1, _unit2)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_unit_key | JointAssistantKey | 关节助手类型 |
_unit1 | Unit | 连接主体 |
_unit2 | Unit | 连接目标 |
返回值:
- 类型:
JointAssistant - 说明: 创建出的关节助手
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = GameAPI.create_joint_assistant(Enums.JointAssistantKey.FIXED, role, nil --[[Unit]])GameAPI.create_life_entity
描述: 创建一个生命体
GameAPI.create_life_entity(_unit_key, _pos, _rotation, _scale_ratio, _role)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_unit_key | UnitKey | 单位编号 |
_pos | Point3 | 位置 |
_rotation | Quaternion | 旋转 |
_scale_ratio | Fixed | 缩放大小 |
_role | Role | 所属玩家 |
返回值:
- 类型:
LifeEntity - 说明: 创建出的生命体
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = GameAPI.create_life_entity(100001, math.Vector3(0, 0, 0), math.Quaternion(0, 0, 0), 1.0, role)GameAPI.create_obstacle
描述: 创建一个组件
GameAPI.create_obstacle(_u_key, _pos, _rotation, _scale, _role)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_u_key | UnitKey | 组件编号 |
_pos | Vector3 | 位置 |
_rotation | Quaternion | 旋转 |
_scale | Vector3 | 缩放 |
_role | Role | 所属玩家 |
返回值:
- 类型:
Obstacle - 说明: 创建的组件
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = GameAPI.create_obstacle(100001, math.Vector3(0, 0, 0), math.Quaternion(0, 0, 0), math.Vector3(0, 0, 0), role)GameAPI.create_obstacle_with_anim
描述: 带动效创建组件
GameAPI.create_obstacle_with_anim(_anim_type, _u_key, _pos, _duration, _intensity, _role, _rotation, _scale)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_anim_type | Int | 动效类型 |
_u_key | ObstacleKey | 组件编号 |
_pos | Point3 | 创建坐标 |
_duration | Fixed | 动画时长 |
_intensity | Fixed | 效果系数 |
_role | Role | 所属玩家 |
_rotation | Quaternion | 旋转 |
_scale | Vector3 | 缩放 |
返回值:
- 类型:
Obstacle - 说明: 创建出的组件
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = GameAPI.create_obstacle_with_anim(1, 200001, math.Vector3(0, 0, 0), 1.0, 1.0, role, math.Quaternion(0, 0, 0), math.Vector3(0, 0, 0))GameAPI.create_sfx_with_socket
描述: 播放特效并绑定
GameAPI.create_sfx_with_socket(_sfx_key, _unit, _socket_name, _scale, _duration, _bind_type)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_sfx_key | SfxKey | 特效编号 |
_unit | Unit | 起点单位 |
_socket_name | ModelSocket | 起点节点 |
_scale | Fixed | 缩放 |
_duration | Fixed | 持续时间 |
_bind_type | BindType | 绑定方式 |
返回值:
- 类型:
SfxID - 说明: 特效ID
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = GameAPI.create_sfx_with_socket(700001, role, Enums.ModelSocket.socket_root, 1.0, 1.0, Enums.BindType.POSITION)GameAPI.create_sfx_with_socket_offset
描述: 播放特效并绑定
GameAPI.create_sfx_with_socket_offset(_sfx_key, _unit, _socket_name, _offset, _rot, _scale, _duration, _bind_type)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_sfx_key | SfxKey | 特效编号 |
_unit | Unit | 起点单位 |
_socket_name | ModelSocket | 起点节点 |
_offset | Vector3 | 偏移 |
_rot | Quaternion | 旋转 |
_scale | Fixed | 缩放 |
_duration | Fixed | 持续时间 |
_bind_type | BindType | 绑定方式 |
返回值:
- 类型:
SfxID - 说明: 特效ID
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = GameAPI.create_sfx_with_socket_offset(700001, role, Enums.ModelSocket.socket_root, math.Vector3(0, 0, 0), math.Quaternion(0, 0, 0), 1.0, 1.0, Enums.BindType.POSITION)GameAPI.create_triggerspace
描述: 创建一个逻辑体
GameAPI.create_triggerspace(_u_key, _pos, _rotation, _scale, _role)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_u_key | TriggerSpaceKey | 逻辑体编号 |
_pos | Vector3 | 位置 |
_rotation | Quaternion | 旋转 |
_scale | Vector3 | 缩放 |
_role | Role | 所属玩家 |
返回值:
- 类型:
TriggerSpace - 说明: 创建的逻辑体
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = GameAPI.create_triggerspace(900001, math.Vector3(0, 0, 0), math.Quaternion(0, 0, 0), math.Vector3(0, 0, 0), role)GameAPI.create_unit_group
描述: 创建一个组件组
GameAPI.create_unit_group(_unit_group_id, _pos, _root_quaternion, _role, _use_center_offset)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_unit_group_id | UnitGroupKey | 单位编号 |
_pos | Point3 | 位置 |
_root_quaternion | Quaternion | 旋转 |
_role | Role | 所属玩家 |
_use_center_offset | Bool | 应用原点偏移 |
返回值:
- 类型:
UnitGroup - 说明: 创建出的单位
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = GameAPI.create_unit_group(130001, math.Vector3(0, 0, 0), math.Quaternion(0, 0, 0), role, true)GameAPI.create_unit_with_scale
描述: 创建一个缩放单位
GameAPI.create_unit_with_scale(_u_key, _pos, _rotation, _scale)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_u_key | UnitKey | 单位编号 |
_pos | Point3 | 位置 |
_rotation | Quaternion | 旋转 |
_scale | Vector3 | 缩放 |
返回值:
- 类型:
Unit - 说明: 创建出的单位
示例:
local result = GameAPI.create_unit_with_scale(100001, math.Vector3(0, 0, 0), math.Quaternion(0, 0, 0), math.Vector3(0, 0, 0))GameAPI.create_vehicle
描述: 创建载具
GameAPI.create_vehicle(_vehicle_key, _pos, _direction, _role)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_vehicle_key | VehicleKey | 载具编号 |
_pos | Point3 | 位置 |
_direction | Point3 | 朝向 |
_role | Role | 所属玩家 |
返回值:
- 类型:
Vehicle - 说明: 载具
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = GameAPI.create_vehicle(500001, math.Vector3(0, 0, 0), math.Vector3(0, 0, 0), role)GameAPI.remove_pathpoint
描述: 从游戏全局移除指定路点
GameAPI.remove_pathpoint(_path_id, _index)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_path_id | PathID | 路径 |
_index | Int | 路点索引 |
示例:
local path_id = 10001
GameAPI.remove_pathpoint(path_id, 1)GameAPI.destroy_scene_ui
描述: 销毁场景界面
GameAPI.destroy_scene_ui(_layer)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_layer | E3DLayer | 场景界面 |
示例:
local layer = GameAPI.create_scene_ui_at_point(120001, math.Vector3(0,0,0), 5.0)
GameAPI.destroy_scene_ui(layer)GameAPI.destroy_obstacle_with_anim
描述: 带动效销毁组件
GameAPI.destroy_obstacle_with_anim(_anim_type, _obstacle, _duration, _intensity)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_anim_type | Int | 动效类型 |
_obstacle | Obstacle | 目标组件 |
_duration | Fixed | 动画时长 |
_intensity | Fixed | 效果系数 |
示例:
local obstacle = GameAPI.create_obstacle(200001, math.Vector3(0,0,0), math.Quaternion(0,0,0), math.Vector3(1,1,1), nil)
GameAPI.destroy_obstacle_with_anim(1, obstacle, 1.0, 1.0)GameAPI.destroy_unit
描述: 销毁单位
GameAPI.destroy_unit(_unit)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_unit | Unit | 单位 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
GameAPI.destroy_unit(role)GameAPI.game_end
描述: 游戏结束
GameAPI.game_end()示例:
GameAPI.game_end()GameAPI.get_achievement_target
描述: 获取成就目标进度
GameAPI.get_achievement_target(_event_id)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_event_id | Achievement | 成就 |
返回值:
- 类型:
Int - 说明: 成就进度
示例:
local achievement = 1 -- Achievement 是成就编号(integer)
local result = GameAPI.get_achievement_target(event_id)GameAPI.get_all_characters
描述: 获取所有角色
GameAPI.get_all_characters()返回值:
- 类型:
ListCharacter - 说明: 角色列表
示例:
local result = GameAPI.get_all_characters()GameAPI.get_all_creatures
描述: 获取所有生物
GameAPI.get_all_creatures()返回值:
- 类型:
ListCreature - 说明: 生物列表
示例:
local result = GameAPI.get_all_creatures()GameAPI.get_all_customtriggerspaces
描述: 获取所有触发区域
GameAPI.get_all_customtriggerspaces()返回值:
- 类型:
ListCustomTriggerSpace - 说明: 触发区域列表
示例:
local result = GameAPI.get_all_customtriggerspaces()GameAPI.get_all_equipments
描述: 获取所有物品
GameAPI.get_all_equipments()返回值:
- 类型:
ListEquipment - 说明: 物品列表
示例:
local result = GameAPI.get_all_equipments()GameAPI.get_all_equipment_keys_in_shop
描述: 获取物品商店中的所有物品编号
GameAPI.get_all_equipment_keys_in_shop(_battle_shop_key)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_battle_shop_key | BattleShopKey | 物品商店编号 |
返回值:
- 类型:
ListEquipmentKey - 说明: 物品编号列表
示例:
local result = GameAPI.get_all_equipment_keys_in_shop(310001)GameAPI.get_all_lifientities
描述: 获取所有生命体
GameAPI.get_all_lifientities()返回值:
- 类型:
ListLifeEntity - 说明: 生命体列表
示例:
local result = GameAPI.get_all_lifientities()GameAPI.get_all_obstacles
描述: 获取所有组件
GameAPI.get_all_obstacles()返回值:
- 类型:
ListObstacle - 说明: 组件列表
示例:
local result = GameAPI.get_all_obstacles()GameAPI.get_all_roles
描述: 获取所有玩家
GameAPI.get_all_roles()返回值:
- 类型:
ListRole - 说明: 玩家
示例:
local result = GameAPI.get_all_roles()GameAPI.get_all_valid_roles
描述: 获取游戏中所有有效玩家
GameAPI.get_all_valid_roles()返回值:
- 类型:
ListRole - 说明: 玩家列表
示例:
local result = GameAPI.get_all_valid_roles()GameAPI.get_all_online_roles
描述: 获取所有在线玩家
GameAPI.get_all_online_roles()返回值:
- 类型:
ListRole - 说明: 玩家列表
示例:
local result = GameAPI.get_all_online_roles()GameAPI.get_all_triggerspaces
描述: 获取所有逻辑体
GameAPI.get_all_triggerspaces()返回值:
- 类型:
ListTriggerSpace - 说明: 逻辑体列表
示例:
local result = GameAPI.get_all_triggerspaces()GameAPI.get_characters_in_aabb
描述: 获取矩形区域内的角色
GameAPI.get_characters_in_aabb(_center, _length, _height, _width)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_center | Point3 | 中心点 |
_length | Fixed | 长 |
_height | Fixed | 高 |
_width | Fixed | 宽 |
返回值:
- 类型:
ListCharacter - 说明: 角色列表
示例:
local result = GameAPI.get_characters_in_aabb(math.Vector3(0, 0, 0), 1.0, 1.0, 1.0)GameAPI.get_characters_in_cylinder
描述: 获取圆柱区域内的角色
GameAPI.get_characters_in_cylinder(_bottom_center, _radius, _height)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_bottom_center | Point3 | 底部中心 |
_radius | Fixed | 半径 |
_height | Fixed | 高度 |
返回值:
- 类型:
ListCharacter - 说明: 角色列表
示例:
local result = GameAPI.get_characters_in_cylinder(math.Vector3(0, 0, 0), 1.0, 1.0)GameAPI.get_characters_in_sphere
描述: 获取圆形区域内的角色
GameAPI.get_characters_in_sphere(_center, _radius)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_center | Point3 | 中心点 |
_radius | Fixed | 半径 |
返回值:
- 类型:
ListCharacter - 说明: 角色列表
示例:
local result = GameAPI.get_characters_in_sphere(math.Vector3(0, 0, 0), 1.0)GameAPI.get_driving_vehicle
描述: 获取角色当前骑乘的载具
GameAPI.get_driving_vehicle(_character)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_character | Character | 角色 |
返回值:
- 类型:
Vehicle - 说明: 载具
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- Character 继承自 LifeEntity,代表NPC角色单位
local result = GameAPI.get_driving_vehicle(npc)GameAPI.get_sheet_col_count
描述: 获取表列数
GameAPI.get_sheet_col_count(_sheet_id)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_sheet_id | SheetID | 多维表 |
返回值:
- 类型:
Int - 说明: 长度
示例:
local sheet = GameAPI.create_sheet()
local result = GameAPI.get_sheet_col_count(sheet)GameAPI.get_sheet_row_count
描述: 获取表行数
GameAPI.get_sheet_row_count(_sheet_id)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_sheet_id | SheetID | 多维表 |
返回值:
- 类型:
Int - 说明: 长度
示例:
local sheet = GameAPI.create_sheet()
local result = GameAPI.get_sheet_row_count(sheet)GameAPI.get_creatures_by_key
描述: 获取指定编号的逻辑体列表
GameAPI.get_creatures_by_key(_creature_key)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_creature_key | CreatureKey | 生物编号 |
返回值:
- 类型:
ListCreature - 说明: 生物列表
示例:
local result = GameAPI.get_creatures_by_key(100001)GameAPI.get_creatures_in_aabb
描述: 获取矩形区域内的生物
GameAPI.get_creatures_in_aabb(_center, _length, _height, _width)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_center | Point3 | 中心点 |
_length | Fixed | 长 |
_height | Fixed | 高 |
_width | Fixed | 宽 |
返回值:
- 类型:
ListCreature - 说明: 角色列表
示例:
local result = GameAPI.get_creatures_in_aabb(math.Vector3(0, 0, 0), 1.0, 1.0, 1.0)GameAPI.get_creatures_in_annulus
描述: 获取圆环区域内的生物
GameAPI.get_creatures_in_annulus(_center, _radius1, _radius2, _height)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_center | Point3 | 中心点 |
_radius1 | Fixed | 内径 |
_radius2 | Fixed | 外径 |
_height | Fixed | 高度 |
返回值:
- 类型:
ListCreature - 说明: 生物列表
示例:
local result = GameAPI.get_creatures_in_annulus(math.Vector3(0, 0, 0), 1.0, 1.0, 1.0)GameAPI.get_creatures_in_cylinder
描述: 获取圆柱区域内的生物
GameAPI.get_creatures_in_cylinder(_bottom_center, _radius, _height)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_bottom_center | Point3 | 底部中心 |
_radius | Fixed | 半径 |
_height | Fixed | 高度 |
返回值:
- 类型:
ListCreature - 说明: 生物列表
示例:
local result = GameAPI.get_creatures_in_cylinder(math.Vector3(0, 0, 0), 1.0, 1.0)GameAPI.get_creatures_in_sector
描述: 获取扇形区域内的生物
GameAPI.get_creatures_in_sector(_center, _face_dir, _central_angle, _radius, _height)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_center | Point3 | 起始点 |
_face_dir | Fixed | 角度朝向 |
_central_angle | Fixed | 广角 |
_radius | Fixed | 半径 |
_height | Fixed | 高度 |
返回值:
- 类型:
ListCreature - 说明: 生物列表
示例:
local result = GameAPI.get_creatures_in_sector(math.Vector3(0, 0, 0), 1.0, 1.0, 1.0, 1.0)GameAPI.get_creatures_in_sphere
描述: 获取圆形区域内的生物
GameAPI.get_creatures_in_sphere(_center, _radius)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_center | Point3 | 中心点 |
_radius | Fixed | 半径 |
返回值:
- 类型:
ListCreature - 说明: 生物列表
示例:
local result = GameAPI.get_creatures_in_sphere(math.Vector3(0, 0, 0), 1.0)GameAPI.get_env_time
描述: 获取环境时间
GameAPI.get_env_time()返回值:
- 类型:
Fixed - 说明: 当前环境时刻
示例:
local result = GameAPI.get_env_time()GameAPI.get_customtriggerspaces_by_key
描述: 获取指定预设的触发区域列表
GameAPI.get_customtriggerspaces_by_key(_key)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_key | CustomTriggerSpaceKey | 触发区域编号 |
返回值:
- 类型:
ListCustomTriggerSpace - 说明: 触发区域列表
示例:
local result = GameAPI.get_customtriggerspaces_by_key(110001)GameAPI.get_customtriggerspaces_in_raycast
描述: 获取射线检测到的触发区域列表
GameAPI.get_customtriggerspaces_in_raycast(_start_pos, _end_pos)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_start_pos | Point3 | 起始点 |
_end_pos | Point3 | 终点 |
返回值:
- 类型:
ListCustomTriggerSpace - 说明: 触发区域列表
示例:
local result = GameAPI.get_customtriggerspaces_in_raycast(math.Vector3(0, 0, 0), math.Vector3(0, 0, 0))GameAPI.get_first_customtriggerspace_in_raycast
描述: 获取射线检测到的触发区域
GameAPI.get_first_customtriggerspace_in_raycast(_start_pos, _end_pos)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_start_pos | Point3 | 起始点 |
_end_pos | Point3 | 终点 |
返回值:
- 类型:
CustomTriggerSpace - 说明: 触发区域
示例:
local result = GameAPI.get_first_customtriggerspace_in_raycast(math.Vector3(0, 0, 0), math.Vector3(0, 0, 0))GameAPI.get_day
描述: 获取时间戳转化后的日期数
GameAPI.get_day(_timestamp)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_timestamp | Timestamp | 时间戳 |
返回值:
- 类型:
Int - 说明: 日
示例:
local result = GameAPI.get_day(GameAPI.get_timestamp())GameAPI.get_timestamp_diff
描述: 获取时间戳秒差
GameAPI.get_timestamp_diff(_timestamp_1, _timestamp_2)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_timestamp_1 | Timestamp | 时间戳1 |
_timestamp_2 | Timestamp | 时间戳2 |
返回值:
- 类型:
Int - 说明: 秒差
示例:
local result = GameAPI.get_timestamp_diff(GameAPI.get_timestamp(), GameAPI.get_timestamp())GameAPI.get_eui_node_at_scene_ui
描述: 获取场景界面中的控件
GameAPI.get_eui_node_at_scene_ui(_layer, _node_id)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_layer | E3DLayer | 场景界面 |
_node_id | ENode | 界面节点 |
返回值:
- 类型:
ENode - 说明: 场景界面节点
示例:
local layer = GameAPI.create_scene_ui_at_point(120001, math.Vector3(0,0,0), 5.0)
local node = LuaAPI.query_ui_node(role, "panel_main")
local result = GameAPI.get_eui_node_at_scene_ui(layer, node_id)GameAPI.get_eui_children
描述: 获取UI节点的所有子UI节点
GameAPI.get_eui_children(_node)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_node | ENode | UI节点 |
返回值:
- 类型:
ListENode - 说明: 子UI节点列表
示例:
local node = LuaAPI.query_ui_node(role, "panel_main")
local result = GameAPI.get_eui_children(node)GameAPI.get_eui_child_by_name
描述: 根据名字获取UI节点的子UI节点
GameAPI.get_eui_child_by_name(_node, _name)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_node | ENode | UI节点 |
_name | Str | 名字 |
返回值:
- 类型:
ENode - 说明: 子UI节点
示例:
local node = LuaAPI.query_ui_node(role, "panel_main")
local result = GameAPI.get_eui_child_by_name(node, "平凡蛋0")GameAPI.get_hour
描述: 获取时间戳转化后的小时数
GameAPI.get_hour(_timestamp)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_timestamp | Timestamp | 时间戳 |
返回值:
- 类型:
Int - 说明: 时
示例:
local result = GameAPI.get_hour(GameAPI.get_timestamp())GameAPI.get_lifeentities_in_aabb
描述: 获取矩形区域内的生命体
GameAPI.get_lifeentities_in_aabb(_center, _length, _height, _width)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_center | Point3 | 中心点 |
_length | Fixed | 长 |
_height | Fixed | 高 |
_width | Fixed | 宽 |
返回值:
- 类型:
ListLifeEntity - 说明: 生命体列表
示例:
local result = GameAPI.get_lifeentities_in_aabb(math.Vector3(0, 0, 0), 1.0, 1.0, 1.0)GameAPI.get_lifeentities_in_cylinder
描述: 获取圆柱区域内的生命体
GameAPI.get_lifeentities_in_cylinder(_bottom_center, _radius, _height)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_bottom_center | Point3 | 底部中心 |
_radius | Fixed | 半径 |
_height | Fixed | 高度 |
返回值:
- 类型:
ListLifeEntity - 说明: 生命体列表
示例:
local result = GameAPI.get_lifeentities_in_cylinder(math.Vector3(0, 0, 0), 1.0, 1.0)GameAPI.get_lifeentities_in_sphere
描述: 获取圆形区域内的生命体
GameAPI.get_lifeentities_in_sphere(_center, _radius)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_center | Point3 | 中心点 |
_radius | Fixed | 半径 |
返回值:
- 类型:
ListLifeEntity - 说明: 生命体列表
示例:
local result = GameAPI.get_lifeentities_in_sphere(math.Vector3(0, 0, 0), 1.0)GameAPI.get_map_rating_score
描述: 获取地图当前评分
GameAPI.get_map_rating_score()返回值:
- 类型:
Fixed - 说明: 当前评分
示例:
local result = GameAPI.get_map_rating_score()GameAPI.get_map_characters
描述: 获取所有地图角色
GameAPI.get_map_characters()返回值:
- 类型:
ListCharacter - 说明: 角色列表
示例:
local result = GameAPI.get_map_characters()GameAPI.is_env_time_running_enabled
描述: 获取环境时间是否自动流逝
GameAPI.is_env_time_running_enabled()返回值:
- 类型:
Bool - 说明: 是否自动流逝
示例:
local result = GameAPI.is_env_time_running_enabled()GameAPI.get_env_time_ratio
描述: 获取环境时间流逝速率
GameAPI.get_env_time_ratio()返回值:
- 类型:
Fixed - 说明: 流逝速率
示例:
local result = GameAPI.get_env_time_ratio()GameAPI.get_minute
描述: 获取时间戳转化后的分钟数
GameAPI.get_minute(_timestamp)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_timestamp | Timestamp | 时间戳 |
返回值:
- 类型:
Int - 说明: 分
示例:
local result = GameAPI.get_minute(GameAPI.get_timestamp())GameAPI.get_month
描述: 获取时间戳转化后的月份数
GameAPI.get_month(_timestamp)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_timestamp | Timestamp | 时间戳 |
返回值:
- 类型:
Int - 说明: 月
示例:
local result = GameAPI.get_month(GameAPI.get_timestamp())GameAPI.get_obstacles_by_key
描述: 获取指定编号的组件列表
GameAPI.get_obstacles_by_key(_key)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_key | ObstacleKey | 组件编号 |
返回值:
- 类型:
ListObstacle - 说明: 组件列表
示例:
local result = GameAPI.get_obstacles_by_key(200001)GameAPI.get_obstacles_in_aabb
描述: 获取矩形区域内的组件
GameAPI.get_obstacles_in_aabb(_center, _length, _height, _width)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_center | Point3 | 中心点 |
_length | Fixed | 长 |
_height | Fixed | 高 |
_width | Fixed | 宽 |
返回值:
- 类型:
ListObstacle - 说明: 角色列表
示例:
local result = GameAPI.get_obstacles_in_aabb(math.Vector3(0, 0, 0), 1.0, 1.0, 1.0)GameAPI.get_obstacles_in_annulus
描述: 获取圆环区域内的组件
GameAPI.get_obstacles_in_annulus(_center, _radius1, _radius2, _height)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_center | Point3 | 中心点 |
_radius1 | Fixed | 内径 |
_radius2 | Fixed | 外径 |
_height | Fixed | 高度 |
返回值:
- 类型:
ListObstacle - 说明: 组件列表
示例:
local result = GameAPI.get_obstacles_in_annulus(math.Vector3(0, 0, 0), 1.0, 1.0, 1.0)GameAPI.get_obstacles_in_cylinder
描述: 获取圆柱区域内的组件
GameAPI.get_obstacles_in_cylinder(_bottom_center, _radius, _height)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_bottom_center | Point3 | 底部中心 |
_radius | Fixed | 半径 |
_height | Fixed | 高度 |
返回值:
- 类型:
ListObstacle - 说明: 组件列表
示例:
local result = GameAPI.get_obstacles_in_cylinder(math.Vector3(0, 0, 0), 1.0, 1.0)GameAPI.get_obstacles_by_raycast
描述: 获取射线检测到的组件列表
GameAPI.get_obstacles_by_raycast(_start_pos, _end_pos)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_start_pos | Point3 | 起始点 |
_end_pos | Point3 | 终点 |
返回值:
- 类型:
ListObstacle - 说明: 组件列表
示例:
local result = GameAPI.get_obstacles_by_raycast(math.Vector3(0, 0, 0), math.Vector3(0, 0, 0))GameAPI.get_obstacles_in_sector
描述: 获取扇形区域内的组件
GameAPI.get_obstacles_in_sector(_center, _face_dir, _central_angle, _radius, _height)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_center | Point3 | 起始点 |
_face_dir | Fixed | 角度朝向 |
_central_angle | Fixed | 广角 |
_radius | Fixed | 半径 |
_height | Fixed | 高度 |
返回值:
- 类型:
ListObstacle - 说明: 组件列表
示例:
local result = GameAPI.get_obstacles_in_sector(math.Vector3(0, 0, 0), 1.0, 1.0, 1.0, 1.0)GameAPI.get_obstacles_in_sphere
描述: 获取圆形区域内的组件
GameAPI.get_obstacles_in_sphere(_center, _radius)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_center | Point3 | 中心点 |
_radius | Fixed | 半径 |
返回值:
- 类型:
ListObstacle - 说明: 组件列表
示例:
local result = GameAPI.get_obstacles_in_sphere(math.Vector3(0, 0, 0), 1.0)GameAPI.get_obstacle_by_raycast
描述: 获取射线检测到的组件
GameAPI.get_obstacle_by_raycast(_start_pos, _end_pos)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_start_pos | Point3 | 起始点 |
_end_pos | Point3 | 终点 |
返回值:
- 类型:
Obstacle - 说明: 组件
示例:
local result = GameAPI.get_obstacle_by_raycast(math.Vector3(0, 0, 0), math.Vector3(0, 0, 0))GameAPI.get_vector3s_from_path
描述: 获取路径向量数组
GameAPI.get_vector3s_from_path(_path_id)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_path_id | PathID | 路径 |
返回值:
- 类型:
ListVector3 - 说明: 向量数组
示例:
local path_id = 10001
local result = GameAPI.get_vector3s_from_path(path_id)GameAPI.random_color
描述: 获取随机颜色
GameAPI.random_color()返回值:
- 类型:
Color - 说明: 颜色
示例:
local result = GameAPI.random_color()GameAPI.get_pathpoint_by_index
描述: 获取路径中的路点向量
GameAPI.get_pathpoint_by_index(_path_id, _index)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_path_id | PathID | 路径 |
_index | Int | 路点索引 |
返回值:
- 类型:
Vector3 - 说明: 向量
示例:
local path_id = 10001
local result = GameAPI.get_pathpoint_by_index(path_id, 1)GameAPI.get_role_friendship_value
描述: 获取玩家亲密度
GameAPI.get_role_friendship_value(_role_1, _role_2)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_role_1 | Role | 玩家1 |
_role_2 | Role | 玩家2 |
返回值:
- 类型:
Int - 说明: 亲密度
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = GameAPI.get_role_friendship_value(role, nil --[[Role]])GameAPI.is_role_friendship_type_match
描述: 玩家亲密关系是否符合
GameAPI.is_role_friendship_type_match(_role_1, _role_2, _friendship_type)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_role_1 | Role | 玩家1 |
_role_2 | Role | 玩家2 |
_friendship_type | FriendshipType | 亲密关系 |
返回值:
- 类型:
Bool - 说明: 是否符合
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = GameAPI.is_role_friendship_type_match(role, nil --[[Role]], Enums.FriendshipType.FRIEND)GameAPI.get_party_roles
描述: 获取组队中玩家列表
GameAPI.get_party_roles(_party_id)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_party_id | Str | 组队Id |
返回值:
- 类型:
ListRole - 说明: 玩家列表
示例:
local result = GameAPI.get_party_roles("id_001")GameAPI.get_second
描述: 获取时间戳转化后的秒数
GameAPI.get_second(_timestamp)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_timestamp | Timestamp | 时间戳 |
返回值:
- 类型:
Int - 说明: 秒
示例:
local result = GameAPI.get_second(GameAPI.get_timestamp())GameAPI.get_timestamp
描述: 获取当前时间戳
GameAPI.get_timestamp()返回值:
- 类型:
Timestamp - 说明: 时间戳
示例:
local result = GameAPI.get_timestamp()GameAPI.get_timestamp_by_time
描述: 获取时间戳
GameAPI.get_timestamp_by_time(_year, _month, _day, _hour, _minute, _second)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_year | Int | 年 |
_month | Int | 月 |
_day | Int | 日 |
_hour | Int | 时 |
_minute | Int | 分 |
_second | Int | 秒 |
返回值:
- 类型:
Timestamp - 说明: 时间戳
示例:
local result = GameAPI.get_timestamp_by_time(1, 1, 1, 1, 1, 1)GameAPI.get_triggerspaces_by_key
描述: 获取指定编号的逻辑体列表
GameAPI.get_triggerspaces_by_key(_key)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_key | TriggerSpaceKey | 逻辑体编号 |
返回值:
- 类型:
ListTriggerSpace - 说明: 逻辑体列表
示例:
local result = GameAPI.get_triggerspaces_by_key(900001)GameAPI.get_joint_assistants
描述: 获取组件上的所有关节
GameAPI.get_joint_assistants(_unit)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_unit | Unit | 目标单位 |
返回值:
- 类型:
ListJointAssistant - 说明: 关节列表
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = GameAPI.get_joint_assistants(role)GameAPI.get_weekday
描述: 获取时间戳转化后的星期数
GameAPI.get_weekday(_timestamp)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_timestamp | Timestamp | 时间戳 |
返回值:
- 类型:
Int - 说明: 星期
示例:
local result = GameAPI.get_weekday(GameAPI.get_timestamp())GameAPI.get_year
描述: 获取时间戳转化后的年数
GameAPI.get_year(_timestamp)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_timestamp | Timestamp | 时间戳 |
返回值:
- 类型:
Int - 说明: 年
示例:
local result = GameAPI.get_year(GameAPI.get_timestamp())GameAPI.random_int
描述: 随机整数
GameAPI.random_int(_min_value, _max_value)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_min_value | Int | 最小值 |
_max_value | Int | 最大值 |
返回值:
- 类型:
Int - 说明: 整数
示例:
local result = GameAPI.random_int(1, 1)GameAPI.is_point_in_customtriggerspace
描述: 坐标点是否在触发区域内
GameAPI.is_point_in_customtriggerspace(_point, _custom_trigger_space)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_point | Point3 | 坐标点 |
_custom_trigger_space | CustomTriggerSpace | 触发区域 |
返回值:
- 类型:
Bool - 说明: 是否在触发区域内
示例:
local cts = GameAPI.create_customtriggerspace(110001, math.Vector3(0,0,0), math.Quaternion(0,0,0), math.Vector3(1,1,1), nil)
local result = GameAPI.is_point_in_customtriggerspace(math.Vector3(0, 0, 0), cts)GameAPI.is_archives_enabled
描述: 是否开启存档
GameAPI.is_archives_enabled()返回值:
- 类型:
Bool - 说明: 是否开启
示例:
local result = GameAPI.is_archives_enabled()GameAPI.load_level
描述: 跳转关卡
GameAPI.load_level(_level_key)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_level_key | LevelKey | 关卡编号 |
示例:
GameAPI.load_level(290001)GameAPI.get_montage_duration
描述: 获取剧情时长
GameAPI.get_montage_duration(_montage_id)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_montage_id | MontageKey | 剧情动画编号 |
返回值:
- 类型:
Fixed - 说明: 时长
示例:
local result = GameAPI.get_montage_duration(260001)GameAPI.play_link_sfx
描述: 播放连线特效
GameAPI.play_link_sfx(_sfx_key, _unit, _from_socket_name, _target_unit, _target_socket_name, _duration)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_sfx_key | SfxKey | 特效编号 |
_unit | Unit | 起点单位 |
_from_socket_name | Str | 起点节点 |
_target_unit | Unit | 终点单位 |
_target_socket_name | Str | 终点节点 |
_duration | Fixed | 持续时间 |
返回值:
- 类型:
SfxID - 说明: 特效ID
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = GameAPI.play_link_sfx(700001, role, "平凡蛋0", nil --[[Unit]], "平凡蛋0", 1.0)GameAPI.play_sfx_by_key
描述: 播放特效
GameAPI.play_sfx_by_key(_sfx_key, _pos, _rot, _scale, _duration, _rate, _with_sound)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_sfx_key | SfxKey | 特效编号 |
_pos | Point3 | 位置 |
_rot | Quaternion | 旋转 |
_scale | Fixed | 缩放 |
_duration | Fixed | 持续时间 |
_rate | Fixed | 播放速率 |
_with_sound | Bool | 是否播放音效 |
返回值:
- 类型:
SfxID - 说明: 特效ID
示例:
local result = GameAPI.play_sfx_by_key(700001, math.Vector3(0, 0, 0), math.Quaternion(0, 0, 0), 1.0, 1.0, 1.0, true)GameAPI.get_pathpoint_by_id
描述: 获取路点坐标
GameAPI.get_pathpoint_by_id(_point_id)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_point_id | PathPointID | 路点 |
返回值:
- 类型:
Point3 - 说明: 坐标
示例:
local result = GameAPI.get_pathpoint_by_id(20001)GameAPI.get_role
描述: 玩家ID获取玩家
GameAPI.get_role(_role_id)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_role_id | RoleID | 玩家ID |
返回值:
- 类型:
Role - 说明: 玩家
示例:
local role_id = GameAPI.get_role_id(GameAPI.get_all_valid_roles()[1])
local result = GameAPI.get_role(role_id)GameAPI.set_all_scene_ui_visible
描述: 设置所有场景界面显示状态
GameAPI.set_all_scene_ui_visible(_role, _visible)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_role | Role | 玩家 |
_visible | Bool | 点击关闭属性 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
GameAPI.set_all_scene_ui_visible(role, true)GameAPI.enable_collision_between_unit_and_prefab
描述: 设置单位与预设是否能发生碰撞
GameAPI.enable_collision_between_unit_and_prefab(_unit, _unit_eid, _enable)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_unit | Unit | 单位 |
_unit_eid | UnitKey | 单位编号 |
_enable | Bool | 是否碰撞 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
GameAPI.enable_collision_between_unit_and_prefab(role, 100001, true)GameAPI.enable_collision_between_units
描述: 设置两个单位是否能碰撞
GameAPI.enable_collision_between_units(_unit_1, _unit_2, _enable)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_unit_1 | Unit | 单位1 |
_unit_2 | Unit | 单位2 |
_enable | Bool | 是否碰撞 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
GameAPI.enable_collision_between_units(role, nil --[[Unit]], true)GameAPI.set_equipment_remaining_stock_count
描述: 设置物品商店物品剩余库存
GameAPI.set_equipment_remaining_stock_count(_battle_shop_key, _equipment_key, _cur_stock_count)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_battle_shop_key | BattleShopKey | 物品商店编号 |
_equipment_key | EquipmentKey | 物品编号 |
_cur_stock_count | Int | 剩余库存 |
示例:
GameAPI.set_equipment_remaining_stock_count(310001, 400001, 1)GameAPI.set_equipment_max_stock_count
描述: 设置物品商店物品最大库存
GameAPI.set_equipment_max_stock_count(_battle_shop_key, _equipment_key, _max_stock_count)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_battle_shop_key | BattleShopKey | 物品商店编号 |
_equipment_key | EquipmentKey | 物品编号 |
_max_stock_count | Int | 最大库存 |
示例:
GameAPI.set_equipment_max_stock_count(310001, 400001, 1)GameAPI.set_scene_ui_visible
描述: 设置场景界面的显隐
GameAPI.set_scene_ui_visible(_layer, _role, _visible)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_layer | E3DLayer | 场景界面 |
_role | Role | 玩家 |
_visible | Bool | 显隐 |
示例:
local layer = GameAPI.create_scene_ui_at_point(120001, math.Vector3(0,0,0), 5.0)
local role = GameAPI.get_all_valid_roles()[1]
GameAPI.set_scene_ui_visible(layer, role, true)GameAPI.set_scene_ui_position
描述: 设置场景界面位置
GameAPI.set_scene_ui_position(_role, _layer, _position)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_role | Role | 玩家 |
_layer | E3DLayer | 场景界面 |
_position | Point3 | 坐标点 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
local layer = GameAPI.create_scene_ui_at_point(120001, math.Vector3(0,0,0), 5.0)
GameAPI.set_scene_ui_position(role, layer, math.Vector3(0, 0, 0))GameAPI.set_eui_node_auto_adaption
描述: 设置节点屏幕自适应配置,顺序为:左 右 上 下。(开启百分比时,值的单位是百分比)
GameAPI.set_eui_node_auto_adaption(_node, _left_enable, _left_is_percent, _left_value, _right_enable, _right_is_percent, _right_value, _top_enable, _top_is_percent, _top_value, _bottom_enable, _bottom_is_percent, _bottom_value)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_node | ENode | 节点 |
_left_enable | Bool | 启用左侧 |
_left_is_percent | Bool | 启用百分比 |
_left_value | Fixed | 值 |
_right_enable | Bool | 启用右侧 |
_right_is_percent | Bool | 启用百分比 |
_right_value | Fixed | 值 |
_top_enable | Bool | 启用上侧 |
_top_is_percent | Bool | 启用百分比 |
_top_value | Fixed | 值 |
_bottom_enable | Bool | 启用下侧 |
_bottom_is_percent | Bool | 启用百分比 |
_bottom_value | Fixed | 值 |
示例:
local node = LuaAPI.query_ui_node(role, "panel_main")
GameAPI.set_eui_node_auto_adaption(node, true, true, 1.0, true, true, 1.0, true, true, 1.0, true, true, 1.0)GameAPI.set_eui_node_auto_center
描述: 设置节点屏幕居中配置,顺序为:水平 垂直。(开启百分比时,值的单位是百分比)
GameAPI.set_eui_node_auto_center(_node, _horizontal_center, _horizontal_is_percent, _horizontal_value, _vertical_center, _vertical_is_percent, _vertical_value)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_node | ENode | 节点 |
_horizontal_center | Bool | 启用水平居中 |
_horizontal_is_percent | Bool | 启用百分比 |
_horizontal_value | Fixed | 值 |
_vertical_center | Bool | 启用垂直居中 |
_vertical_is_percent | Bool | 启用百分比 |
_vertical_value | Fixed | 值 |
示例:
local node = LuaAPI.query_ui_node(role, "panel_main")
GameAPI.set_eui_node_auto_center(node, true, true, 1.0, true, true, 1.0)GameAPI.set_eui_node_bottom_auto_adaption
描述: 设置节点下侧屏幕自适应配置
GameAPI.set_eui_node_bottom_auto_adaption(_node, _enable, _is_percent, _value)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_node | ENode | 节点 |
_enable | Bool | 启用下侧 |
_is_percent | Bool | 启用百分比 |
_value | Fixed | 值 |
示例:
local node = LuaAPI.query_ui_node(role, "panel_main")
GameAPI.set_eui_node_bottom_auto_adaption(node, true, true, 1.0)GameAPI.set_eui_node_horizontal_auto_center
描述: 设置节点水平居中配置。(开启百分比时,值的单位是百分比)
GameAPI.set_eui_node_horizontal_auto_center(_node, _enable, _is_percent, _value)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_node | ENode | 节点 |
_enable | Bool | 启用水平居中 |
_is_percent | Bool | 启用百分比 |
_value | Fixed | 值 |
示例:
local node = LuaAPI.query_ui_node(role, "panel_main")
GameAPI.set_eui_node_horizontal_auto_center(node, true, true, 1.0)GameAPI.set_eui_node_left_auto_adaption
描述: 设置节点左侧屏幕自适应配置。(开启百分比时,值的单位是百分比)
GameAPI.set_eui_node_left_auto_adaption(_node, _enable, _is_percent, _value)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_node | ENode | 节点 |
_enable | Bool | 启用左侧 |
_is_percent | Bool | 启用百分比 |
_value | Fixed | 值 |
示例:
local node = LuaAPI.query_ui_node(role, "panel_main")
GameAPI.set_eui_node_left_auto_adaption(node, true, true, 1.0)GameAPI.set_eui_node_right_auto_adaption
描述: 设置节点右侧屏幕自适应配置
GameAPI.set_eui_node_right_auto_adaption(_node, _enable, _is_percent, _value)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_node | ENode | 节点 |
_enable | Bool | 启用右侧 |
_is_percent | Bool | 启用百分比 |
_value | Fixed | 值 |
示例:
local node = LuaAPI.query_ui_node(role, "panel_main")
GameAPI.set_eui_node_right_auto_adaption(node, true, true, 1.0)GameAPI.set_eui_node_top_auto_adaption
描述: 设置节点上侧屏幕自适应配置
GameAPI.set_eui_node_top_auto_adaption(_node, _enable, _is_percent, _value)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_node | ENode | 节点 |
_enable | Bool | 启用上侧 |
_is_percent | Bool | 启用百分比 |
_value | Fixed | 值 |
示例:
local node = LuaAPI.query_ui_node(role, "panel_main")
GameAPI.set_eui_node_top_auto_adaption(node, true, true, 1.0)GameAPI.set_eui_node_vertical_auto_center
描述: 设置节点垂直居中配置。(开启百分比时,值的单位是百分比)
GameAPI.set_eui_node_vertical_auto_center(_node, _enable, _is_percent, _value)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_node | ENode | 节点 |
_enable | Bool | 启用垂直居中 |
_is_percent | Bool | 启用百分比 |
_value | Fixed | 值 |
示例:
local node = LuaAPI.query_ui_node(role, "panel_main")
GameAPI.set_eui_node_vertical_auto_center(node, true, true, 1.0)GameAPI.set_global_wind_enabled
描述: 设置全局风场开关
GameAPI.set_global_wind_enabled(_bool_value)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_bool_value | Bool | 是否开启 |
示例:
GameAPI.set_global_wind_enabled(true)GameAPI.set_global_wind_force
描述: 设置全局风场方向力
GameAPI.set_global_wind_force(_x_value, _y_value)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_x_value | Fixed | X方向力 |
_y_value | Fixed | Y方向力 |
示例:
GameAPI.set_global_wind_force(1.0, 1.0)GameAPI.set_global_wind_frequency
描述: 设置全局风场频率
GameAPI.set_global_wind_frequency(_fixed_value)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_fixed_value | Fixed | 频率 |
示例:
GameAPI.set_global_wind_frequency(1.0)GameAPI.set_env_time_running_enabled
描述: 设置环境时间是否自动流逝
GameAPI.set_env_time_running_enabled(_enabled)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_enabled | Bool | 是否自动流逝 |
示例:
GameAPI.set_env_time_running_enabled(true)GameAPI.set_env_time
描述: 设置环境时间
GameAPI.set_env_time(_target_time, _duration, _direction)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_target_time | Fixed | 目标时刻 |
_duration | Fixed | 过渡时间 |
_direction | Bool | 是否正向 |
示例:
GameAPI.set_env_time(1.0, 1.0, true)GameAPI.set_env_time_ratio
描述: 设置环境时间流逝速度
GameAPI.set_env_time_ratio(_time_ratio)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_time_ratio | Fixed | 流逝速度 |
示例:
GameAPI.set_env_time_ratio(1.0)GameAPI.stop_sound
描述: 停止播放音效
GameAPI.stop_sound(_assigned_id)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_assigned_id | SoundID | 音效ID |
示例:
local sound_id = nil -- SoundID 需由 GameAPI.play_sound_* 系列 API 返回,请查阅文档
GameAPI.stop_sound(assigned_id)GameAPI.get_unit
描述: 获取单位
GameAPI.get_unit(_unit_id)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_unit_id | UnitID | 单位ID |
返回值:
- 类型:
Unit - 说明: 单位
示例:
local result = GameAPI.get_unit(LuaAPI.get_unit_id(unit))GameAPI.ability_prefab_get_desc
描述: 获取技能预设描述
GameAPI.ability_prefab_get_desc(_ability_id)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_ability_id | AbilityKey | 技能编号 |
返回值:
- 类型:
Str - 说明: 技能描述
示例:
local result = GameAPI.ability_prefab_get_desc(150001)GameAPI.ability_prefab_get_kv_by_type
描述: 获取技能预设的自定义值
GameAPI.ability_prefab_get_kv_by_type(_value_type, _key, _prop)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_value_type | ValueType | 值类型 |
_key | AbilityKey | 技能编号 |
_prop | Str | 名称 |
返回值:
- 类型:
ETypeMeta - 说明: 自定义值
GameAPI.ability_prefab_get_name
描述: 获取技能预设名称
GameAPI.ability_prefab_get_name(_ability_id)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_ability_id | AbilityKey | 技能编号 |
返回值:
- 类型:
Str - 说明: 技能名称
示例:
local result = GameAPI.ability_prefab_get_name(150001)GameAPI.ability_prefab_get_prop_by_type
描述: 获取技能预设的属性
GameAPI.ability_prefab_get_prop_by_type(_value_type, _key, _prop)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_value_type | ValueType | 值类型 |
_key | AbilityKey | 技能编号 |
_prop | Str | 名称 |
返回值:
- 类型:
ETypeMeta - 说明: 属性值
示例:
local result = GameAPI.ability_prefab_get_prop_by_type(Enums.ValueType.Int, 150001, "示例字符串")GameAPI.ability_prefab_has_kv
描述: 技能预设是否存在自定义值
GameAPI.ability_prefab_has_kv(_ability_key, _prop)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_ability_key | AbilityKey | 技能编号 |
_prop | Str | 名称 |
返回值:
- 类型:
Bool - 说明: 是否存在
示例:
local result = GameAPI.ability_prefab_has_kv(150001, "示例字符串")GameAPI.create_obstacle_by_geometry
描述: 创建一个组件(自定义几何)
GameAPI.create_obstacle_by_geometry(_u_key, _pos, _rotation, _scale, _role, _geometry_path, _mat_path, _sel_skin)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_u_key | UnitKey | 组件编号 |
_pos | Vector3 | 位置 |
_rotation | Quaternion | 旋转 |
_scale | Vector3 | 缩放 |
_role | Role | 所属玩家 |
_geometry_path | Str | 自定义几何体路径 |
_mat_path | Str | 覆盖材质路径 |
_sel_skin | Int | 材质编号(与材质路径二选一) |
返回值:
- 类型:
Obstacle - 说明: 创建的组件
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = GameAPI.create_obstacle_by_geometry(100001, math.Vector3(0, 0, 0), math.Quaternion(0, 0, 0), math.Vector3(0, 0, 0), role, "res/path", "res/path", 1)GameAPI.create_obstacle_from_geometry
描述: 创建一个组件(自定义几何)
GameAPI.create_obstacle_from_geometry(_u_key, _pos, _rotation, _scale, _role, _geometry_path)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_u_key | UnitKey | 组件编号 |
_pos | Vector3 | 位置 |
_rotation | Quaternion | 旋转 |
_scale | Vector3 | 缩放 |
_role | Role | 所属玩家 |
_geometry_path | Str | 自定义几何体路径 |
返回值:
- 类型:
Obstacle - 说明: 创建的组件
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = GameAPI.create_obstacle_from_geometry(100001, math.Vector3(0, 0, 0), math.Quaternion(0, 0, 0), math.Vector3(0, 0, 0), role, "res/path")GameAPI.creature_prefab_get_kv_by_type
描述: 获取生物预设的自定义值
GameAPI.creature_prefab_get_kv_by_type(_value_type, _key, _prop)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_value_type | ValueType | 值类型 |
_key | CreatureKey | 生物编号 |
_prop | Str | 名称 |
返回值:
- 类型:
ETypeMeta - 说明: 自定义值
示例:
local result = GameAPI.creature_prefab_get_kv_by_type(Enums.ValueType.Int, 100001, "示例字符串")GameAPI.creature_prefab_get_prop_by_type
描述: 获取生物预设的属性
GameAPI.creature_prefab_get_prop_by_type(_value_type, _key, _prop)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_value_type | ValueType | 值类型 |
_key | CreatureKey | 生物编号 |
_prop | Str | 名称 |
返回值:
- 类型:
ETypeMeta - 说明: 属性值
示例:
local result = GameAPI.creature_prefab_get_prop_by_type(Enums.ValueType.Int, 100001, "示例字符串")GameAPI.creature_prefab_has_kv
描述: 生物预设是否存在自定义值
GameAPI.creature_prefab_has_kv(_unit_key, _prop)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_unit_key | CreatureKey | 生物编号 |
_prop | Str | 名称 |
返回值:
- 类型:
Bool - 说明: 是否存在
示例:
local result = GameAPI.creature_prefab_has_kv(100001, "示例字符串")GameAPI.customtriggerspace_prefab_get_kv_by_type
描述: 获取触发区域预设的自定义值
GameAPI.customtriggerspace_prefab_get_kv_by_type(_value_type, _key, _prop)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_value_type | ValueType | 值类型 |
_key | CustomTriggerSpaceKey | 逻辑体编号 |
_prop | Str | 名称 |
返回值:
- 类型:
ETypeMeta - 说明: 自定义值
示例:
local result = GameAPI.customtriggerspace_prefab_get_kv_by_type(Enums.ValueType.Int, 110001, "示例字符串")GameAPI.customtriggerspace_prefab_get_prop_by_type
描述: 获取触发区域预设的属性
GameAPI.customtriggerspace_prefab_get_prop_by_type(_value_type, _key, _prop)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_value_type | ValueType | 值类型 |
_key | CustomTriggerSpaceKey | 逻辑体编号 |
_prop | Str | 名称 |
返回值:
- 类型:
ETypeMeta - 说明: 属性值
示例:
local result = GameAPI.customtriggerspace_prefab_get_prop_by_type(Enums.ValueType.Int, 110001, "示例字符串")GameAPI.customtriggerspace_prefab_has_kv
描述: 触发区域预设是否存在自定义值
GameAPI.customtriggerspace_prefab_has_kv(_key, _prop)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_key | CustomTriggerSpaceKey | 触发区域编号 |
_prop | Str | 名称 |
返回值:
- 类型:
Bool - 说明: 是否存在
示例:
local result = GameAPI.customtriggerspace_prefab_has_kv(110001, "示例字符串")GameAPI.decoration_prefab_get_kv_by_type
描述: 获取装饰物预设的自定义值
GameAPI.decoration_prefab_get_kv_by_type(_value_type, _key, _prop)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_value_type | ValueType | 值类型 |
_key | DecorationKey | 装饰物编号 |
_prop | Str | 名称 |
返回值:
- 类型:
ETypeMeta - 说明: 自定义值
GameAPI.decoration_prefab_has_kv
描述: 装饰物预设是否存在自定义值
GameAPI.decoration_prefab_has_kv(_decoration_key, _prop)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_decoration_key | DecorationKey | 装饰物编号 |
_prop | Str | 名称 |
返回值:
- 类型:
Bool - 说明: 是否存在
GameAPI.delay_destroy_vehicle
描述: 删除载具
GameAPI.delay_destroy_vehicle(_unit)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_unit | Vehicle | 载具 |
示例:
local vehicle = GameAPI.create_vehicle(500001, math.Vector3(0,0,0), math.Vector3(0,0,1), nil)
GameAPI.delay_destroy_vehicle(vehicle)GameAPI.eggy_team_add_bind_creature
描述: (蛋仔小队专用)绑定生物到角色
GameAPI.eggy_team_add_bind_creature(_char, _creature, _pos)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_char | Character | 角色 |
_creature | Creature | 生物 |
_pos | Vector3 | 相对位置 |
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- Character 继承自 LifeEntity,代表NPC角色单位
local creature = GameAPI.create_creature_fixed_scale(100001, math.Vector3(0,0,0), math.Quaternion(0,0,0), 1.0, GameAPI.get_all_valid_roles()[1])
GameAPI.eggy_team_add_bind_creature(npc, creature, math.Vector3(0, 0, 0))GameAPI.eggy_team_remove_bind_creature
描述: (蛋仔小队专用)移除绑定生物到角色
GameAPI.eggy_team_remove_bind_creature(_char, _creature)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_char | Character | 角色 |
_creature | Creature | 生物 |
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- Character 继承自 LifeEntity,代表NPC角色单位
local creature = GameAPI.create_creature_fixed_scale(100001, math.Vector3(0,0,0), math.Quaternion(0,0,0), 1.0, GameAPI.get_all_valid_roles()[1])
GameAPI.eggy_team_remove_bind_creature(npc, creature)GameAPI.eggy_team_set_surround_follower_angle
描述: (蛋仔小队专用)设置队形旋转角度
GameAPI.eggy_team_set_surround_follower_angle(_char, _degree)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_char | Character | 角色 |
_degree | Fixed | 角度 |
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- Character 继承自 LifeEntity,代表NPC角色单位
GameAPI.eggy_team_set_surround_follower_angle(npc, 1.0)GameAPI.eggy_team_set_surround_follower_enable_rot
描述: (蛋仔小队专用)设置队形是否跟随旋转
GameAPI.eggy_team_set_surround_follower_enable_rot(_char, _enable)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_char | Character | 角色 |
_enable | Bool | 开关 |
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- Character 继承自 LifeEntity,代表NPC角色单位
GameAPI.eggy_team_set_surround_follower_enable_rot(npc, true)GameAPI.eggy_team_set_surround_follower_speed
描述: (蛋仔小队专用)设置绑定跟随速度
GameAPI.eggy_team_set_surround_follower_speed(_char, _speed)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_char | Character | 角色 |
_speed | Fixed | 衰减速度 |
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- Character 继承自 LifeEntity,代表NPC角色单位
GameAPI.eggy_team_set_surround_follower_speed(npc, 1.0)GameAPI.enable_physics_ccd
描述: 开启/关闭物理CCD
GameAPI.enable_physics_ccd(_enable)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_enable | Bool | 开关 |
示例:
GameAPI.enable_physics_ccd(true)GameAPI.equipment_prefab_get_kv_by_type
描述: 获取物品预设的自定义值
GameAPI.equipment_prefab_get_kv_by_type(_value_type, _key, _prop)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_value_type | ValueType | 值类型 |
_key | EquipmentKey | 物品编号 |
_prop | Str | 名称 |
返回值:
- 类型:
ETypeMeta - 说明: 自定义值
GameAPI.equipment_prefab_has_kv
描述: 物品预设是否存在自定义值
GameAPI.equipment_prefab_has_kv(_equipment_key, _prop)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_equipment_key | EquipmentKey | 物品编号 |
_prop | Str | 名称 |
返回值:
- 类型:
Bool - 说明: 是否存在
示例:
local result = GameAPI.equipment_prefab_has_kv(400001, "示例字符串")GameAPI.get_all_camps
描述: 获取所有阵营
GameAPI.get_all_camps()返回值:
- 类型:
ListCamp - 说明: 阵营列表
示例:
local result = GameAPI.get_all_camps()GameAPI.get_camp
描述: 获取阵营
GameAPI.get_camp(_camp_id)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_camp_id | CampID | 阵营ID |
返回值:
- 类型:
Camp - 说明: 阵营
示例:
local result = GameAPI.get_camp(1)GameAPI.get_camp_relation
描述: 获取阵营关系
GameAPI.get_camp_relation(_camp1, _camp2)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_camp1 | Camp | 阵营 |
_camp2 | Camp | 阵营 |
返回值:
- 类型:
CampRelationType - 说明: 阵营关系
示例:
local camp = GameAPI.get_camp(1)
local result = GameAPI.get_camp_relation(camp1, camp)GameAPI.get_eui_child_by_index
描述: 根据索引获取UI节点的子UI节点
GameAPI.get_eui_child_by_index(_node, _index)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_node | ENode | UI节点 |
_index | Int | 索引 |
返回值:
- 类型:
ENode - 说明: 子UI节点
示例:
local node = LuaAPI.query_ui_node(role, "panel_main")
local result = GameAPI.get_eui_child_by_index(node, 1)GameAPI.get_eui_children_count
描述: 获取UI节点的子UI节点数量
GameAPI.get_eui_children_count(_node)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_node | ENode | UI节点 |
返回值:
- 类型:
Int - 说明: 数量
示例:
local node = LuaAPI.query_ui_node(role, "panel_main")
local result = GameAPI.get_eui_children_count(node)GameAPI.get_goods_list
描述: 获取付费商品信息列表
GameAPI.get_goods_list()返回值:
- 类型:
List - 说明: 商品列表
示例:
local result = GameAPI.get_goods_list()GameAPI.get_play_env
描述: 获取当前游玩环境
GameAPI.get_play_env()返回值:
- 类型:
Int - 说明: 游玩环境(PlayEnvType: 0单人试玩 1多人试玩 2正式游玩)
示例:
local result = GameAPI.get_play_env()GameAPI.get_sheet_cell_value
描述: 获取表格值
GameAPI.get_sheet_cell_value(_value_type, _sheet_id, _key1, _key2)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_value_type | ValueType | 值类型 |
_sheet_id | SheetID | 表格 |
_key1 | Int | 行索引 |
_key2 | Str | 列索引 |
返回值:
- 类型:
ETypeMeta - 说明: 自定义值
示例:
local sheet = GameAPI.create_sheet()
local result = GameAPI.get_sheet_cell_value(Enums.ValueType.Int, sheet, 1, "key_001")GameAPI.get_unit_id_by_name
描述: 获取单位ID
GameAPI.get_unit_id_by_name(_name)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_name | Str | 单位名称 |
返回值:
- 类型:
UnitID - 说明: 单位ID
示例:
local result = GameAPI.get_unit_id_by_name("平凡蛋0")GameAPI.has_global_kv
描述: 是否有全局变量
GameAPI.has_global_kv(_var_name)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_var_name | Str | 变量名称 |
返回值:
- 类型:
Bool - 说明: 是否含有全局变量
示例:
local result = GameAPI.has_global_kv("平凡蛋0")GameAPI.modifier_prefab_get_desc
描述: 获取效果预设描述
GameAPI.modifier_prefab_get_desc(_modifier_key)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_modifier_key | ModifierKey | 效果编号 |
返回值:
- 类型:
Str - 说明: 效果描述
示例:
local result = GameAPI.modifier_prefab_get_desc(600001)GameAPI.modifier_prefab_get_kv_by_type
描述: 获取效果预设的自定义值
GameAPI.modifier_prefab_get_kv_by_type(_value_type, _key, _prop)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_value_type | ValueType | 值类型 |
_key | ModifierKey | 效果编号 |
_prop | Str | 名称 |
返回值:
- 类型:
ETypeMeta - 说明: 自定义值
GameAPI.modifier_prefab_get_name
描述: 获取效果预设名称
GameAPI.modifier_prefab_get_name(_modifier_key)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_modifier_key | ModifierKey | 效果编号 |
返回值:
- 类型:
Str - 说明: 效果名称
示例:
local result = GameAPI.modifier_prefab_get_name(600001)GameAPI.modifier_prefab_get_prop_by_type
描述: 获取效果预设的属性
GameAPI.modifier_prefab_get_prop_by_type(_value_type, _key, _prop)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_value_type | ValueType | 值类型 |
_key | ModifierKey | 效果编号 |
_prop | Str | 名称 |
返回值:
- 类型:
ETypeMeta - 说明: 属性值
示例:
local result = GameAPI.modifier_prefab_get_prop_by_type(Enums.ValueType.Int, 600001, "示例字符串")GameAPI.modifier_prefab_has_kv
描述: 效果预设是否存在自定义值
GameAPI.modifier_prefab_has_kv(_modifier_key, _prop)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_modifier_key | ModifierKey | 效果编号 |
_prop | Str | 名称 |
返回值:
- 类型:
Bool - 说明: 是否存在
示例:
local result = GameAPI.modifier_prefab_has_kv(600001, "示例字符串")GameAPI.obstacle_prefab_get_kv_by_type
描述: 获取组件预设的自定义值
GameAPI.obstacle_prefab_get_kv_by_type(_value_type, _key, _prop)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_value_type | ValueType | 值类型 |
_key | ObstacleKey | 组件编号 |
_prop | Str | 名称 |
返回值:
- 类型:
ETypeMeta - 说明: 自定义值
示例:
local result = GameAPI.obstacle_prefab_get_kv_by_type(Enums.ValueType.Int, 200001, "示例字符串")GameAPI.obstacle_prefab_get_prop_by_type
描述: 获取组件预设的属性
GameAPI.obstacle_prefab_get_prop_by_type(_value_type, _key, _prop)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_value_type | ValueType | 值类型 |
_key | ObstacleKey | 组件编号 |
_prop | Str | 名称 |
返回值:
- 类型:
ETypeMeta - 说明: 属性值
示例:
local result = GameAPI.obstacle_prefab_get_prop_by_type(Enums.ValueType.Int, 200001, "示例字符串")GameAPI.obstacle_prefab_has_kv
描述: 组件预设是否存在自定义值
GameAPI.obstacle_prefab_has_kv(_key, _prop)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_key | ObstacleKey | 组件编号 |
_prop | Str | 名称 |
返回值:
- 类型:
Bool - 说明: 是否存在
示例:
local result = GameAPI.obstacle_prefab_has_kv(200001, "示例字符串")GameAPI.play_3d_sound
描述: 单位开始播放3d音效
GameAPI.play_3d_sound(_position, _sound_key, _duration, _volume)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_position | Point3 | 发声位置 |
_sound_key | SoundKey | 声音编号 |
_duration | Fixed | 持续时间 |
_volume | Fixed | 音量 |
返回值:
- 类型:
SoundID - 说明: 音效ID
示例:
local result = GameAPI.play_3d_sound(math.Vector3(0, 0, 0), 800001, 1.0, 1.0)GameAPI.raycast_test
描述: 物理射线检测
GameAPI.raycast_test(_start_pos, _end_pos, _collision_mask, _find_closest, _callback)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_start_pos | Point3 | 起点 |
_end_pos | Point3 | 终点 |
_collision_mask | Int | 碰撞掩码 |
_find_closest | Bool | 检测最近碰撞 |
_callback | Function | 碰撞回调(返回True停止后续回调) |
示例:
GameAPI.raycast_test(math.Vector3(0, 0, 0), math.Vector3(0, 0, 0), 1, true, function() end)GameAPI.raycast_unit
描述: 查询射线检测到的单位碰撞信息
GameAPI.raycast_unit(_start_pos, _end_pos, _include_unit_types, _raycast_handler)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_start_pos | Point3 | 起始点 |
_end_pos | Point3 | 终点 |
_include_unit_types | ListUnitType | 包含的单位类型 |
_raycast_handler | Function | 碰撞回调 |
示例:
GameAPI.raycast_unit(math.Vector3(0, 0, 0), math.Vector3(0, 0, 0), {Enums.UnitType.CHARACTER}, function() end)GameAPI.register_geometry_box
描述: 注册一个几何体:方块(可变形)
GameAPI.register_geometry_box(_size, _chamfer_radius, _chamfer_level, _use_box_collider, _preconf)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_size | Fixed | 边长 |
_chamfer_radius | Fixed | 倒角半径 |
_chamfer_level | Int | 倒角阶数(0~3) |
_use_box_collider | Bool | 精简物理(高性能) |
_preconf | Dict | 扩展配置(预留 ) |
返回值:
- 类型:
Str - 说明: 几何体路径,用于create_obstacle_from_geometry
示例:
local result = GameAPI.register_geometry_box(1.0, 1.0, 1, true, {})GameAPI.register_geometry_frustum
描述: 注册一个几何体:圆台(可变形)
GameAPI.register_geometry_frustum(_height, _inner_radius, _outer_radius, _inner_poly_count, _outer_poly_count, _chamfer_radius, _angle, _layer, _bend, _preconf)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_height | Fixed | 高度 |
_inner_radius | Fixed | 上径 |
_outer_radius | Fixed | 下径,需大于上径 |
_inner_poly_count | Int | 上多边形边数(6~15) |
_outer_poly_count | Int | 下多边形边数(6~15),需大于等于上多边形边数 |
_chamfer_radius | Fixed | 倒角半径 |
_angle | Fixed | 角度 |
_layer | Int | 分段数 |
_bend | Fixed | 弯曲度 |
_preconf | Dict | 扩展配置(预留 ) |
返回值:
- 类型:
Str - 说明: 几何体路径,用于create_obstacle_from_geometry
示例:
local result = GameAPI.register_geometry_frustum(1.0, 1.0, 1.0, 1, 1, 1.0, 1.0, 1, 1.0, {})GameAPI.register_geometry_ring
描述: 注册一个几何体:圆环(可变形)
GameAPI.register_geometry_ring(_height, _inner_radius, _outer_radius, _inner_poly_count, _outer_poly_count, _chamfer_radius, _angle, _preconf)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_height | Fixed | 高度 |
_inner_radius | Fixed | 内径 |
_outer_radius | Fixed | 外径,需大于内径 |
_inner_poly_count | Int | 内多边形边数(3~15) |
_outer_poly_count | Int | 外多边形边数(3~15),需大于等于内多边形边数 |
_chamfer_radius | Fixed | 倒角半径 |
_angle | Fixed | 角度 |
_preconf | Dict | 扩展配置(预留 ) |
返回值:
- 类型:
Str - 说明: 几何体路径,用于create_obstacle_from_geometry
示例:
local result = GameAPI.register_geometry_ring(1.0, 1.0, 1.0, 1, 1, 1.0, 1.0, {})GameAPI.register_geometry_spline
描述: 注册一个几何体:自定义曲线/曲面
GameAPI.register_geometry_spline(_is_rope, _pos_list, _normal_list, _radius_list, _dist_precision, _normal_precision, _depth, _preconf)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_is_rope | Bool | 是否为曲线 |
_pos_list | ListVector3 | 点列表 |
_normal_list | ListVector3 | 法线列表 |
_radius_list | ListFixed | 半径列表 |
_dist_precision | Fixed | 位移精度 |
_normal_precision | Fixed | 法线精度 |
_depth | Fixed | 厚度(仅用于曲面) |
_preconf | Dict | 扩展配置(预留 ) |
返回值:
- 类型:
Str - 说明: 几何体路径,用于create_obstacle_from_geometry
示例:
local result = GameAPI.register_geometry_spline(true, {math.Vector3(0, 0, 0), math.Vector3(1, 0, 0)}, {math.Vector3(0, 0, 0), math.Vector3(1, 0, 0)}, {1.0, 2.0}, 1.0, 1.0, 1.0, {})GameAPI.set_life_entity_survival_scene_boundary
描述: 设置生命体存活场景边界大小
GameAPI.set_life_entity_survival_scene_boundary(_x, _y, _z)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_x | Fixed | 矩形边界长度 |
_y | Fixed | 矩形边界高度 |
_z | Fixed | 矩形边界宽度 |
示例:
GameAPI.set_life_entity_survival_scene_boundary(1.0, 1.0, 1.0)GameAPI.set_sheet_cell_value
描述: 设置表格值
GameAPI.set_sheet_cell_value(_value_type, _sheet_id, _key1, _key2, _val)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_value_type | ValueType | 值类型 |
_sheet_id | SheetID | 表格 |
_key1 | Int | 行索引 |
_key2 | Str | 列索引 |
_val | ETypeMeta | 自定义值 |
示例:
local sheet = GameAPI.create_sheet()
GameAPI.set_sheet_cell_value(Enums.ValueType.Int, sheet, 1, "key_001", nil --[[ETypeMeta]])GameAPI.set_unit_survival_scene_boundary
描述: 设置组件存活场景边界大小
GameAPI.set_unit_survival_scene_boundary(_x, _y, _z)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_x | Fixed | 矩形边界长度 |
_y | Fixed | 矩形边界高度 |
_z | Fixed | 矩形边界宽度 |
示例:
GameAPI.set_unit_survival_scene_boundary(1.0, 1.0, 1.0)GameAPI.sweep_test
描述: 物理扫描检测
GameAPI.sweep_test(_body_unit, _test_dir, _max_dist, _collision_mask, _find_closest, _callback)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_body_unit | Unit | 探测单位 |
_test_dir | Vector3 | 探测方向 |
_max_dist | Fixed | 最大距离 |
_collision_mask | Int | 碰撞掩码 |
_find_closest | Bool | 检测最近碰撞 |
_callback | Function | 碰撞回调(返回True停止后续回调) |
示例:
local role = GameAPI.get_all_valid_roles()[1]
GameAPI.sweep_test(role, math.Vector3(0, 0, 0), 1.0, 1, true, function() end)GameAPI.triggerspace_prefab_get_kv_by_type
描述: 获取逻辑体预设的自定义值
GameAPI.triggerspace_prefab_get_kv_by_type(_value_type, _key, _prop)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_value_type | ValueType | 值类型 |
_key | TriggerSpaceKey | 逻辑体编号 |
_prop | Str | 名称 |
返回值:
- 类型:
ETypeMeta - 说明: 自定义值
示例:
local result = GameAPI.triggerspace_prefab_get_kv_by_type(Enums.ValueType.Int, 900001, "示例字符串")GameAPI.triggerspace_prefab_get_prop_by_type
描述: 获取逻辑体预设的属性
GameAPI.triggerspace_prefab_get_prop_by_type(_value_type, _key, _prop)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_value_type | ValueType | 值类型 |
_key | TriggerSpaceKey | 逻辑体编号 |
_prop | Str | 名称 |
返回值:
- 类型:
ETypeMeta - 说明: 属性值
示例:
local result = GameAPI.triggerspace_prefab_get_prop_by_type(Enums.ValueType.Int, 900001, "示例字符串")GameAPI.triggerspace_prefab_has_kv
描述: 逻辑体预设是否存在自定义值
GameAPI.triggerspace_prefab_has_kv(_key, _prop)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_key | TriggerSpaceKey | 逻辑体编号 |
_prop | Str | 名称 |
返回值:
- 类型:
Bool - 说明: 是否存在
示例:
local result = GameAPI.triggerspace_prefab_has_kv(900001, "示例字符串")单位API
Ability.enter_cd
描述: 技能激活冷却
Ability.enter_cd()示例:
local role = GameAPI.get_all_valid_roles()[1]
local ability = role.add_ability_to_slot(1, 150001, {}, {})
ability.enter_cd()Ability.add_state_to_target
描述: 技能给单位添加状态
Ability.add_state_to_target(_unit, _state_id)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_unit | Unit | 对象 |
_state_id | BuffState | 状态 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
local ability = role.add_ability_to_slot(1, 150001, {}, {})
local role = GameAPI.get_all_valid_roles()[1]
ability.add_state_to_target(role, Enums.BuffState.CANNOT_MOVE)Ability.change_affect_radius
描述: 修改技能作用半径
Ability.change_affect_radius(_delta_affect_radius)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_delta_affect_radius | Fixed | 修改技能作用半径 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
local ability = role.add_ability_to_slot(1, 150001, {}, {})
ability.change_affect_radius(1.0)Ability.change_affect_width
描述: 修改技能作用宽度
Ability.change_affect_width(_delta_affect_width)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_delta_affect_width | Fixed | 修改技能作用宽度 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
local ability = role.add_ability_to_slot(1, 150001, {}, {})
ability.change_affect_width(1.0)Ability.change_max_release_distance
描述: 修改技能施法距离
Ability.change_max_release_distance(_delta_level)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_delta_level | Fixed | 修改技能施法距离 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
local ability = role.add_ability_to_slot(1, 150001, {}, {})
ability.change_max_release_distance(1.0)Ability.downgrade_ability_level
描述: 降级技能等级
Ability.downgrade_ability_level(_delta_level)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_delta_level | Int | 降低的技能等级 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
local ability = role.add_ability_to_slot(1, 150001, {}, {})
ability.downgrade_ability_level(1)Ability.get_affect_radius
描述: 获取技能的作用半径
Ability.get_affect_radius()返回值:
- 类型:
Fixed - 说明: 施法距离
示例:
local role = GameAPI.get_all_valid_roles()[1]
local ability = role.add_ability_to_slot(1, 150001, {}, {})
local result = ability.get_affect_radius()Ability.get_affect_width
描述: 获取技能的作用宽度
Ability.get_affect_width()返回值:
- 类型:
Fixed - 说明: 施法距离
示例:
local role = GameAPI.get_all_valid_roles()[1]
local ability = role.add_ability_to_slot(1, 150001, {}, {})
local result = ability.get_affect_width()Ability.get_charge_time
描述: 获取技能充能时间
Ability.get_charge_time()返回值:
- 类型:
Fixed - 说明: 充能时间
示例:
local role = GameAPI.get_all_valid_roles()[1]
local ability = role.add_ability_to_slot(1, 150001, {}, {})
local result = ability.get_charge_time()Ability.get_ability_level
描述: 获取技能的等级
Ability.get_ability_level()返回值:
- 类型:
Int - 说明: 技能等级
示例:
local role = GameAPI.get_all_valid_roles()[1]
local ability = role.add_ability_to_slot(1, 150001, {}, {})
local result = ability.get_ability_level()Ability.get_ability_max_level
描述: 获取技能的最大等级
Ability.get_ability_max_level()返回值:
- 类型:
Int - 说明: 技能最大等级
示例:
local role = GameAPI.get_all_valid_roles()[1]
local ability = role.add_ability_to_slot(1, 150001, {}, {})
local result = ability.get_ability_max_level()Ability.get_max_release_distance
描述: 获取技能的施法距离
Ability.get_max_release_distance()返回值:
- 类型:
Fixed - 说明: 施法距离
示例:
local role = GameAPI.get_all_valid_roles()[1]
local ability = role.add_ability_to_slot(1, 150001, {}, {})
local result = ability.get_max_release_distance()Ability.upgrade_ability_level
描述: 增加技能等级
Ability.upgrade_ability_level(_delta_level)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_delta_level | Int | 增加的技能等级 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
local ability = role.add_ability_to_slot(1, 150001, {}, {})
ability.upgrade_ability_level(1)Ability.set_affect_radius
描述: 设置技能的作用半径
Ability.set_affect_radius(_new_affect_radius)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_new_affect_radius | Fixed | 作用半径 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
local ability = role.add_ability_to_slot(1, 150001, {}, {})
ability.set_affect_radius(1.0)Ability.set_affect_width
描述: 设置技能的作用宽度
Ability.set_affect_width(_new_affect_width)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_new_affect_width | Fixed | 作用宽度 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
local ability = role.add_ability_to_slot(1, 150001, {}, {})
ability.set_affect_width(1.0)Ability.set_ability_level
描述: 设置技能等级
Ability.set_ability_level(_new_level)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_new_level | Int | 技能等级 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
local ability = role.add_ability_to_slot(1, 150001, {}, {})
ability.set_ability_level(1)Ability.set_ability_max_level
描述: 设置技能最大等级
Ability.set_ability_max_level(_new_max_level)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_new_max_level | Int | 技能最大等级 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
local ability = role.add_ability_to_slot(1, 150001, {}, {})
ability.set_ability_max_level(1)Ability.set_max_release_distance
描述: 设置技能的施法距离
Ability.set_max_release_distance(_new_max_release_distance)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_new_max_release_distance | Fixed | 施法距离 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
local ability = role.add_ability_to_slot(1, 150001, {}, {})
ability.set_max_release_distance(1.0)Ability.begin_cast
描述: 技能开始释放
Ability.begin_cast(_dir_info, _target_point, _target_unit)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_dir_info | Vector3 | 方向 |
_target_point | Point3 | 坐标点 |
_target_unit | Unit | 目标单位 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
local ability = role.add_ability_to_slot(1, 150001, {}, {})
local role = GameAPI.get_all_valid_roles()[1]
ability.begin_cast(math.Vector3(0, 0, 0), math.Vector3(0, 0, 0), role)Ability.get_cur_release_num
描述: 获取技能当前使用次数
Ability.get_cur_release_num()返回值:
- 类型:
Int - 说明: 使用次数
示例:
local role = GameAPI.get_all_valid_roles()[1]
local ability = role.add_ability_to_slot(1, 150001, {}, {})
local result = ability.get_cur_release_num()Ability.get_max_release_num
描述: 获取技能最大使用次数
Ability.get_max_release_num()返回值:
- 类型:
Int - 说明: 最大使用次数
示例:
local role = GameAPI.get_all_valid_roles()[1]
local ability = role.add_ability_to_slot(1, 150001, {}, {})
local result = ability.get_max_release_num()Ability.remove_state_to_target
描述: 技能给单位移除状态
Ability.remove_state_to_target(_unit, _state_id)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_unit | Unit | 对象 |
_state_id | BuffState | 状态 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
local ability = role.add_ability_to_slot(1, 150001, {}, {})
local role = GameAPI.get_all_valid_roles()[1]
ability.remove_state_to_target(role, Enums.BuffState.CANNOT_MOVE)AbilityComp.reset_ability_cd
描述: 重置指定槽位技能CD
AbilityComp.reset_ability_cd(_ability_index)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_ability_index | AbilitySlot | 技能槽位 |
示例:
local ability_slot = 1 -- AbilitySlot 是槽位整数索引
abilityComp.reset_ability_cd(ability_index)ItemBox.add_ability
描述: 添加道具箱刷新技能
ItemBox.add_ability(_ability_key, _weight)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_ability_key | AbilityKey | 技能编号 |
_weight | Int | 权重 |
示例:
itemBox.add_ability(150001, 1)Role.add_achievement_progress
描述: 增加成就进度
Role.add_achievement_progress(_event_id, _add_count)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_event_id | Achievement | 成就 |
_add_count | Int | 成就进度 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
local achievement = 1 -- Achievement 是成就编号(integer)
role.add_achievement_progress(event_id, 1)BuffStateComp.add_state
描述: 为对象添加状态
BuffStateComp.add_state(_state_id)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_state_id | BuffState | 状态 |
示例:
buffStateComp.add_state(Enums.BuffState.CANNOT_MOVE)Unit.add_child
描述: 添加子单位
Unit.add_child(_unit)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_unit | Unit | 子单位 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.add_child(role)Equipment.change_current_stack_size
描述: 增加/减少物品当前堆叠数
Equipment.change_current_stack_size(_num)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_num | Int | 堆叠数 |
示例:
local equipment = GameAPI.create_equipment(400001, math.Vector3(0,0,0))
equipment.change_current_stack_size(1)Equipment.change_max_stack_size
描述: 增加/减少物品最大堆叠数
Equipment.change_max_stack_size(_num)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_num | Int | 堆叠数 |
示例:
local equipment = GameAPI.create_equipment(400001, math.Vector3(0,0,0))
equipment.change_max_stack_size(1)AbilityComp.add_prop_ability
描述: 添加道具技能
AbilityComp.add_prop_ability(_ability_id, _kv_args, _kv_types)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_ability_id | AbilityKey | 技能编号 |
_kv_args | Dict | 自定义参数值 |
_kv_types | Dict | 自定义参数类型 |
返回值:
- 类型:
Ability - 说明: 添加上的技能
示例:
local ability_with_params = abilityComp.add_prop_ability(150002, {
damage = 100.0, -- 伤害值
cooldown = 5.0, -- 冷却时间(秒)
range = 10.0, -- 施法范围
level = 3, -- 技能等级
is_passive = false -- 是否被动技能
}, {
damage = "Fixed", -- 伤害值类型
cooldown = "Fixed", -- 冷却时间类型
range = "Fixed", -- 施法范围类型
level = "Int", -- 技能等级类型
is_passive = "Bool" -- 是否被动技能类型
})ModifierComp.add_modifier_by_key
描述: 添加效果
ModifierComp.add_modifier_by_key(_modifier_id, _params_dict)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_modifier_id | ModifierKey | 效果编号 |
_params_dict | Dict | 额外参数 |
返回值:
- 类型:
Modifier - 说明: 效果对象
示例:
local modifier_with_params = modifierComp.add_modifier_by_key(600002, {
source_unit = attacker, -- 效果来源单位
duration = 10.0, -- 持续时间(秒)
owner_ability = ability -- 所属技能对象
})Modifier.add_duration
描述: 增加效果的持续时间
Modifier.add_duration(_add_time)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_add_time | Fixed | 增加时间 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
local modifier = role.add_modifier_by_key(600001, {})
modifier.add_duration(1.0)Modifier.add_stack_count
描述: 增加效果层数
Modifier.add_stack_count(_stack_count_add)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_stack_count_add | Int | 层数 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
local modifier = role.add_modifier_by_key(600001, {})
modifier.add_stack_count(1)AbilityComp.add_ability_to_slot
描述: 添加向技能槽位添加UGC技能能
AbilityComp.add_ability_to_slot(_ability_index, _ability_id, _kv_args, _kv_types)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_ability_index | AbilitySlot | 技能槽位 |
_ability_id | AbilityKey | 技能编号 |
_kv_args | Dict | 自定义参数值 |
_kv_types | Dict | 自定义参数类型 |
返回值:
- 类型:
Ability - 说明: 添加上的技能
示例:
local ability_slot = 1 -- AbilitySlot 是槽位整数索引(1~N)
local ability_with_params = abilityComp.add_ability_to_slot(ability_slot, 150002, {
damage = 200.0, -- 技能伤害
cooldown = 8.0, -- 冷却时间(秒)
range = 15.0, -- 施法范围
level = 5, -- 初始等级
can_crit = true -- 是否可暴击
}, {
damage = "Fixed",
cooldown = "Fixed",
range = "Fixed",
level = "Int",
can_crit = "Bool"
})LifeEntity.ai_command_alert
描述: 控制AI执行警戒命令
LifeEntity.ai_command_alert(_tagert_pos, _target_dir, _dalay_time, _reject_time, _move_mode)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_tagert_pos | Vector3 | 目标 |
_target_dir | Vector3 | 朝向 |
_dalay_time | Fixed | 延迟 |
_reject_time | Fixed | 厌恶时间 |
_move_mode | MoveMode | 移动方式 |
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- NPC单位,AI行为的执行者
npc.ai_command_alert(math.Vector3(0, 0, 0), math.Vector3(0, 0, 0), 1.0, 1.0, Enums.MoveMode.DEFAULT)LifeEntity.ai_command_follow
描述: 控制AI执行跟随命令
LifeEntity.ai_command_follow(_target_unit, _follow_dis, _tolerate_dis, _reject_time, _move_mode)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_target_unit | Unit | 目标 |
_follow_dis | Fixed | 距离 |
_tolerate_dis | Fixed | 容忍距离 |
_reject_time | Fixed | 厌恶时间 |
_move_mode | MoveMode | 移动方式 |
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- NPC单位,AI行为的执行者
local role = GameAPI.get_all_valid_roles()[1]
npc.ai_command_follow(role, 1.0, 1.0, 1.0, Enums.MoveMode.DEFAULT)LifeEntity.ai_command_imitate
描述: 控制AI执行模仿命令
LifeEntity.ai_command_imitate(_target_unit, _delay, _disable_actions)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_target_unit | Character | 目标 |
_delay | Fixed | 延迟 |
_disable_actions | ListAIBasicCommand | 屏蔽操作 |
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- NPC单位,AI行为的执行者
local npc = LuaAPI.query_unit("平凡蛋0") -- Character 继承自 LifeEntity,代表NPC角色单位
npc.ai_command_imitate(npc, 1.0, {Enums.AIBasicCommand.MOVE})LifeEntity.ai_command_jump
描述: 控制AI跳跃
LifeEntity.ai_command_jump()示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- NPC单位,AI行为的执行者
npc.ai_command_jump()LifeEntity.ai_command_lift
描述: 控制AI举起/扔下/投掷
LifeEntity.ai_command_lift()示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- NPC单位,AI行为的执行者
npc.ai_command_lift()LifeEntity.ai_command_patrol
描述: 控制AI执行巡逻命令
LifeEntity.ai_command_patrol(_waypoint, _reject_time, _round_mode, _move_mode)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_waypoint | ListVector3 | 路径 |
_reject_time | Fixed | 厌恶时间 |
_round_mode | PatrolType | 往返模式 |
_move_mode | MoveMode | 移动方式 |
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- NPC单位,AI行为的执行者
npc.ai_command_patrol({math.Vector3(0, 0, 0), math.Vector3(1, 0, 0)}, 1.0, Enums.PatrolType.LOOP, Enums.MoveMode.DEFAULT)LifeEntity.ai_command_pick_up_equipment
描述: 控制AI拾取物品
LifeEntity.ai_command_pick_up_equipment(_target_equipment, _move_mode, _reject_time)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_target_equipment | Equipment | 拾取物品 |
_move_mode | MoveMode | 移动方式 |
_reject_time | Fixed | 厌恶时间 |
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- NPC单位,AI行为的执行者
local equipment = GameAPI.create_equipment(400001, math.Vector3(0,0,0))
npc.ai_command_pick_up_equipment(equipment, Enums.MoveMode.DEFAULT, 1.0)LifeEntity.ai_command_roll
描述: 控制AI滚动
LifeEntity.ai_command_roll()示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- NPC单位,AI行为的执行者
npc.ai_command_roll()LifeEntity.ai_command_rush
描述: 控制AI前扑
LifeEntity.ai_command_rush()示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- NPC单位,AI行为的执行者
npc.ai_command_rush()LifeEntity.ai_command_start_move
描述: 控制AI单位移动
LifeEntity.ai_command_start_move(_direction, _t)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_direction | Vector3 | 方向 |
_t | Fixed | 时间 |
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- NPC单位,AI行为的执行者
npc.ai_command_start_move(math.Vector3(0, 0, 0), 1.0)LifeEntity.ai_command_stop_move
描述: 控制AI单位停止移动
LifeEntity.ai_command_stop_move(_duration)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_duration | Fixed | 时间 |
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- NPC单位,AI行为的执行者
npc.ai_command_stop_move(1.0)LifeEntity.set_ai_move_threshold
描述: 设置寻路阈值
LifeEntity.set_ai_move_threshold(_threshold)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_threshold | Fixed | 距离 |
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- NPC单位,AI行为的执行者
npc.set_ai_move_threshold(1.0)Unit.apply_force
描述: 对单位施加外力
Unit.apply_force(_force)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_force | Vector3 | 力 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.apply_force(math.Vector3(0, 0, 0))Ability.break_accumulate
描述: 打断蓄力
Ability.break_accumulate()示例:
local role = GameAPI.get_all_valid_roles()[1]
local ability = role.add_ability_to_slot(1, 150001, {}, {})
ability.break_accumulate()Ability.break_cast
描述: 打断技能施法
Ability.break_cast()示例:
local role = GameAPI.get_all_valid_roles()[1]
local ability = role.add_ability_to_slot(1, 150001, {}, {})
ability.break_cast()Camp.set_camp_score
描述: 设置阵营积分
Camp.set_camp_score(_score)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_score | Int | 积分 |
示例:
local camp = GameAPI.get_camp(1)
camp.set_camp_score(1)LifeComp.is_infinite_reborn
描述: 是否无限复活
LifeComp.is_infinite_reborn()返回值:
- 类型:
Bool - 说明: 是否无限复活
示例:
local result = lifeComp.is_infinite_reborn()LifeComp.can_reborn
描述: 生物是否可以复活
LifeComp.can_reborn()返回值:
- 类型:
Bool - 说明: 是否可以复活
示例:
local result = lifeComp.can_reborn()Character.set_character_prefab
描述: 改变角色预设
Character.set_character_prefab(_c_key, _reset_prop, _reset_trigger_system, _reset_model)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_c_key | CharacterKey | 角色预设 |
_reset_prop | Bool | 重置属性 |
_reset_trigger_system | Bool | 重置蛋码 |
_reset_model | Bool | 重置外观 |
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- Character 继承自 LifeEntity,代表NPC角色单位
npc.set_character_prefab(100001, true, true, true)Unit.set_paint_area_color
描述: 改变组件颜色
Unit.set_paint_area_color(_paint_area, _color)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_paint_area | PaintArea | 染色区域 |
_color | Color | 颜色 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.set_paint_area_color(Enums.ColorPaintAreaType.AREA_1, math.Color(1, 0, 0, 1))LifeComp.set_auto_reborn_enabled
描述: 设置自动复活
LifeComp.set_auto_reborn_enabled(_auto_reborn)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_auto_reborn | Bool | 是否自动复活 |
示例:
lifeComp.set_auto_reborn_enabled(true)AbilityComp.break_ability_accumulate
描述: 打断技能蓄力
AbilityComp.break_ability_accumulate()示例:
abilityComp.break_ability_accumulate()AbilityComp.interrupt_ability
描述: 打断技能施法
AbilityComp.interrupt_ability()示例:
abilityComp.interrupt_ability()Character.set_socket_model
描述: 修改角色指定外观部位为自定义模型
Character.set_socket_model(_model_socket, _creature, _creature_model_socket)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_model_socket | ModelSocket | 外观部位 |
_creature | Creature | 生物 |
_creature_model_socket | ModelSocket | 外观部位 |
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- Character 继承自 LifeEntity,代表NPC角色单位
local creature = GameAPI.create_creature_fixed_scale(100001, math.Vector3(0,0,0), math.Quaternion(0,0,0), 1.0, GameAPI.get_all_valid_roles()[1])
npc.set_socket_model(Enums.ModelSocket.socket_root, creature, Enums.ModelSocket.socket_root)LifeEntity.set_model_by_creature
描述: 根据生物设置模型
LifeEntity.set_model_by_creature(_creature, _include_custom_model, _inherit_scale, _inherit_capsule_size)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_creature | Creature | 生物 |
_include_custom_model | Bool | 是否包含自定义形象 |
_inherit_scale | Bool | 是否继承缩放 |
_inherit_capsule_size | Bool | 是否继承胶囊体尺寸 |
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- NPC单位,AI行为的执行者
local creature = GameAPI.create_creature_fixed_scale(100001, math.Vector3(0,0,0), math.Quaternion(0,0,0), 1.0, GameAPI.get_all_valid_roles()[1])
npc.set_model_by_creature(creature, true, true, true)Character.lift
描述: 命令角色抓举
Character.lift()示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- Character 继承自 LifeEntity,代表NPC角色单位
npc.lift()Character.start_move_to_pos
描述: 命令角色移动到坐标点
Character.start_move_to_pos(_target_pos, _duration)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_target_pos | Point3 | 坐标点 |
_duration | Fixed | 持续时间 |
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- Character 继承自 LifeEntity,代表NPC角色单位
npc.start_move_to_pos(math.Vector3(0, 0, 0), 1.0)Character.fling_rush
描述: 命令角色前扑
Character.fling_rush()示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- Character 继承自 LifeEntity,代表NPC角色单位
npc.fling_rush()AbilityComp.destroy_ability
描述: 销毁技能
AbilityComp.destroy_ability(_ability)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_ability | Ability | 技能对象 |
返回值:
- 类型:
Bool - 说明: 是否成功移除
示例:
local role = GameAPI.get_all_valid_roles()[1]
local ability = role.add_ability_to_slot(1, 150001, {}, {})
local result = abilityComp.destroy_ability(ability)LifeComp.die
描述: 使生物死亡
LifeComp.die(_dmg_unit)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_dmg_unit | Unit | 伤害来源 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
lifeComp.die(role)LifeEntity.try_enter_vehicle
描述: 生命体尝试上载具
LifeEntity.try_enter_vehicle(_vehicle)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_vehicle | Vehicle | 载具 |
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- NPC单位,AI行为的执行者
local vehicle = GameAPI.create_vehicle(500001, math.Vector3(0,0,0), math.Vector3(0,0,1), nil)
npc.try_enter_vehicle(vehicle)LifeEntity.try_exit_vehicle
描述: 生命体尝试下载具
LifeEntity.try_exit_vehicle()示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- NPC单位,AI行为的执行者
npc.try_exit_vehicle()AttrComp.get_attr_base_extra_fixed
描述: 获取属性的基础加成值(复杂模式)
AttrComp.get_attr_base_extra_fixed(_key)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_key | Str | 属性名 |
返回值:
- 类型:
Fixed - 说明: 基础加成值
示例:
local result = attrComp.get_attr_base_extra_fixed("key_001")AttrComp.get_attr_bonus_fixed
描述: 获取属性的额外固定值(复杂模式)
AttrComp.get_attr_bonus_fixed(_key)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_key | Str | 属性名 |
返回值:
- 类型:
Fixed - 说明: 额外固定值
示例:
local result = attrComp.get_attr_bonus_fixed("key_001")AttrComp.get_attr_ratio_fixed
描述: 获取属性的倍率值(复杂模式)
AttrComp.get_attr_ratio_fixed(_key)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_key | Str | 属性名 |
返回值:
- 类型:
Fixed - 说明: 倍率值
示例:
local result = attrComp.get_attr_ratio_fixed("key_001")AttrComp.get_attr_raw_fixed
描述: 获取属性的基础值(复杂模式)
AttrComp.get_attr_raw_fixed(_key)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_key | Str | 属性名 |
返回值:
- 类型:
Fixed - 说明: 基础值
示例:
local result = attrComp.get_attr_raw_fixed("key_001")LifeComp.set_infinite_reborn_enabled
描述: 设置无限复活
LifeComp.set_infinite_reborn_enabled(_enable_reborn)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_enable_reborn | Bool | 是否无限复活 |
示例:
lifeComp.set_infinite_reborn_enabled(true)LifeEntity.is_ghost_mode
描述: 生命体是否进入魂蛋模式
LifeEntity.is_ghost_mode()返回值:
- 类型:
Bool - 说明: 是否处于魂蛋模式
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- NPC单位,AI行为的执行者
local result = npc.is_ghost_mode()Unit.get_local_offset_position
描述: 获取单位局部偏移位置
Unit.get_local_offset_position(_offset)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_offset | Vector3 | 偏移向量 |
返回值:
- 类型:
Point3 - 说明: 偏移位置
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = role.get_local_offset_position(math.Vector3(0, 0, 0))LifeComp.reborn
描述: 使生物复活
LifeComp.reborn(_immediate)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_immediate | Bool | 立即复活 |
示例:
lifeComp.reborn(true)LifeComp.set_reborn_time
描述: 设置复活时间
LifeComp.set_reborn_time(_reborn_time)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_reborn_time | Fixed | 复活时间 |
示例:
lifeComp.set_reborn_time(1.0)LifeEntity.reset_model
描述: 还原模型变化
LifeEntity.reset_model()示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- NPC单位,AI行为的执行者
npc.reset_model()Character.reset_target_socket_model
描述: 还原角色指定外观部位变化
Character.reset_target_socket_model(_model_socket)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_model_socket | ModelSocket | 外观部位 |
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- Character 继承自 LifeEntity,代表NPC角色单位
npc.reset_target_socket_model(Enums.ModelSocket.socket_root)ModifierComp.destroy_modifier
描述: 销毁效果
ModifierComp.destroy_modifier(_modifier)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_modifier | Modifier | 效果对象 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
local modifier = role.add_modifier_by_key(600001, {})
modifierComp.destroy_modifier(modifier)AbilityComp.set_ability_to_slot
描述: 替换技能槽位(UGC槽位)
AbilityComp.set_ability_to_slot(_ability, _ability_index)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_ability | Ability | 技能对象 |
_ability_index | AbilitySlot | 技能槽位 |
返回值:
- 类型:
Ability - 说明: 被替换的旧技能
示例:
local role = GameAPI.get_all_valid_roles()[1]
local ability = role.add_ability_to_slot(1, 150001, {}, {})
local ability_slot = 1 -- AbilitySlot 是槽位整数索引
local result = abilityComp.set_ability_to_slot(ability, ability_index)LifeEntity.set_direction
描述: 设置生命实体的朝向
LifeEntity.set_direction(_face_dir)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_face_dir | Vector3 | 方向 |
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- NPC单位,AI行为的执行者
npc.set_direction(math.Vector3(0, 0, 0))MoveStatusComp.start_face_lock_target
描述: 开始锁定面向目标
MoveStatusComp.start_face_lock_target(_target_unit, _time)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_target_unit | Unit | 锁定对象 |
_time | Fixed | 持续时间 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
moveStatusComp.start_face_lock_target(role, 1.0)MoveStatusComp.stop_face_lock_target
描述: 结束锁定面向目标
MoveStatusComp.stop_face_lock_target()示例:
moveStatusComp.stop_face_lock_target()CharacterComp.start_forced_move
描述: 开始强制位移
CharacterComp.start_forced_move(_vel, _duration, _enable_phy)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_vel | Vector3 | 移动速度 |
_duration | Fixed | 持续时间 |
_enable_phy | Bool | 是否保留物理 |
示例:
characterComp.start_forced_move(math.Vector3(0, 0, 0), 1.0, true)AttrComp.change_attr_bonus_fixed
描述: 改变属性的额外固定值(复杂模式)
AttrComp.change_attr_bonus_fixed(_key, _value)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_key | Str | 属性名 |
_value | Fixed | 额外固定值 |
示例:
attrComp.change_attr_bonus_fixed("key_001", 1.0)AttrComp.change_attr_ratio_fixed
描述: 改变属性的倍率值(复杂模式)
AttrComp.change_attr_ratio_fixed(_key, _value)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_key | Str | 属性名 |
_value | Fixed | 倍率值 |
示例:
attrComp.change_attr_ratio_fixed("key_001", 1.0)AttrComp.change_attr_raw_fixed
描述: 改变属性的基础值(复杂模式)
AttrComp.change_attr_raw_fixed(_key, _value)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_key | Str | 属性名 |
_value | Fixed | 基础值 |
示例:
attrComp.change_attr_raw_fixed("key_001", 1.0)CharacterComp.stop_forced_move
描述: 退出当前强制位移
CharacterComp.stop_forced_move()示例:
characterComp.stop_forced_move()LiftComp.lift_unit
描述: 举起单位
LiftComp.lift_unit(_unit)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_unit | Unit | 被抓举单位 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
liftComp.lift_unit(role)BuffStateComp.clear_state
描述: 清空对象身上所有状态
BuffStateComp.clear_state(_state_id)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_state_id | BuffState | 状态 |
示例:
buffStateComp.clear_state(Enums.BuffState.CANNOT_MOVE)KVBase.clear_kv
描述: 清空自定义值
KVBase.clear_kv()示例:
kVBase.clear_kv()EquipmentComp.clear_selected_equipment_slot
描述: 清除单位物品格选中状态
EquipmentComp.clear_selected_equipment_slot()示例:
equipmentComp.clear_selected_equipment_slot()KVBase.clear_tag
描述: 清空标签
KVBase.clear_tag()示例:
kVBase.clear_tag()Role.consume_commodity
描述: 消耗玩家指定数量道具
Role.consume_commodity(_commodity_id, _num)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_commodity_id | UgcCommodity | 道具 |
_num | Int | 数量 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.consume_commodity(ugc_commodity, 1)EquipmentComp.create_equipment_to_slot
描述: 创建物品到指定类型槽位
EquipmentComp.create_equipment_to_slot(_key, _slot_type)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_key | EquipmentKey | 物品编号 |
_slot_type | EquipmentSlotType | 槽位类型 |
返回值:
- 类型:
Equipment - 说明: 创建的物品
示例:
local result = equipmentComp.create_equipment_to_slot(400001, Enums.EquipmentSlotType.EQUIPPED)SceneUI.create_scene_ui_bind_unit
描述: 创建场景界面绑定到单位
SceneUI.create_scene_ui_bind_unit(_layer_key, _socket_name, _offset_pos, _duration, _bind_event, _inherit_visible)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_layer_key | E3DLayerKey | 场景界面预设编号 |
_socket_name | ModelSocket | 绑定位置 |
_offset_pos | Point3 | 偏移位置 |
_duration | Fixed | 持续时间 |
_bind_event | Bool | 事件是否指向绑定者 |
_inherit_visible | Bool | 是否跟随组件显隐 |
返回值:
- 类型:
E3DLayer - 说明: 场景界面
示例:
local result = sceneUI.create_scene_ui_bind_unit(120001, Enums.ModelSocket.socket_root, math.Vector3(0, 0, 0), 1.0, true, true)DisplayComp.add_banned_anim
描述: 临时屏蔽部分动画的播放
DisplayComp.add_banned_anim(_anim_name)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_anim_name | Str | 动画名 |
示例:
displayComp.add_banned_anim("平凡蛋0")Unit.apply_impact_force
描述: 施加冲击力
Unit.apply_impact_force(_force, _max_speed, _force_lost_control, _lost_ctrl_time)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_force | Vector3 | 力 |
_max_speed | Fixed | 击飞最大速度 |
_force_lost_control | Bool | 是否击飞 |
_lost_ctrl_time | Fixed | 击飞失控时间 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.apply_impact_force(math.Vector3(0, 0, 0), 1.0, true, 1.0)LifeEntity.set_model_by_character
描述: 根据角色设置模型
LifeEntity.set_model_by_character(_character, _include_ugc_model, _inherit_scale, _inherit_capsule_size)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_character | Character | 角色 |
_include_ugc_model | Bool | 是否包含自定义形象 |
_inherit_scale | Bool | 是否继承缩放 |
_inherit_capsule_size | Bool | 是否继承胶囊体尺寸 |
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- NPC单位,AI行为的执行者
local npc = LuaAPI.query_unit("平凡蛋0") -- Character 继承自 LifeEntity,代表NPC角色单位
npc.set_model_by_character(npc, true, true, true)OwnerComp.change_owner
描述: 修改所属玩家
OwnerComp.change_owner(_role)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_role | Role | 所属玩家 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
ownerComp.change_owner(role)DisplayComp.clear_banned_anim
描述: 清除动画屏蔽
DisplayComp.clear_banned_anim()示例:
displayComp.clear_banned_anim()Unit.get_name
描述: 获取单位名称
Unit.get_name()返回值:
- 类型:
Str - 说明: 名称
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = role.get_name()CharacterComp.get_scale_ratio
描述: 获取缩放倍率
CharacterComp.get_scale_ratio()返回值:
- 类型:
Fixed - 说明: 缩放倍率
示例:
local result = characterComp.get_scale_ratio()Unit.hide_bubble_msg
描述: 关闭气泡信息
Unit.hide_bubble_msg()示例:
local role = GameAPI.get_all_valid_roles()[1]
role.hide_bubble_msg()DisplayComp.play_body_anim_by_id
描述: 播放全身动画
DisplayComp.play_body_anim_by_id(_anim_id, _start_time, _play_time, _is_loop)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_anim_id | AnimKey | 动画编号 |
_start_time | Fixed | 开始时间 |
_play_time | Fixed | 持续时间 |
_is_loop | Bool | 是否循环 |
示例:
displayComp.play_body_anim_by_id(250001, 1.0, 1.0, true)Unit.play_emoji
描述: 单位发送表情
Unit.play_emoji(_emoji_key)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_emoji_key | EmojiKey | 表情编号 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.play_emoji(270001)DisplayComp.play_upper_anim_by_id
描述: 播放上半身动画
DisplayComp.play_upper_anim_by_id(_anim_id, _start_time, _play_time, _is_loop)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_anim_id | AnimKey | 动画编号 |
_start_time | Fixed | 开始时间 |
_play_time | Fixed | 持续时间 |
_is_loop | Bool | 是否循环 |
示例:
displayComp.play_upper_anim_by_id(250001, 1.0, 1.0, true)DisplayComp.remove_banned_anim
描述: 解除部分动画的播放屏蔽
DisplayComp.remove_banned_anim(_anim_name)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_anim_name | Str | 动画名 |
示例:
displayComp.remove_banned_anim("平凡蛋0")DisplayComp.set_anim_rate
描述: 设置播放速率
DisplayComp.set_anim_rate(_anim_rate)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_anim_rate | Fixed | 播放速率 |
示例:
displayComp.set_anim_rate(1.0)Creature.set_draggable
描述: 设置生物是否可拖动
Creature.set_draggable(_enable)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_enable | Bool | 是否可拖动 |
示例:
local creature = GameAPI.create_creature_fixed_scale(100001, math.Vector3(0,0,0), math.Quaternion(0,0,0), 1.0, GameAPI.get_all_valid_roles()[1])
creature.set_draggable(true)Creature.set_name
描述: 设置生物的显示名称
Creature.set_name(_name)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_name | Str | 显示名称 |
示例:
local creature = GameAPI.create_creature_fixed_scale(100001, math.Vector3(0,0,0), math.Quaternion(0,0,0), 1.0, GameAPI.get_all_valid_roles()[1])
creature.set_name("平凡蛋0")Creature.set_name_visible
描述: 设置生物是否显示名称
Creature.set_name_visible(_visible)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_visible | Bool | 是否显示名称 |
示例:
local creature = GameAPI.create_creature_fixed_scale(100001, math.Vector3(0,0,0), math.Quaternion(0,0,0), 1.0, GameAPI.get_all_valid_roles()[1])
creature.set_name_visible(true)Creature.set_dragged_plane_type
描述: 设置生物拖动平面
Creature.set_dragged_plane_type(_value)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_value | PlaneType | 拖动平面 |
示例:
local creature = GameAPI.create_creature_fixed_scale(100001, math.Vector3(0,0,0), math.Quaternion(0,0,0), 1.0, GameAPI.get_all_valid_roles()[1])
creature.set_dragged_plane_type(Enums.PlaneType.XZ)Creature.set_touchable
描述: 设置生物是否可点击
Creature.set_touchable(_enable)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_enable | Bool | 是否可点击 |
示例:
local creature = GameAPI.create_creature_fixed_scale(100001, math.Vector3(0,0,0), math.Quaternion(0,0,0), 1.0, GameAPI.get_all_valid_roles()[1])
creature.set_touchable(true)Unit.show_bubble_msg
描述: 发送气泡信息
Unit.show_bubble_msg(_show_msg, _show_time, _max_dis, _offset)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_show_msg | Str | 气泡信息 |
_show_time | Fixed | 持续时间 |
_max_dis | Fixed | 隐藏距离 |
_offset | Vector3 | 偏移 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.show_bubble_msg("消息内容", 1.0, 1.0, math.Vector3(0, 0, 0))DisplayComp.stop_anim
描述: 停止播放动画
DisplayComp.stop_anim()示例:
displayComp.stop_anim()DisplayComp.stop_play_body_anim
描述: 停止播放全身动画
DisplayComp.stop_play_body_anim()示例:
displayComp.stop_play_body_anim()DisplayComp.stop_play_body_anim_by_id
描述: 停止播放全身动画)
DisplayComp.stop_play_body_anim_by_id(_anim_id)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_anim_id | AnimKey | 动画编号 |
示例:
displayComp.stop_play_body_anim_by_id(250001)DisplayComp.stop_play_upper_anim
描述: 停止播放上半身动画
DisplayComp.stop_play_upper_anim()示例:
displayComp.stop_play_upper_anim()DisplayComp.stop_play_upper_anim_by_id
描述: 停止播放上半身动画
DisplayComp.stop_play_upper_anim_by_id(_anim_id)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_anim_id | AnimKey | 动画编号 |
示例:
displayComp.stop_play_upper_anim_by_id(250001)Equipment.destroy_equipment
描述: 删除物品
Equipment.destroy_equipment()示例:
local equipment = GameAPI.create_equipment(400001, math.Vector3(0,0,0))
equipment.destroy_equipment()ExprDeviceComp.disable_expr_device_by_name
描述: 通过名称禁用表现器
ExprDeviceComp.disable_expr_device_by_name(_name)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_name | Str | 名称 |
示例:
exprDeviceComp.disable_expr_device_by_name("平凡蛋0")Unit.disable_interact
描述: 禁用单位互动
Unit.disable_interact()示例:
local role = GameAPI.get_all_valid_roles()[1]
role.disable_interact()Unit.disable_motor
描述: 禁用运动器
Unit.disable_motor(_index)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_index | Int | 索引 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.disable_motor(1)DebugAPI.draw_line
描述: 绘制线段(调试)
DebugAPI.draw_line(_start_pos, _end_pos, _color, _duration)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_start_pos | Vector3 | 起点 |
_end_pos | Vector3 | 终点 |
_color | Color | 颜色 |
_duration | Fixed | 时长 |
示例:
DebugAPI.draw_line(math.Vector3(0, 0, 0), math.Vector3(0, 0, 0), math.Color(1, 0, 0, 1), 1.0)DebugAPI.draw_text
描述: 绘制文本(调试)
DebugAPI.draw_text(_pos, _text)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_pos | Vector3 | 位置 |
_text | Str | 文本 |
示例:
DebugAPI.draw_text(math.Vector3(0, 0, 0), "示例文本")ExprDeviceComp.enable_expr_device_by_name
描述: 通过名称激活表现器
ExprDeviceComp.enable_expr_device_by_name(_name)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_name | Str | 名称 |
示例:
exprDeviceComp.enable_expr_device_by_name("平凡蛋0")Unit.enable_interact
描述: 激活单位互动
Unit.enable_interact()示例:
local role = GameAPI.get_all_valid_roles()[1]
role.enable_interact()Unit.enable_motor
描述: 激活运动器
Unit.enable_motor(_index)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_index | Int | 索引 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.enable_motor(1)AbilityComp.get_abilities
描述: 获取单位所有技能
AbilityComp.get_abilities()返回值:
- 类型:
ListAbility - 说明: 技能对象
示例:
local result = abilityComp.get_abilities()AbilityComp.get_ability_list
描述: 获取单位所有技能
AbilityComp.get_ability_list()返回值:
- 类型:
ListAbility - 说明: 技能列表
示例:
local result = abilityComp.get_ability_list()Ability.get_accumulate_ratio
描述: 获取技能蓄力百分比
Ability.get_accumulate_ratio()返回值:
- 类型:
Fixed - 说明: 技能蓄力百分比
示例:
local role = GameAPI.get_all_valid_roles()[1]
local ability = role.add_ability_to_slot(1, 150001, {}, {})
local result = ability.get_accumulate_ratio()Ability.get_affect_character_list
描述: 获取技能可以作用的角色列表
Ability.get_affect_character_list(_height, _use_fixed_release_point)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_height | Fixed | 高度差 |
_use_fixed_release_point | Bool | 施法点是否固定 |
返回值:
- 类型:
ListCharacter - 说明: 可以影响的角色列表
示例:
local role = GameAPI.get_all_valid_roles()[1]
local ability = role.add_ability_to_slot(1, 150001, {}, {})
local result = ability.get_affect_character_list(1.0, true)Ability.get_affect_creature_list
描述: 获取技能可以作用的生物列表
Ability.get_affect_creature_list(_height, _use_fixed_release_point)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_height | Fixed | 高度差 |
_use_fixed_release_point | Bool | 施法点是否固定 |
返回值:
- 类型:
ListCreature - 说明: 可以影响的生物列表
示例:
local role = GameAPI.get_all_valid_roles()[1]
local ability = role.add_ability_to_slot(1, 150001, {}, {})
local result = ability.get_affect_creature_list(1.0, true)Ability.get_affect_lifeentity_list
描述: 获取技能可以作用的生命体列表
Ability.get_affect_lifeentity_list(_height, _use_fixed_release_point)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_height | Fixed | 高度差 |
_use_fixed_release_point | Bool | 施法点是否固定 |
返回值:
- 类型:
ListLifeEntity - 说明: 可以影响的生命体列表
示例:
local role = GameAPI.get_all_valid_roles()[1]
local ability = role.add_ability_to_slot(1, 150001, {}, {})
local result = ability.get_affect_lifeentity_list(1.0, true)Ability.get_affect_obstacle_list
描述: 获取技能可以作用的组件列表
Ability.get_affect_obstacle_list(_height, _use_fixed_release_point)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_height | Fixed | 高度差 |
_use_fixed_release_point | Bool | 施法点是否固定 |
返回值:
- 类型:
ListObstacle - 说明: 可以影响的组件列表
示例:
local role = GameAPI.get_all_valid_roles()[1]
local ability = role.add_ability_to_slot(1, 150001, {}, {})
local result = ability.get_affect_obstacle_list(1.0, true)Ability.get_cd_time
描述: 获取技能冷却时间
Ability.get_cd_time()返回值:
- 类型:
Fixed - 说明: 技能冷却时间
示例:
local role = GameAPI.get_all_valid_roles()[1]
local ability = role.add_ability_to_slot(1, 150001, {}, {})
local result = ability.get_cd_time()Ability.get_left_charge_time
描述: 获取技能剩余充能时间
Ability.get_left_charge_time()返回值:
- 类型:
Fixed - 说明: 剩余充能时间
示例:
local role = GameAPI.get_all_valid_roles()[1]
local ability = role.add_ability_to_slot(1, 150001, {}, {})
local result = ability.get_left_charge_time()Ability.get_desc
描述: 获取技能描述
Ability.get_desc()返回值:
- 类型:
Str - 说明: 技能描述
示例:
local role = GameAPI.get_all_valid_roles()[1]
local ability = role.add_ability_to_slot(1, 150001, {}, {})
local result = ability.get_desc()Ability.get_pointer_type
描述: 获取技能指示器类型
Ability.get_pointer_type()返回值:
- 类型:
AbilityPointerType - 说明: 指示器类型
示例:
local role = GameAPI.get_all_valid_roles()[1]
local ability = role.add_ability_to_slot(1, 150001, {}, {})
local result = ability.get_pointer_type()Ability.get_key
描述: 获取技能编号
Ability.get_key()返回值:
- 类型:
AbilityKey - 说明: 技能编号
示例:
local role = GameAPI.get_all_valid_roles()[1]
local ability = role.add_ability_to_slot(1, 150001, {}, {})
local result = ability.get_key()Ability.get_left_cd_time
描述: 获取技能剩余冷却时间
Ability.get_left_cd_time()返回值:
- 类型:
Fixed - 说明: 剩余冷却时间
示例:
local role = GameAPI.get_all_valid_roles()[1]
local ability = role.add_ability_to_slot(1, 150001, {}, {})
local result = ability.get_left_cd_time()Ability.is_limitation_enabled
描述: 获取技能使用限制是否激活
Ability.is_limitation_enabled(_limit)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_limit | AbilityLimitation | 使用限制 |
返回值:
- 类型:
Bool - 说明: 是否激活
示例:
local role = GameAPI.get_all_valid_roles()[1]
local ability = role.add_ability_to_slot(1, 150001, {}, {})
local result = ability.is_limitation_enabled(Enums.AbilityLimitation.NONE)Ability.get_lock_target_char
描述: 获取技能锁定角色
Ability.get_lock_target_char()返回值:
- 类型:
Character - 说明: 角色
示例:
local role = GameAPI.get_all_valid_roles()[1]
local ability = role.add_ability_to_slot(1, 150001, {}, {})
local result = ability.get_lock_target_char()Ability.get_lock_target_creature
描述: 获取技能锁定生物
Ability.get_lock_target_creature()返回值:
- 类型:
Creature - 说明: 生物
示例:
local role = GameAPI.get_all_valid_roles()[1]
local ability = role.add_ability_to_slot(1, 150001, {}, {})
local result = ability.get_lock_target_creature()Ability.get_lock_target
描述: 获取技能锁定目标
Ability.get_lock_target()返回值:
- 类型:
LifeEntity - 说明: 获取技能锁定目标
示例:
local role = GameAPI.get_all_valid_roles()[1]
local ability = role.add_ability_to_slot(1, 150001, {}, {})
local result = ability.get_lock_target()Ability.get_lock_obstacle
描述: 获取技能锁定目标
Ability.get_lock_obstacle()返回值:
- 类型:
Obstacle - 说明: 获取技能锁定目标
示例:
local role = GameAPI.get_all_valid_roles()[1]
local ability = role.add_ability_to_slot(1, 150001, {}, {})
local result = ability.get_lock_obstacle()Ability.get_name
描述: 获取技能名称
Ability.get_name()返回值:
- 类型:
Str - 说明: 技能名称
示例:
local role = GameAPI.get_all_valid_roles()[1]
local ability = role.add_ability_to_slot(1, 150001, {}, {})
local result = ability.get_name()Ability.get_owner
描述: 获取技能拥有者
Ability.get_owner()返回值:
- 类型:
LifeEntity - 说明: 技能拥有者
示例:
local role = GameAPI.get_all_valid_roles()[1]
local ability = role.add_ability_to_slot(1, 150001, {}, {})
local result = ability.get_owner()Ability.get_owner_character
描述: 获取技能拥有角色
Ability.get_owner_character()返回值:
- 类型:
Unit - 说明: 角色
示例:
local role = GameAPI.get_all_valid_roles()[1]
local ability = role.add_ability_to_slot(1, 150001, {}, {})
local result = ability.get_owner_character()Ability.get_owner_creature
描述: 获取技能拥有生物
Ability.get_owner_creature()返回值:
- 类型:
Unit - 说明: 生物
示例:
local role = GameAPI.get_all_valid_roles()[1]
local ability = role.add_ability_to_slot(1, 150001, {}, {})
local result = ability.get_owner_creature()Ability.get_owner_equipment
描述: 获取拥有技能的物品
Ability.get_owner_equipment()返回值:
- 类型:
Equipment - 说明: 技能拥有者
示例:
local role = GameAPI.get_all_valid_roles()[1]
local ability = role.add_ability_to_slot(1, 150001, {}, {})
local result = ability.get_owner_equipment()Ability.get_release_direction
描述: 获取技能释放方向
Ability.get_release_direction()返回值:
- 类型:
Vector3 - 说明: 方向
示例:
local role = GameAPI.get_all_valid_roles()[1]
local ability = role.add_ability_to_slot(1, 150001, {}, {})
local result = ability.get_release_direction()Ability.get_release_direction_list
描述: 获取技能复数释放方向
Ability.get_release_direction_list()返回值:
- 类型:
ListVector3 - 说明: 方向
示例:
local role = GameAPI.get_all_valid_roles()[1]
local ability = role.add_ability_to_slot(1, 150001, {}, {})
local result = ability.get_release_direction_list()Ability.get_release_point
描述: 获取技能释放坐标点
Ability.get_release_point()返回值:
- 类型:
Point3 - 说明: 坐标点
示例:
local role = GameAPI.get_all_valid_roles()[1]
local ability = role.add_ability_to_slot(1, 150001, {}, {})
local result = ability.get_release_point()Ability.get_release_point_list
描述: 获取技能复数释放坐标点
Ability.get_release_point_list()返回值:
- 类型:
ListPoint3 - 说明: 坐标点
示例:
local role = GameAPI.get_all_valid_roles()[1]
local ability = role.add_ability_to_slot(1, 150001, {}, {})
local result = ability.get_release_point_list()Ability.get_ability_slot
描述: 获取技能所在槽位
Ability.get_ability_slot()返回值:
- 类型:
AbilitySlot - 说明: 技能槽位
示例:
local role = GameAPI.get_all_valid_roles()[1]
local ability = role.add_ability_to_slot(1, 150001, {}, {})
local result = ability.get_ability_slot()Role.get_achievement_progress
描述: 获取成就进度
Role.get_achievement_progress(_event_id)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_event_id | Achievement | 成就 |
返回值:
- 类型:
Int - 说明: 成就进度
示例:
local role = GameAPI.get_all_valid_roles()[1]
local achievement = 1 -- Achievement 是成就编号(integer)
local result = role.get_achievement_progress(event_id)Obstacle.get_billboard_text
描述: 获取公告板文本内容
Obstacle.get_billboard_text()返回值:
- 类型:
Str - 说明: 公告板内容
示例:
local obstacle = GameAPI.create_obstacle(200001, math.Vector3(0,0,0), math.Quaternion(0,0,0), math.Vector3(1,1,1), nil)
local result = obstacle.get_billboard_text()Obstacle.get_billboard_font_size
描述: 获取公告板文本字体大小
Obstacle.get_billboard_font_size()返回值:
- 类型:
Int - 说明: 公告板字体大小
示例:
local obstacle = GameAPI.create_obstacle(200001, math.Vector3(0,0,0), math.Quaternion(0,0,0), math.Vector3(1,1,1), nil)
local result = obstacle.get_billboard_font_size()BuffStateComp.get_state_count
描述: 获取限制状态计数
BuffStateComp.get_state_count(_state_id)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_state_id | BuffState | 状态 |
返回值:
- 类型:
Int - 说明: 状态计数
示例:
local result = buffStateComp.get_state_count(Enums.BuffState.CANNOT_MOVE)BuffStateComp.get_state_list
描述: 获取所有限制状态
BuffStateComp.get_state_list()返回值:
- 类型:
ListBuffState - 说明: 状态列表
示例:
local result = buffStateComp.get_state_list()Role.get_camera_direction
描述: 获取玩家相机的朝向(需要开启玩家相机旋转同步)
Role.get_camera_direction()返回值:
- 类型:
Vector3 - 说明: 相机朝向
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = role.get_camera_direction()Camp.get_name
描述: 获取阵营名称
Camp.get_name()返回值:
- 类型:
Str - 说明: 名称
示例:
local camp = GameAPI.get_camp(1)
local result = camp.get_name()Character.get_climb_obstacle
描述: 获取角色攀爬的组件
Character.get_climb_obstacle()返回值:
- 类型:
Obstacle - 说明: 攀爬的组件
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- Character 继承自 LifeEntity,代表NPC角色单位
local result = npc.get_climb_obstacle()Unit.get_parent
描述: 获取父单位
Unit.get_parent()返回值:
- 类型:
Unit - 说明: 单位
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = role.get_parent()Character.get_ability_point
描述: 获取技能点
Character.get_ability_point()返回值:
- 类型:
Int - 说明: 技能点
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- Character 继承自 LifeEntity,代表NPC角色单位
local result = npc.get_ability_point()Obstacle.get_chess_rank
描述: 获取牌数(对象只能为麻将/扑克)
Obstacle.get_chess_rank()返回值:
- 类型:
Int - 说明: 牌数
示例:
local obstacle = GameAPI.create_obstacle(200001, math.Vector3(0,0,0), math.Quaternion(0,0,0), math.Vector3(1,1,1), nil)
local result = obstacle.get_chess_rank()Obstacle.get_chess_type
描述: 获取牌名(对象只能为麻将/扑克)
Obstacle.get_chess_type()返回值:
- 类型:
ChessType - 说明: 牌名
示例:
local obstacle = GameAPI.create_obstacle(200001, math.Vector3(0,0,0), math.Quaternion(0,0,0), math.Vector3(1,1,1), nil)
local result = obstacle.get_chess_type()Unit.get_child_customtriggerspaces
描述: 获得所有子触发区域单位
Unit.get_child_customtriggerspaces()返回值:
- 类型:
ListCustomTriggerSpace - 说明: 触发区域列表
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = role.get_child_customtriggerspaces()Unit.get_child_obstacles
描述: 获得所有子物理组件单位
Unit.get_child_obstacles()返回值:
- 类型:
ListObstacle - 说明: 组件列表
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = role.get_child_obstacles()Unit.get_children
描述: 获得所有子单位
Unit.get_children()返回值:
- 类型:
ListUnit - 说明: 单位列表
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = role.get_children()Creature.get_name
描述: 获取生物名称
Creature.get_name()返回值:
- 类型:
Str - 说明: 生物名称
示例:
local creature = GameAPI.create_creature_fixed_scale(100001, math.Vector3(0,0,0), math.Quaternion(0,0,0), 1.0, GameAPI.get_all_valid_roles()[1])
local result = creature.get_name()Character.get_ctrl_role
描述: 获取控制角色的玩家
Character.get_ctrl_role()返回值:
- 类型:
Role - 说明: 玩家
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- Character 继承自 LifeEntity,代表NPC角色单位
local result = npc.get_ctrl_role()Role.get_ctrl_unit
描述: 获取控制单位
Role.get_ctrl_unit()返回值:
- 类型:
Character - 说明: 单位
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = role.get_ctrl_unit()CustomTriggerSpace.random_point
描述: 获取触发区域内的随机坐标
CustomTriggerSpace.random_point()返回值:
- 类型:
Vector3 - 说明: 坐标
示例:
local cts = GameAPI.create_customtriggerspace(110001, math.Vector3(0,0,0), math.Quaternion(0,0,0), math.Vector3(1,1,1), nil)
local result = cts.random_point()Equipment.is_auto_picking
描述: 获取物品是否自动拾取
Equipment.is_auto_picking()返回值:
- 类型:
Bool - 说明: 是否自动拾取
示例:
local equipment = GameAPI.create_equipment(400001, math.Vector3(0,0,0))
local result = equipment.is_auto_picking()Equipment.is_auto_using
描述: 获取物品是否自动使用
Equipment.is_auto_using()返回值:
- 类型:
Bool - 说明: 是否自动使用
示例:
local equipment = GameAPI.create_equipment(400001, math.Vector3(0,0,0))
local result = equipment.is_auto_using()Equipment.can_drop
描述: 获取物品能否丢弃
Equipment.can_drop()返回值:
- 类型:
Bool - 说明: 能否丢弃
示例:
local equipment = GameAPI.create_equipment(400001, math.Vector3(0,0,0))
local result = equipment.can_drop()Equipment.get_current_stack_num
描述: 获取物品当前堆叠层数
Equipment.get_current_stack_num()返回值:
- 类型:
Int - 说明: 当前堆叠层数
示例:
local equipment = GameAPI.create_equipment(400001, math.Vector3(0,0,0))
local result = equipment.get_current_stack_num()Equipment.get_desc
描述: 获取物品描述
Equipment.get_desc()返回值:
- 类型:
Str - 说明: 物品描述
示例:
local equipment = GameAPI.create_equipment(400001, math.Vector3(0,0,0))
local result = equipment.get_desc()Equipment.get_price
描述: 获取物品的抵押价格
Equipment.get_price(_res_type)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_res_type | Str | 货币类型 |
返回值:
- 类型:
Int - 说明: 卖价
示例:
local equipment = GameAPI.create_equipment(400001, math.Vector3(0,0,0))
local result = equipment.get_price("示例字符串")Equipment.has_owner
描述: 物品是否被持有
Equipment.has_owner()返回值:
- 类型:
Bool - 说明: 是否被持有
示例:
local equipment = GameAPI.create_equipment(400001, math.Vector3(0,0,0))
local result = equipment.has_owner()Equipment.get_key
描述: 获取物品的物品编号
Equipment.get_key()返回值:
- 类型:
EquipmentKey - 说明: 物品编号
示例:
local equipment = GameAPI.create_equipment(400001, math.Vector3(0,0,0))
local result = equipment.get_key()EquipmentComp.get_equipment_list_by_slot_type
描述: 获取持有的物品列表
EquipmentComp.get_equipment_list_by_slot_type(_slot_type)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_slot_type | EquipmentSlotType | 槽位类型 |
返回值:
- 类型:
ListEquipment - 说明: 物品
示例:
local result = equipmentComp.get_equipment_list_by_slot_type(Enums.EquipmentSlotType.EQUIPPED)EquipmentComp.get_equipment_max_count
描述: 获取最大可持有的物品数量
EquipmentComp.get_equipment_max_count(_slot_type)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_slot_type | EquipmentSlotType | 槽位类型 |
返回值:
- 类型:
Int - 说明: 数量
示例:
local result = equipmentComp.get_equipment_max_count(Enums.EquipmentSlotType.EQUIPPED)Equipment.get_max_stack_num
描述: 获取物品最大堆叠层数
Equipment.get_max_stack_num()返回值:
- 类型:
Int - 说明: 最大堆叠层数
示例:
local equipment = GameAPI.create_equipment(400001, math.Vector3(0,0,0))
local result = equipment.get_max_stack_num()Equipment.get_name
描述: 获取物品名称
Equipment.get_name()返回值:
- 类型:
Str - 说明: 物品名称
示例:
local equipment = GameAPI.create_equipment(400001, math.Vector3(0,0,0))
local result = equipment.get_name()Equipment.get_owner_character
描述: 获取持有物品的角色
Equipment.get_owner_character()返回值:
- 类型:
Character - 说明: 角色
示例:
local equipment = GameAPI.create_equipment(400001, math.Vector3(0,0,0))
local result = equipment.get_owner_character()Equipment.get_owner_creature
描述: 获取持有物品的生物
Equipment.get_owner_creature()返回值:
- 类型:
Creature - 说明: 生物
示例:
local equipment = GameAPI.create_equipment(400001, math.Vector3(0,0,0))
local result = equipment.get_owner_creature()Equipment.get_position
描述: 获取物品位置
Equipment.get_position()返回值:
- 类型:
Point3 - 说明: 物品位置
示例:
local equipment = GameAPI.create_equipment(400001, math.Vector3(0,0,0))
local result = equipment.get_position()Equipment.get_unit
描述: 获取物品单位
Equipment.get_unit()返回值:
- 类型:
Obstacle - 说明: 物品单位
示例:
local equipment = GameAPI.create_equipment(400001, math.Vector3(0,0,0))
local result = equipment.get_unit()Equipment.get_equipment_slot
描述: 获取物品所在槽位
Equipment.get_equipment_slot()返回值:
- 类型:
EquipmentSlot - 说明: 槽位
示例:
local equipment = GameAPI.create_equipment(400001, math.Vector3(0,0,0))
local result = equipment.get_equipment_slot()Equipment.get_slot_type
描述: 获取物品所在槽位类型
Equipment.get_slot_type()返回值:
- 类型:
EquipmentSlotType - 说明: 槽位类型
示例:
local equipment = GameAPI.create_equipment(400001, math.Vector3(0,0,0))
local result = equipment.get_slot_type()Equipment.get_equipment_type
描述: 获取物品的物品类型
Equipment.get_equipment_type()返回值:
- 类型:
EquipmentType - 说明: 物品类型
示例:
local equipment = GameAPI.create_equipment(400001, math.Vector3(0,0,0))
local result = equipment.get_equipment_type()LifeEntity.get_direction
描述: 获取生命实体的朝向
LifeEntity.get_direction()返回值:
- 类型:
Vector3 - 说明: 方向
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- NPC单位,AI行为的执行者
local result = npc.get_direction()UnitInteractVolumeComp.get_interact_id
描述: 获取单位互动按钮ID
UnitInteractVolumeComp.get_interact_id(_interact_index, _interact_btn_type)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_interact_index | Int | 互动索引 |
_interact_btn_type | InteractBtnType | 互动按钮类型 |
返回值:
- 类型:
InteractBtnID - 说明: 互动按钮ID
示例:
local result = unitInteractVolumeComp.get_interact_id(1, Enums.InteractBtnType.DEFAULT)Ability.is_in_cd
描述: 技能是否在冷却中
Ability.is_in_cd()返回值:
- 类型:
Bool - 说明: 剩余冷却时间
示例:
local role = GameAPI.get_all_valid_roles()[1]
local ability = role.add_ability_to_slot(1, 150001, {}, {})
local result = ability.is_in_cd()Ability.is_in_charge
描述: 技能是否在充能中
Ability.is_in_charge()返回值:
- 类型:
Bool - 说明: 技能是否在冷却中
示例:
local role = GameAPI.get_all_valid_roles()[1]
local ability = role.add_ability_to_slot(1, 150001, {}, {})
local result = ability.is_in_charge()JointAssistantComp.get_joint_assistant_primary_obstacle
描述: 获取关节组件主体
JointAssistantComp.get_joint_assistant_primary_obstacle()返回值:
- 类型:
Character - 说明: 关节组件主体
示例:
local result = jointAssistantComp.get_joint_assistant_primary_obstacle()JointAssistantComp.get_joint_assistant_target_obstacle
描述: 获取关节组件目标
JointAssistantComp.get_joint_assistant_target_obstacle()返回值:
- 类型:
Character - 说明: 关节组件目标
示例:
local result = jointAssistantComp.get_joint_assistant_target_obstacle()JointAssistantComp.get_joint_assistant_type
描述: 获取关节组件类型
JointAssistantComp.get_joint_assistant_type()返回值:
- 类型:
JointAssistantType - 说明: 关节类型
示例:
local result = jointAssistantComp.get_joint_assistant_type()LifeEntity.get_hpbar_scale_x
描述: 获取生命体血条宽度缩放
LifeEntity.get_hpbar_scale_x()返回值:
- 类型:
Fixed - 说明: 宽度缩放
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- NPC单位,AI行为的执行者
local result = npc.get_hpbar_scale_x()LifeEntity.get_hpbar_scale_y
描述: 获取生命体血条高度缩放
LifeEntity.get_hpbar_scale_y()返回值:
- 类型:
Fixed - 说明: 高度缩放
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- NPC单位,AI行为的执行者
local result = npc.get_hpbar_scale_y()LifeEntity.get_lifted_lifeentity
描述: 获取指定生命体当前抓举的生命体
LifeEntity.get_lifted_lifeentity()返回值:
- 类型:
LifeEntity - 说明: 被抓举的生命体
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- NPC单位,AI行为的执行者
local result = npc.get_lifted_lifeentity()LifeEntity.get_lifted_obstacle
描述: 获取指定生命体当前抓举的组件
LifeEntity.get_lifted_obstacle()返回值:
- 类型:
Obstacle - 说明: 被抓举的组件
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- NPC单位,AI行为的执行者
local result = npc.get_lifted_obstacle()LiftComp.get_lift_cooldown
描述: 获取举起冷却时间
LiftComp.get_lift_cooldown()返回值:
- 类型:
Fixed - 说明: 实数
示例:
local result = liftComp.get_lift_cooldown()LiftComp.get_lift_remaining_cooldown
描述: 获取举起剩余冷却时间
LiftComp.get_lift_remaining_cooldown()返回值:
- 类型:
Fixed - 说明: 实数
示例:
local result = liftComp.get_lift_remaining_cooldown()Unit.get_linear_velocity
描述: 获取单位线速度
Unit.get_linear_velocity()返回值:
- 类型:
Vector3 - 说明: 线速度
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = role.get_linear_velocity()Unit.get_local_direction
描述: 获取单位本地坐标系下的方向
Unit.get_local_direction(_direction_type)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_direction_type | DirectionType | 方向 |
返回值:
- 类型:
Vector3 - 说明: 向量
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = role.get_local_direction(Enums.DirectionType.FORWARD)Unit.get_local_quaternion
描述: 获取单位本地坐标系下的旋转角
Unit.get_local_quaternion(_direction_type)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_direction_type | DirectionType | 方向 |
返回值:
- 类型:
Quaternion - 说明: Quaternion
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = role.get_local_quaternion(Enums.DirectionType.FORWARD)Modifier.get_max_stack_count
描述: 获取效果的最大层数
Modifier.get_max_stack_count()返回值:
- 类型:
Str - 说明: 层数
示例:
local role = GameAPI.get_all_valid_roles()[1]
local modifier = role.add_modifier_by_key(600001, {})
local result = modifier.get_max_stack_count()ModifierComp.get_modifier_by_modifier_key
描述: 获取单位效果
ModifierComp.get_modifier_by_modifier_key(_modifier_id)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_modifier_id | ModifierKey | 效果ID |
返回值:
- 类型:
Modifier - 说明: 效果对象
示例:
local result = modifierComp.get_modifier_by_modifier_key(600001)ModifierComp.get_modifiers
描述: 获取单位所有效果
ModifierComp.get_modifiers()返回值:
- 类型:
ListModifier - 说明: 效果
示例:
local result = modifierComp.get_modifiers()Modifier.get_desc
描述: 获取效果描述
Modifier.get_desc()返回值:
- 类型:
Str - 说明: 效果描述
示例:
local role = GameAPI.get_all_valid_roles()[1]
local modifier = role.add_modifier_by_key(600001, {})
local result = modifier.get_desc()Modifier.get_key
描述: 获得效果编号
Modifier.get_key()返回值:
- 类型:
ModifierKey - 说明: 效果编号
示例:
local role = GameAPI.get_all_valid_roles()[1]
local modifier = role.add_modifier_by_key(600001, {})
local result = modifier.get_key()Modifier.get_name
描述: 获取效果名称
Modifier.get_name()返回值:
- 类型:
Str - 说明: 效果名称
示例:
local role = GameAPI.get_all_valid_roles()[1]
local modifier = role.add_modifier_by_key(600001, {})
local result = modifier.get_name()Modifier.get_owner_unit
描述: 获取效果携带者
Modifier.get_owner_unit()返回值:
- 类型:
Unit - 说明: 效果携带者
示例:
local role = GameAPI.get_all_valid_roles()[1]
local modifier = role.add_modifier_by_key(600001, {})
local result = modifier.get_owner_unit()Modifier.get_owner_ability
描述: 获取所属技能
Modifier.get_owner_ability()返回值:
- 类型:
Ability - 说明: 所属技能
示例:
local role = GameAPI.get_all_valid_roles()[1]
local modifier = role.add_modifier_by_key(600001, {})
local result = modifier.get_owner_ability()Modifier.get_owner_character
描述: 获取效果携带角色
Modifier.get_owner_character()返回值:
- 类型:
Character - 说明: 角色
示例:
local role = GameAPI.get_all_valid_roles()[1]
local modifier = role.add_modifier_by_key(600001, {})
local result = modifier.get_owner_character()Modifier.get_owner_creature
描述: 获取效果携带生物
Modifier.get_owner_creature()返回值:
- 类型:
Creature - 说明: 生物
示例:
local role = GameAPI.get_all_valid_roles()[1]
local modifier = role.add_modifier_by_key(600001, {})
local result = modifier.get_owner_creature()Modifier.get_owner_life_entity
描述: 获取携带效果的生命体
Modifier.get_owner_life_entity()返回值:
- 类型:
LifeEntity - 说明: 生命体
示例:
local role = GameAPI.get_all_valid_roles()[1]
local modifier = role.add_modifier_by_key(600001, {})
local result = modifier.get_owner_life_entity()Modifier.get_remain_duration
描述: 获取效果剩余持续时间
Modifier.get_remain_duration()返回值:
- 类型:
Fixed - 说明: 剩余持续时间
示例:
local role = GameAPI.get_all_valid_roles()[1]
local modifier = role.add_modifier_by_key(600001, {})
local result = modifier.get_remain_duration()Obstacle.get_bound_equipment
描述: 返回绑定的物品
Obstacle.get_bound_equipment()返回值:
- 类型:
Equipment - 说明: 物品
示例:
local obstacle = GameAPI.create_obstacle(200001, math.Vector3(0,0,0), math.Quaternion(0,0,0), math.Vector3(1,1,1), nil)
local result = obstacle.get_bound_equipment()Obstacle.get_name
描述: 获取组件的名称
Obstacle.get_name()返回值:
- 类型:
Str - 说明: 名称
示例:
local obstacle = GameAPI.create_obstacle(200001, math.Vector3(0,0,0), math.Quaternion(0,0,0), math.Vector3(1,1,1), nil)
local result = obstacle.get_name()OwnerComp.get_owner_role
描述: 获取所属玩家
OwnerComp.get_owner_role()返回值:
- 类型:
Role - 说明: 所属玩家
示例:
local result = ownerComp.get_owner_role()Role.get_camera_rotation
描述: 获取玩家相机的旋转(需要开启玩家相机旋转同步)
Role.get_camera_rotation()返回值:
- 类型:
Quaternion - 说明: 相机旋转
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = role.get_camera_rotation()Role.get_head_icon
描述: 获取玩家头像
Role.get_head_icon()返回值:
- 类型:
ImageKey - 说明: 玩家头像
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = role.get_head_icon()Camp.get_roles
描述: 获取阵营内玩家列表
Camp.get_roles()返回值:
- 类型:
ListRole - 说明: 玩家列表
示例:
local camp = GameAPI.get_camp(1)
local result = camp.get_roles()Role.get_map_total_cost
描述: 获取玩家在当前地图累计花费
Role.get_map_total_cost()返回值:
- 类型:
Fixed - 说明: 累计花费
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = role.get_map_total_cost()Role.get_name
描述: 获取玩家昵称
Role.get_name()返回值:
- 类型:
Str - 说明: 名字
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = role.get_name()Role.get_party_id
描述: 获取玩家蛋仔岛组队Id
Role.get_party_id()返回值:
- 类型:
Str - 说明: 队伍Id
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = role.get_party_id()Role.get_voice_volume
描述: 获取语音音量
Role.get_voice_volume()返回值:
- 类型:
Fixed - 说明: 语音音量
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = role.get_voice_volume()RollComp.get_roll_remaining_cooldown
描述: 获取滚动剩余冷却时间
RollComp.get_roll_remaining_cooldown()返回值:
- 类型:
Fixed - 说明: 剩余冷却时间
示例:
local result = rollComp.get_roll_remaining_cooldown()RushComp.get_rush_remaining_cooldown
描述: 获取飞扑剩余冷却时间
RushComp.get_rush_remaining_cooldown()返回值:
- 类型:
Fixed - 说明: 剩余冷却时间
示例:
local result = rushComp.get_rush_remaining_cooldown()EquipmentComp.get_selected_equipment
描述: 获取当前选中的物品
EquipmentComp.get_selected_equipment()返回值:
- 类型:
Equipment - 说明: 物品
示例:
local result = equipmentComp.get_selected_equipment()EquipmentComp.get_equipment_by_slot
描述: 获取身上的物品
EquipmentComp.get_equipment_by_slot(_slot_type, _slot_index)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_slot_type | EquipmentSlotType | 槽位类型 |
_slot_index | Int | 槽位索引 |
返回值:
- 类型:
Equipment - 说明: 物品
示例:
local result = equipmentComp.get_equipment_by_slot(Enums.EquipmentSlotType.EQUIPPED, 1)Modifier.get_stack_count
描述: 获取效果当前层数
Modifier.get_stack_count()返回值:
- 类型:
Str - 说明: 层数
示例:
local role = GameAPI.get_all_valid_roles()[1]
local modifier = role.add_modifier_by_key(600001, {})
local result = modifier.get_stack_count()AbilityComp.get_ability_by_slot
描述: 获取对应槽位技能
AbilityComp.get_ability_by_slot(_ability_slot)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_ability_slot | AbilitySlot | 技能槽位 |
返回值:
- 类型:
Ability - 说明: 技能对象
示例:
local ability_slot = 1 -- AbilitySlot 是槽位整数索引
local result = abilityComp.get_ability_by_slot(ability_slot)EquipmentComp.get_equipment_list
描述: 获取角色/生物持有的物品预设列表
EquipmentComp.get_equipment_list(_equipment_key, _exclude_equipped, _exclude_bag)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_equipment_key | EquipmentKey | 物品类型 |
_exclude_equipped | Bool | 不搜索物品栏 |
_exclude_bag | Bool | 不搜索背包栏 |
返回值:
- 类型:
ListEquipment - 说明: 物品列表
示例:
local result = equipmentComp.get_equipment_list(400001, true, true)Actor.get_id
描述: 获取单位ID
Actor.get_id()返回值:
- 类型:
UnitID - 说明: 单位ID
示例:
local result = actor.get_id()Unit.get_key
描述: 获取单位编号
Unit.get_key()返回值:
- 类型:
UnitKey - 说明: 单位编号
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = role.get_key()Unit.get_orientation
描述: 获得单位旋转
Unit.get_orientation()返回值:
- 类型:
Quaternion - 说明: 旋转
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = role.get_orientation()Unit.get_position
描述: 获取单位坐标
Unit.get_position()返回值:
- 类型:
Vector3 - 说明: 坐标
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = role.get_position()Unit.get_rigid_body_type
描述: 获取受力类型
Unit.get_rigid_body_type()返回值:
- 类型:
RigidBodyType - 说明: 受力类型
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = role.get_rigid_body_type()Unit.get_scale
描述: 获得单位缩放
Unit.get_scale()返回值:
- 类型:
Vector3 - 说明: 缩放
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = role.get_scale()Unit.get_unit_type
描述: 获取单位类型
Unit.get_unit_type()返回值:
- 类型:
UnitType - 说明: 单位类型
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = role.get_unit_type()TriggerSpace.get_virtual_light_brightness
描述: 获取光源亮度
TriggerSpace.get_virtual_light_brightness()返回值:
- 类型:
Fixed - 说明: 亮度
示例:
local ts = GameAPI.create_triggerspace(900001, math.Vector3(0,0,0), math.Quaternion(0,0,0), math.Vector3(1,1,1), nil)
local result = ts.get_virtual_light_brightness()KVBase.has_kv
描述: 是否有自定义值
KVBase.has_kv(_key)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_key | Str | 名称 |
返回值:
- 类型:
Bool - 说明: 是否有自定义值
示例:
local result = kVBase.has_kv("key_001")KVBase.has_tag
描述: 是否有标签
KVBase.has_tag(_tag)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_tag | Str | 标签 |
返回值:
- 类型:
Bool - 说明: 是否有标签
示例:
local result = kVBase.has_tag("enemy")Character.increase_ability_point
描述: 增加技能点
Character.increase_ability_point(_increase)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_increase | Int | 技能点 |
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- Character 继承自 LifeEntity,代表NPC角色单位
npc.increase_ability_point(1)Camp.get_camp_score
描述: 获取阵营积分
Camp.get_camp_score()返回值:
- 类型:
Int - 说明: 积分
示例:
local camp = GameAPI.get_camp(1)
local result = camp.get_camp_score()Role.get_score
描述: 获取玩家积分
Role.get_score()返回值:
- 类型:
Int - 说明: 积分
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = role.get_score()LifeComp.is_die_status
描述: 是否处于死亡状态
LifeComp.is_die_status()返回值:
- 类型:
Bool - 说明: 是否处于死亡
示例:
local result = lifeComp.is_die_status()Unit.is_model_visible
描述: 单位模型是否可见
Unit.is_model_visible()返回值:
- 类型:
Bool - 说明: 是否隐藏
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = role.is_model_visible()Unit.is_physics_active
描述: 单位物理是否生效
Unit.is_physics_active()返回值:
- 类型:
Bool - 说明: 是否物理生效
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = role.is_physics_active()LifeEntity.is_draggable
描述: 获取生命体是否可拖动
LifeEntity.is_draggable()返回值:
- 类型:
Bool - 说明: 是否可拖动
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- NPC单位,AI行为的执行者
local result = npc.is_draggable()LifeEntity.is_touchable
描述: 获取生命体是否可点击
LifeEntity.is_touchable()返回值:
- 类型:
Bool - 说明: 是否可点击
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- NPC单位,AI行为的执行者
local result = npc.is_touchable()MoveStatusComp.is_fling_status
描述: 前是否处于滚动状态
MoveStatusComp.is_fling_status()返回值:
- 类型:
Bool - 说明: 是否滚动
示例:
local result = moveStatusComp.is_fling_status()CharacterComp.is_forced_moving
描述: 是否正在强制位移
CharacterComp.is_forced_moving()返回值:
- 类型:
Bool - 说明: 是否正在强制位移
示例:
local result = characterComp.is_forced_moving()ModifierComp.has_modifier_by_key
描述: 是否拥有指定编号的效果
ModifierComp.has_modifier_by_key(_modifier_key)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_modifier_key | ModifierKey | 效果编号 |
返回值:
- 类型:
Bool - 说明: 是否拥有
示例:
local result = modifierComp.has_modifier_by_key(600001)LiftComp.is_lift_status
描述: 是否处于抓举状态
LiftComp.is_lift_status()返回值:
- 类型:
Bool - 说明: 是否抓举
示例:
local result = liftComp.is_lift_status()LiftedComp.is_lifted_status
描述: 是否处于被抓举
LiftedComp.is_lifted_status()返回值:
- 类型:
Bool - 说明: 是否被抓举
示例:
local result = liftedComp.is_lifted_status()MoveStatusComp.is_lost_control_status
描述: 判断移动状态是否处于失控状态
MoveStatusComp.is_lost_control_status()返回值:
- 类型:
Bool - 说明: 是否失控
示例:
local result = moveStatusComp.is_lost_control_status()Obstacle.is_draggable
描述: 获取组件是否可拖动
Obstacle.is_draggable()返回值:
- 类型:
Bool - 说明: 是否可拖动
示例:
local obstacle = GameAPI.create_obstacle(200001, math.Vector3(0,0,0), math.Quaternion(0,0,0), math.Vector3(1,1,1), nil)
local result = obstacle.is_draggable()Obstacle.is_touchable
描述: 获取组件是否可点击
Obstacle.is_touchable()返回值:
- 类型:
Bool - 说明: 是否可点击
示例:
local obstacle = GameAPI.create_obstacle(200001, math.Vector3(0,0,0), math.Quaternion(0,0,0), math.Vector3(1,1,1), nil)
local result = obstacle.is_touchable()JumpComp.is_on_ground
描述: 是否位于地面
JumpComp.is_on_ground()返回值:
- 类型:
Bool - 说明: 是否位于地面
示例:
local result = jumpComp.is_on_ground()Role.is_gallery_vip
描述: 是否是乐园会员
Role.is_gallery_vip()返回值:
- 类型:
Bool - 说明: 是否是乐园会员
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = role.is_gallery_vip()Role.has_commodity
描述: 玩家是否拥有道具
Role.has_commodity(_commodity_id)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_commodity_id | UgcCommodity | 道具 |
返回值:
- 类型:
Bool - 说明: 是否拥有道具
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = role.has_commodity(ugc_commodity)Role.has_saved_archive
描述: 玩家是否记录过存档
Role.has_saved_archive()返回值:
- 类型:
Bool - 说明: 是否记录过存档
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = role.has_saved_archive()Role.is_map_liked
描述: 是否点赞本地图
Role.is_map_liked()返回值:
- 类型:
Bool - 说明: 是否点赞
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = role.is_map_liked()Role.is_lost
描述: 玩家是否失败
Role.is_lost()返回值:
- 类型:
Bool - 说明: 玩家是否失败
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = role.is_lost()Role.is_online
描述: 玩家是否在线
Role.is_online()返回值:
- 类型:
Bool - 说明: 是否在线
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = role.is_online()Role.is_map_favorited
描述: 是否收藏本地图
Role.is_map_favorited()返回值:
- 类型:
Bool - 说明: 是否收藏
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = role.is_map_favorited()Role.is_subscribed_map_author
描述: 玩家是否订阅地图作者
Role.is_subscribed_map_author()返回值:
- 类型:
Bool - 说明: 是否订阅
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = role.is_subscribed_map_author()Role.is_pass_premium_vip
描述: 是否是派对手册进阶会员
Role.is_pass_premium_vip()返回值:
- 类型:
Bool - 说明: 是否是派对手册进阶会员
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = role.is_pass_premium_vip()Role.is_won
描述: 玩家是否胜利
Role.is_won()返回值:
- 类型:
Bool - 说明: 玩家是否胜利
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = role.is_won()Unit.is_in_customtriggerspace
描述: 单位是否在触发区域内
Unit.is_in_customtriggerspace(_custom_trigger_space, _consider_mask)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_custom_trigger_space | CustomTriggerSpace | 触发区域 |
_consider_mask | Bool | 考虑掩码 |
返回值:
- 类型:
Bool - 说明: 是否在触发区域内
示例:
local role = GameAPI.get_all_valid_roles()[1]
local cts = GameAPI.create_customtriggerspace(110001, math.Vector3(0,0,0), math.Quaternion(0,0,0), math.Vector3(1,1,1), nil)
local result = role.is_in_customtriggerspace(cts, true)Unit.is_valid_ability_target
描述: 判断单位是否满足作为技能释放目标的条件
Unit.is_valid_ability_target(_ability)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_ability | Ability | 对应技能 |
返回值:
- 类型:
Bool - 说明: 目标是否满足条件
示例:
local role = GameAPI.get_all_valid_roles()[1]
local role = GameAPI.get_all_valid_roles()[1]
local ability = role.add_ability_to_slot(1, 150001, {}, {})
local result = role.is_valid_ability_target(ability)Role.get_last_archive_timestamp
描述: 获取玩家上次存档时间
Role.get_last_archive_timestamp()返回值:
- 类型:
Timestamp - 说明: 时间戳
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = role.get_last_archive_timestamp()LevelComp.gain_exp
描述: 获得经验
LevelComp.gain_exp(_killed_exp)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_killed_exp | Fixed | 经验值 |
示例:
levelComp.gain_exp(1.0)LevelComp.get_exp
描述: 获取当前经验值
LevelComp.get_exp()返回值:
- 类型:
Fixed - 说明: 经验值
示例:
local result = levelComp.get_exp()LevelComp.get_killed_exp
描述: 获取击杀经验点
LevelComp.get_killed_exp()返回值:
- 类型:
Fixed - 说明: 击杀经验值
示例:
local result = levelComp.get_killed_exp()LevelComp.get_level
描述: 获得当前等级
LevelComp.get_level()返回值:
- 类型:
Int - 说明: 当前等级
示例:
local result = levelComp.get_level()LevelComp.level_up
描述: 升级
LevelComp.level_up()示例:
levelComp.level_up()LevelComp.set_killed_exp
描述: 设置击杀经验点
LevelComp.set_killed_exp(_killed_exp)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_killed_exp | Fixed | 击杀经验值 |
示例:
levelComp.set_killed_exp(1.0)LifeEntity.start_move_by_direction
描述: 命令生命体移动
LifeEntity.start_move_by_direction(_direction, _duration)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_direction | Vector3 | 移动方向 |
_duration | Fixed | 持续时间 |
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- NPC单位,AI行为的执行者
npc.start_move_by_direction(math.Vector3(0, 0, 0), 1.0)LifeEntity.start_move_to_pos_with_threshold
描述: 命令生命体移动到坐标点
LifeEntity.start_move_to_pos_with_threshold(_target_pos, _duration, _threshold)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_target_pos | Point3 | 目标点 |
_duration | Fixed | 持续时间 |
_threshold | Fixed | 容错距离 |
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- NPC单位,AI行为的执行者
npc.start_move_to_pos_with_threshold(math.Vector3(0, 0, 0), 1.0, 1.0)EquipmentComp.consume_equipment
描述: 消耗物品
EquipmentComp.consume_equipment(_equipment_key, _consume_num)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_equipment_key | EquipmentKey | 物品编号 |
_consume_num | Int | 消耗数量 |
示例:
equipmentComp.consume_equipment(400001, 1)LifeEntity.get_hard_punch_threshold
描述: 获取生命体大力击倒阈值
LifeEntity.get_hard_punch_threshold()示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- NPC单位,AI行为的执行者
npc.get_hard_punch_threshold()LifeEntity.get_owner
描述: 获取生命体控制玩家
LifeEntity.get_owner()返回值:
- 类型:
Role - 说明: 控制玩家
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- NPC单位,AI行为的执行者
local result = npc.get_owner()LifeEntity.get_punch_threshold
描述: 获取生命体击倒阈值
LifeEntity.get_punch_threshold()示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- NPC单位,AI行为的执行者
npc.get_punch_threshold()LifeEntity.activate_multi_animation
描述: 发起双人动作
LifeEntity.activate_multi_animation(_anim_id, _acceptor_type)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_anim_id | AnimKey | 动作编号 |
_acceptor_type | UnitType | 接收方类型 |
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- NPC单位,AI行为的执行者
npc.activate_multi_animation(250001, Enums.UnitType.CHARACTER)LifeEntity.interrupt_multi_animation
描述: 打断双人动作
LifeEntity.interrupt_multi_animation()示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- NPC单位,AI行为的执行者
npc.interrupt_multi_animation()Unit.is_character
描述: 是否为角色
Unit.is_character()返回值:
- 类型:
Bool - 说明: 是否为角色
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = role.is_character()LifeEntity.is_jumping
描述: 生命体是否在跳跃中
LifeEntity.is_jumping()返回值:
- 类型:
Bool - 说明: 是否在跳跃中
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- NPC单位,AI行为的执行者
local result = npc.is_jumping()LifeEntity.is_moving
描述: 生命体是否在移动中
LifeEntity.is_moving()返回值:
- 类型:
Bool - 说明: 是否在移动中
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- NPC单位,AI行为的执行者
local result = npc.is_moving()LifeEntity.is_rushing
描述: 生命体是否在飞扑中
LifeEntity.is_rushing()返回值:
- 类型:
Bool - 说明: 是否在飞扑中
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- NPC单位,AI行为的执行者
local result = npc.is_rushing()LifeEntity.swap_equipment_slot
描述: 交换物品槽位
LifeEntity.swap_equipment_slot(_equipment, _slot_type, _slot)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_equipment | Equipment | 物品 |
_slot_type | EquipmentSlotType | 槽位类型 |
_slot | EquipmentSlot | 槽位 |
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- NPC单位,AI行为的执行者
local equipment = GameAPI.create_equipment(400001, math.Vector3(0,0,0))
local eq_slot = 1 -- EquipmentSlot 是槽位整数索引
npc.swap_equipment_slot(equipment, Enums.EquipmentSlotType.EQUIPPED, slot)Unit.play_emoji_with_offset
描述: 发送气泡表情
Unit.play_emoji_with_offset(_emoji_key, _show_time, _offset)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_emoji_key | EmojiKey | 表情 |
_show_time | Fixed | 持续时间 |
_offset | Vector3 | 偏移 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.play_emoji_with_offset(270001, 1.0, math.Vector3(0, 0, 0))LifeEntity.play_face_expression
描述: 播放面部表情
LifeEntity.play_face_expression(_emoji_key, _show_time)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_emoji_key | EmojiKey | 表情 |
_show_time | Fixed | 持续时间 |
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- NPC单位,AI行为的执行者
npc.play_face_expression(270001, 1.0)LifeEntity.set_multi_animation_acceptor_type
描述: 设置可接受的双人动作类型
LifeEntity.set_multi_animation_acceptor_type(_acceptor_type)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_acceptor_type | UnitType | 可接受类型 |
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- NPC单位,AI行为的执行者
npc.set_multi_animation_acceptor_type(Enums.UnitType.CHARACTER)LifeEntity.set_multi_animation_acceptor_enabled
描述: 设置可接受双人动作邀请
LifeEntity.set_multi_animation_acceptor_enabled(_enable)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_enable | Bool | 是否可接受 |
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- NPC单位,AI行为的执行者
npc.set_multi_animation_acceptor_enabled(true)LifeEntity.set_hard_punch_threshold
描述: 设置生命体大力击倒阈值
LifeEntity.set_hard_punch_threshold(_punch_threshold)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_punch_threshold | Fixed | 击倒阈值 |
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- NPC单位,AI行为的执行者
npc.set_hard_punch_threshold(1.0)LifeEntity.set_punch_threshold
描述: 设置生命体击倒阈值
LifeEntity.set_punch_threshold(_punch_threshold)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_punch_threshold | Fixed | 击倒阈值 |
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- NPC单位,AI行为的执行者
npc.set_punch_threshold(1.0)LifeEntity.set_skeleton_offset
描述: 修改骨骼偏移
LifeEntity.set_skeleton_offset(_skeleton, _offset)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_skeleton | Skeleton | 骨骼 |
_offset | Vector3 | 偏移量 |
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- NPC单位,AI行为的执行者
npc.set_skeleton_offset(skeleton, math.Vector3(0, 0, 0))LifeEntity.set_skeleton_scale
描述: 修改骨骼缩放
LifeEntity.set_skeleton_scale(_skeleton, _scale)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_skeleton | Skeleton | 骨骼 |
_scale | Vector3 | 缩放比例 |
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- NPC单位,AI行为的执行者
npc.set_skeleton_scale(skeleton, math.Vector3(0, 0, 0))Modifier.change_shield_value
描述: 修改护盾值
Modifier.change_shield_value(_shield_value)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_shield_value | Fixed | 属性值 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
local modifier = role.add_modifier_by_key(600001, {})
modifier.change_shield_value(1.0)Modifier.get_shield_value
描述: 获取护盾值
Modifier.get_shield_value()返回值:
- 类型:
Fixed - 说明: 属性值
示例:
local role = GameAPI.get_all_valid_roles()[1]
local modifier = role.add_modifier_by_key(600001, {})
local result = modifier.get_shield_value()Modifier.set_shield_value
描述: 设置护盾值
Modifier.set_shield_value(_shield_value)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_shield_value | Fixed | 属性值 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
local modifier = role.add_modifier_by_key(600001, {})
modifier.set_shield_value(1.0)Equipment.move_to_slot
描述: 移动物品到指定槽位
Equipment.move_to_slot(_slot_type, _slot)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_slot_type | EquipmentSlotType | 槽位类型 |
_slot | Int | 槽位 |
示例:
local equipment = GameAPI.create_equipment(400001, math.Vector3(0,0,0))
equipment.move_to_slot(Enums.EquipmentSlotType.EQUIPPED, 1)Unit.add_circle_motor
描述: 添加圆周运动
Unit.add_circle_motor(_vel, _time, _is_local)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_vel | Vector3 | 角速度 |
_time | Fixed | 时间 |
_is_local | Bool | 是否局部空间 |
返回值:
- 类型:
Int - 说明: 索引
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = role.add_circle_motor(math.Vector3(0, 0, 0), 1.0, true)Unit.add_linear_motor
描述: 添加直线运动
Unit.add_linear_motor(_vel, _time, _is_local)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_vel | Vector3 | 线速度 |
_time | Fixed | 时间 |
_is_local | Bool | 是否局部空间 |
返回值:
- 类型:
Int - 说明: 索引
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = role.add_linear_motor(math.Vector3(0, 0, 0), 1.0, true)Unit.add_surround_motor
描述: 添加环绕运动
Unit.add_surround_motor(_follow_target, _ang_vel, _time, _follow_rotate)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_follow_target | Unit | 环绕目标 |
_ang_vel | Vector3 | 角速度 |
_time | Fixed | 时间 |
_follow_rotate | Bool | 是否跟随旋转 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.add_surround_motor(role, math.Vector3(0, 0, 0), 1.0, true)Unit.remove_surround_motor
描述: 停止环绕运动
Unit.remove_surround_motor()示例:
local role = GameAPI.get_all_valid_roles()[1]
role.remove_surround_motor()Unit.get_angular_velocity
描述: 获取单位角速度
Unit.get_angular_velocity()返回值:
- 类型:
Vector3 - 说明: 角速度
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = role.get_angular_velocity()Unit.is_dynamic
描述: 组件是否为受力物体
Unit.is_dynamic()返回值:
- 类型:
Bool - 说明: 是否为受力物体
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = role.is_dynamic()Unit.model_play_animation
描述: 模型播放动画
Unit.model_play_animation(_anim_name, _start_time, _is_loop, _play_speed)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_anim_name | Str | 动画名 |
_start_time | Fixed | 开始时间 |
_is_loop | Bool | 是否循环 |
_play_speed | Fixed | 播放速度 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.model_play_animation("平凡蛋0", 1.0, true, 1.0)Unit.set_angular_velocity
描述: 改变单位角速度
Unit.set_angular_velocity(_vel)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_vel | Vector3 | 角速度 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.set_angular_velocity(math.Vector3(0, 0, 0))Obstacle.set_draggable
描述: 设置组件是否可拖动
Obstacle.set_draggable(_enabled)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_enabled | Bool | 是否可拖动 |
示例:
local obstacle = GameAPI.create_obstacle(200001, math.Vector3(0,0,0), math.Quaternion(0,0,0), math.Vector3(1,1,1), nil)
obstacle.set_draggable(true)Ability.play_countdown_ui
描述: 播放倒计时ui效果
Ability.play_countdown_ui(_time)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_time | Fixed | 持续时间 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
local ability = role.add_ability_to_slot(1, 150001, {}, {})
ability.play_countdown_ui(1.0)Role.play_screen_sfx
描述: 播放屏幕特效
Role.play_screen_sfx(_sfx_key, _duration, _rate)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_sfx_key | SfxKey | 特效编号 |
_duration | Fixed | 持续时间 |
_rate | Fixed | 播放速率 |
返回值:
- 类型:
SfxID - 说明: 特效ID
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = role.play_screen_sfx(700001, 1.0, 1.0)Unit.play_sound_with_dis_and_attenuation
描述: 单位开始播放声音
Unit.play_sound_with_dis_and_attenuation(_event_id, _vis_dis, _sound_attenuation_curve)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_event_id | SoundKey | 声音编号 |
_vis_dis | Fixed | 音效传播距离 |
_sound_attenuation_curve | Str | 衰减曲线 |
返回值:
- 类型:
SoundID - 说明: 音效ID
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = role.play_sound_with_dis_and_attenuation(800001, 1.0, "示例字符串")AbilityComp.remove_ability_by_key
描述: 根据技能编号移除技能
AbilityComp.remove_ability_by_key(_ability_key)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_ability_key | AbilityKey | 技能编号 |
返回值:
- 类型:
Bool - 说明: 是否成功移除
示例:
local result = abilityComp.remove_ability_by_key(150001)ItemBox.remove_ability
描述: 移除道具箱刷新技能
ItemBox.remove_ability(_ability_key)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_ability_key | AbilityKey | 技能编号 |
示例:
itemBox.remove_ability(150001)DisplayComp.unbind_model
描述: 移除绑定模型
DisplayComp.unbind_model(_bind_id)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_bind_id | Str | 绑定ID |
示例:
displayComp.unbind_model("id_001")BuffStateComp.remove_state
描述: 从对象移除指定状态
BuffStateComp.remove_state(_state_id)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_state_id | BuffState | 状态 |
示例:
buffStateComp.remove_state(Enums.BuffState.CANNOT_MOVE)Unit.remove_from_parent
描述: 从父节点移除
Unit.remove_from_parent()示例:
local role = GameAPI.get_all_valid_roles()[1]
role.remove_from_parent()KVBase.remove_kv
描述: 移除自定义值
KVBase.remove_kv(_key)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_key | Str | 名称 |
示例:
kVBase.remove_kv("key_001")ModifierComp.remove_modifier_by_key
描述: 移除效果
ModifierComp.remove_modifier_by_key(_modifier_id)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_modifier_id | ModifierKey | 效果编号 |
示例:
modifierComp.remove_modifier_by_key(600001)KVBase.remove_tag
描述: 移除标签
KVBase.remove_tag(_tag)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_tag | Str | 标签 |
示例:
kVBase.remove_tag("enemy")AbilityComp.remove_ability
描述: 移除槽位上的技能
AbilityComp.remove_ability(_ability_slot)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_ability_slot | AbilitySlot | 技能槽位 |
返回值:
- 类型:
Bool - 说明: 是否成功移除
示例:
local ability_slot = 1 -- AbilitySlot 是槽位整数索引
local result = abilityComp.remove_ability(ability_slot)Role.reset_camera
描述: 重置玩家相机
Role.reset_camera(_reset_angle, _reset_bind, _reset_point, _reset_prop_pitch)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_reset_angle | Bool | 重置相机角度 |
_reset_bind | Bool | 重置相机模式 |
_reset_point | Bool | 重置相机相对于焦点的位置 |
_reset_prop_pitch | Bool | 重置俯仰角范围 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.reset_camera(true, true, true, true)Obstacle.reset_collision_limit
描述: 重置组件碰撞限制
Obstacle.reset_collision_limit(_limit_type)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_limit_type | CollisionLimitType | 碰撞限制类型 |
示例:
local obstacle = GameAPI.create_obstacle(200001, math.Vector3(0,0,0), math.Quaternion(0,0,0), math.Vector3(1,1,1), nil)
obstacle.reset_collision_limit(Enums.CollisionLimitType.NONE)Role.show_dynamic_text
描述: 在指定坐标显示动态字
Role.show_dynamic_text(_text, _pos, _color, _duration, _anim_type)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_text | Str | 文本 |
_pos | Point3 | 坐标 |
_color | Color | 颜色 |
_duration | Fixed | 持续时间 |
_anim_type | Int | 类型(0静态1动态) |
返回值:
- 类型:
DynamicTextID - 说明: 动态文字ID
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = role.show_dynamic_text("示例文本", math.Vector3(0, 0, 0), math.Color(1, 0, 0, 1), 1.0, 1)Role.add_score
描述: 增加玩家积分
Role.add_score(_add_score)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_add_score | Int | 积分 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.add_score(1)Role.get_camp
描述: 获取玩家阵营
Role.get_camp()返回值:
- 类型:
Camp - 说明: 阵营
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = role.get_camp()Role.enter_watch_mode
描述: 玩家进入观战
Role.enter_watch_mode(_camp_limit, _exit_visible)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_camp_limit | Bool | 是否限制阵营观战 |
_exit_visible | Bool | 是否支持手动退出 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.enter_watch_mode(true, true)Role.exit_watch_mode
描述: 玩家退出观战
Role.exit_watch_mode()示例:
local role = GameAPI.get_all_valid_roles()[1]
role.exit_watch_mode()Role.get_commodity_count
描述: 玩家拥有道具数量
Role.get_commodity_count(_commodity_id)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_commodity_id | UgcCommodity | 道具 |
返回值:
- 类型:
Int - 说明: 拥有道具数量
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = role.get_commodity_count(ugc_commodity)Role.is_achievement_completed
描述: 成就是否完成
Role.is_achievement_completed(_event_id)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_event_id | Achievement | 成就 |
返回值:
- 类型:
Bool - 说明: 是否完成
示例:
local role = GameAPI.get_all_valid_roles()[1]
local achievement = 1 -- Achievement 是成就编号(integer)
local result = role.is_achievement_completed(event_id)Role.is_watch_mode
描述: 玩家进入观战
Role.is_watch_mode()返回值:
- 类型:
Bool - 说明: 是否处于观战模式
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = role.is_watch_mode()Role.play_2d_sound_with_params
描述: 玩家播放2D音效
Role.play_2d_sound_with_params(_event_id, _duration, _volume, _speed)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_event_id | SoundID | 音效ID |
_duration | Fixed | 持续时间 |
_volume | Fixed | 音量 |
_speed | Fixed | 播放速度 |
返回值:
- 类型:
SoundID - 说明: 音效ID
示例:
local role = GameAPI.get_all_valid_roles()[1]
local sound_id = nil -- SoundID 需由 GameAPI.play_sound_* 系列 API 返回,请查阅文档
local result = role.play_2d_sound_with_params(event_id, 1.0, 1.0, 1.0)Role.pause_camera_motor
描述: 暂停玩家相机运动
Role.pause_camera_motor()示例:
local role = GameAPI.get_all_valid_roles()[1]
role.pause_camera_motor()Role.play_advertisement_with_event
描述: 播放广告
Role.play_advertisement_with_event(_success_event, _fail_event, _ad_tag, _success_data, _fail_data)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_success_event | Str | 成功事件 |
_fail_event | Str | 失败事件 |
_ad_tag | Str | 广告标签 |
_success_data | Dict | 成功附带参数 |
_fail_data | Dict | 失败附带参数 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
-- 带附加参数的用法:成功/失败时附带额外数据到事件回调
role.play_advertisement_with_event(
"ad_success_event", -- 成功事件名
"ad_fail_event", -- 失败事件名
"enemy", -- 广告标签
{ -- 成功附带参数 (success_data)
reward_type = "gold",
reward_amount = 100,
bonus_exp = 50
},
{ -- 失败附带参数 (fail_data)
error_code = 1001,
retry_count = 3,
fail_reason = "network_timeout"
}
)Role.play_ui_effect
描述: 播放界面动效
Role.play_ui_effect(_effect_node)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_effect_node | EEffectNode | UI动效 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.play_ui_effect(effect_node)Role.play_montage
描述: 播放指定剧情动画
Role.play_montage(_montage_key, _start_time, _play_to_end, _play_time)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_montage_key | MontageKey | 剧情动画编号 |
_start_time | Fixed | 起始时间 |
_play_to_end | Bool | 是否播完 |
_play_time | Fixed | 播放时长 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.play_montage(260001, 1.0, true, 1.0)Role.reset_animation
描述: 重置界面动画
Role.reset_animation(_node)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_node | ENode | UI节点 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
local node = LuaAPI.query_ui_node(role, "panel_main")
role.reset_animation(node)Role.resume_camera_motor
描述: 恢复玩家相机运动
Role.resume_camera_motor()示例:
local role = GameAPI.get_all_valid_roles()[1]
role.resume_camera_motor()Role.send_track_data_change
描述: 发送埋点数据变化
Role.send_track_data_change(_track_data_key, _change_num)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_track_data_key | Str | 埋点key |
_change_num | Int | 数据变化 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.send_track_data_change("key_001", 1)Role.set_bagslot_related_lifeentity
描述: 设置物品格关联生命体
Role.set_bagslot_related_lifeentity(_bag_slot, _life_entity)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_bag_slot | EBagSlot | UI物品格 |
_life_entity | LifeEntity | 生命体 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
local npc = LuaAPI.query_unit("平凡蛋0") -- NPC单位,AI行为的执行者
role.set_bagslot_related_lifeentity(bag_slot_node, npc)Role.set_battle_shop_visible
描述: 设置玩家商店显示
Role.set_battle_shop_visible(_battle_shop_id, _visible)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_battle_shop_id | BattleShopKey | 商店 |
_visible | Bool | 显示/隐藏 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.set_battle_shop_visible(310001, true)Role.set_blind_corner
描述: 玩家设置暗角
Role.set_blind_corner(_enable, _strength, _color)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_enable | Bool | 启用 |
_strength | Fixed | 强度 |
_color | Color | 颜色 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.set_blind_corner(true, 1.0, math.Color(1, 0, 0, 1))Role.set_button_enabled
描述: 设置按钮控件的状态
Role.set_button_enabled(_button, _enabled)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_button | EButton | UI按钮 |
_enabled | Bool | 状态 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.set_button_enabled(btn_node, true)Role.set_button_font_size
描述: 设置UI按钮节点文字字号
Role.set_button_font_size(_key, _font_size)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_key | EButton | UI按钮节点 |
_font_size | Fixed | 字号 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.set_button_font_size(btn_node, 1.0)Role.set_button_normal_image
描述: 设置UI按钮节点常态图片
Role.set_button_normal_image(_button, _image_key)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_button | EButton | UI按钮节点 |
_image_key | ImageKey | 图片 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.set_button_normal_image(btn_node, 170001)Role.set_button_pressed_image
描述: 设置UI按钮节点按下图片
Role.set_button_pressed_image(_button, _image_key)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_button | EButton | UI按钮节点 |
_image_key | ImageKey | 图片 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.set_button_pressed_image(btn_node, 170001)Role.set_button_text
描述: 设置UI按钮节点文本
Role.set_button_text(_button, _text)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_button | EButton | UI按钮节点 |
_text | Str | 文本 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.set_button_text(btn_node, "示例文本")Role.set_button_text_color
描述: 设置UI按钮节点文字颜色
Role.set_button_text_color(_button, _text_color)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_button | EButton | UI按钮节点 |
_text_color | Color | 颜色 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.set_button_text_color(btn_node, math.Color(1, 0, 0, 1))Role.set_gyroscope_control_unit
描述: 设置玩家陀螺仪控制组件
Role.set_gyroscope_control_unit(_is_control, _unit)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_is_control | Bool | 是否由陀螺仪控制 |
_unit | Unit | 单位 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
local role = GameAPI.get_all_valid_roles()[1]
role.set_gyroscope_control_unit(true, role)Role.set_image_color
描述: 设置UI图片颜色
Role.set_image_color(_image, _image_color, _transition_time)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_image | EImage | UI图片节点 |
_image_color | Color | 颜色 |
_transition_time | Fixed | 变化时间 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.set_image_color(img_node, math.Color(1, 0, 0, 1), 1.0)Role.set_image_texture_by_key_with_auto_resize
描述: 设置UI图片节点图片
Role.set_image_texture_by_key_with_auto_resize(_image, _image_key, _reset_size)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_image | EImage | UI图片节点 |
_image_key | ImageKey | 图片 |
_reset_size | Bool | 是否重置大小 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.set_image_texture_by_key_with_auto_resize(img_node, 170001, true)Role.set_input_field_text
描述: 设置UI输入节点文本
Role.set_input_field_text(_input_field, _text)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_input_field | EInputField | UI输入节点 |
_text | Str | 文本 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.set_input_field_text(input_node, "示例文本")Role.set_label_background_color
描述: 设置UI文本节点背景颜色
Role.set_label_background_color(_label, _color, _transition_time)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_label | ELabel | UI文本节点 |
_color | Color | 颜色 |
_transition_time | Fixed | 变化时间 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.set_label_background_color(lbl_node, math.Color(1, 0, 0, 1), 1.0)Role.set_label_background_opacity
描述: 设置UI文本节点背景不透明度
Role.set_label_background_opacity(_label, _opacity, _transition_time)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_label | ELabel | UI文本节点 |
_opacity | Fixed | 不透明度 |
_transition_time | Fixed | 变化时间 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.set_label_background_opacity(lbl_node, 1.0, 1.0)Role.set_label_color
描述: 设置UI文本节点的字体颜色
Role.set_label_color(_label, _color, _transition_time)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_label | ELabel | UI文本节点 |
_color | Color | 颜色 |
_transition_time | Fixed | 变化时间 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.set_label_color(lbl_node, math.Color(1, 0, 0, 1), 1.0)Role.set_label_font
描述: 设置UI文本节点字体
Role.set_label_font(_label, _font_key)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_label | ELabel | UI文本节点 |
_font_key | FontKey | 字体key |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.set_label_font(lbl_node, 280001)Role.set_label_font_size
描述: 设置UI文本节点的字体大小
Role.set_label_font_size(_label, _font_size, _transition_time)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_label | ELabel | UI文本节点 |
_font_size | Int | 字号 |
_transition_time | Fixed | 变化时间 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.set_label_font_size(lbl_node, 1, 1.0)Role.set_label_outline_color
描述: 设置UI文本节点的描边颜色
Role.set_label_outline_color(_label, _color)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_label | ELabel | UI文本节点 |
_color | Color | 描边颜色 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.set_label_outline_color(lbl_node, math.Color(1, 0, 0, 1))Role.set_label_outline_enabled
描述: 设置UI文本节点的描边是否开启
Role.set_label_outline_enabled(_label, _enable)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_label | ELabel | UI文本节点 |
_enable | Bool | 是否开启描边 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.set_label_outline_enabled(lbl_node, true)Role.set_label_outline_opacity
描述: 设置UI文本节点的描边不透明度
Role.set_label_outline_opacity(_label, _opacity)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_label | ELabel | UI文本节点 |
_opacity | Fixed | 描边不透明度 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.set_label_outline_opacity(lbl_node, 1.0)Role.set_label_outline_width
描述: 设置UI文本节点的描边大小
Role.set_label_outline_width(_label, _width)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_label | ELabel | UI文本节点 |
_width | Fixed | 描边大小 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.set_label_outline_width(lbl_node, 1.0)Role.set_label_shadow_color
描述: 设置UI文本节点的阴影颜色
Role.set_label_shadow_color(_label, _color)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_label | ELabel | UI文本节点 |
_color | Color | 阴影颜色 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.set_label_shadow_color(lbl_node, math.Color(1, 0, 0, 1))Role.set_label_shadow_enabled
描述: 设置UI文本节点的阴影是否开启
Role.set_label_shadow_enabled(_label, _enable)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_label | ELabel | UI文本节点 |
_enable | Bool | 是否开启阴影 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.set_label_shadow_enabled(lbl_node, true)Role.set_label_shadow_x_offset
描述: 设置UI文本节点的阴影x偏移
Role.set_label_shadow_x_offset(_label, _offset)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_label | ELabel | UI文本节点 |
_offset | Fixed | x方向偏移 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.set_label_shadow_x_offset(lbl_node, 1.0)Role.set_label_shadow_y_offset
描述: 设置UI文本节点的阴影y偏移
Role.set_label_shadow_y_offset(_label, _offset)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_label | ELabel | UI文本节点 |
_offset | Fixed | y方向偏移 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.set_label_shadow_y_offset(lbl_node, 1.0)Role.set_label_text
描述: 设置UI文本节点的文本
Role.set_label_text(_label, _text)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_label | ELabel | UI文本节点 |
_text | Str | 文本 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.set_label_text(lbl_node, "示例文本")Role.set_camera_rotation_sync_enabled
描述: 设置是否开启玩家相机旋转同步
Role.set_camera_rotation_sync_enabled(_enabled)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_enabled | Bool | 是否同步 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.set_camera_rotation_sync_enabled(true)Role.set_gyroscope_sync_enabled
描述: 设置监听陀螺仪信息
Role.set_gyroscope_sync_enabled(_enabled)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_enabled | Bool | 是否监听 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.set_gyroscope_sync_enabled(true)Role.set_name_visible
描述: 设置玩家昵称可见性
Role.set_name_visible(_visible)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_visible | Bool | 是否可见 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.set_name_visible(true)Role.set_animation_state
描述: 设置节点动画状态
Role.set_animation_state(_node, _animation_name, _state)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_node | ENode | UI节点 |
_animation_name | Str | 动画名称 |
_state | EAnimationState | 状态 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
local node = LuaAPI.query_ui_node(role, "panel_main")
role.set_animation_state(node, "平凡蛋0", Enums.EAnimationState.IDLE)Role.set_node_touch_enabled
描述: 设置UI节点交互开关
Role.set_node_touch_enabled(_node, _touch_enabled)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_node | ENode | UI节点 |
_touch_enabled | Bool | 交互开关 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
local node = LuaAPI.query_ui_node(role, "panel_main")
role.set_node_touch_enabled(node, true)Role.set_node_visible
描述: 设置UI节点可见性
Role.set_node_visible(_node, _visible)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_node | ENode | UI节点 |
_visible | Bool | 可见性 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
local node = LuaAPI.query_ui_node(role, "panel_main")
role.set_node_visible(node, true)Role.set_progressbar_current
描述: 设置UI进度条节点进度
Role.set_progressbar_current(_progress_bar, _current)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_progress_bar | EProgressbar | UI进度条节点 |
_current | Int | 进度 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.set_progressbar_current(progress_node, 1)Role.set_progressbar_max
描述: 设置UI进度条节点最大进度
Role.set_progressbar_max(_progress_bar, _max)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_progress_bar | EProgressbar | UI进度条节点 |
_max | Int | 最大进度 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.set_progressbar_max(progress_node, 1)Role.set_progressbar_min
描述: 设置UI进度条节点最小进度
Role.set_progressbar_min(_progress_bar, _min)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_progress_bar | EProgressbar | UI进度条节点 |
_min | Int | 最小进度 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.set_progressbar_min(progress_node, 1)Role.set_progressbar_transition
描述: 设置UI进度条节点过渡
Role.set_progressbar_transition(_progress_bar, _current, _transition_time)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_progress_bar | EProgressbar | UI进度条节点 |
_current | Int | 进度 |
_transition_time | Fixed | 过渡时间 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.set_progressbar_transition(progress_node, 1, 1.0)Role.set_score
描述: 设置玩家积分
Role.set_score(_score)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_score | Int | 积分 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.set_score(1)Role.set_goods_panel_visible
描述: 设置付费道具商店可见性
Role.set_goods_panel_visible(_visible)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_visible | Bool | 可见性 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.set_goods_panel_visible(true)Role.set_goods_visible
描述: 设置付费商品可见性
Role.set_goods_visible(_goods_key, _visible)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_goods_key | UgcGoods | 商品 |
_visible | Bool | 可见性 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.set_goods_visible(ugc_goods, true)Role.set_ui_opacity
描述: 设置UI节点不透明度
Role.set_ui_opacity(_node, _opacity)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_node | ENode | UI节点 |
_opacity | Fixed | 不透明度 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
local node = LuaAPI.query_ui_node(role, "panel_main")
role.set_ui_opacity(node, 1.0)Role.set_uipreset_visible
描述: 设置原生界面可见性
Role.set_uipreset_visible(_ui, _visible)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_ui | UIPreset | ui预设 |
_visible | Bool | 是否可见 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.set_uipreset_visible(ui_preset, true)Role.disable_unit_fresnel
描述: 关闭单位菲尼尔效果
Role.disable_unit_fresnel(_unit)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_unit | Unit | 单位 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
local role = GameAPI.get_all_valid_roles()[1]
role.disable_unit_fresnel(role)Role.disable_unit_mask
描述: 关闭单位蒙版
Role.disable_unit_mask(_unit)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_unit | Unit | 单位 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
local role = GameAPI.get_all_valid_roles()[1]
role.disable_unit_mask(role)Role.disable_unit_outline
描述: 关闭单位描边
Role.disable_unit_outline(_unit)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_unit | Unit | 单位 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
local role = GameAPI.get_all_valid_roles()[1]
role.disable_unit_outline(role)Role.set_unit_fresnel_gradual
描述: 设置单位菲尼尔效果
Role.set_unit_fresnel_gradual(_unit, _fresnel_scale, _color, _intensity, _duration)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_unit | Unit | 单位 |
_fresnel_scale | Fixed | 菲尼尔系数 |
_color | Color | 颜色 |
_intensity | Int | 强度 |
_duration | Fixed | 用时 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
local role = GameAPI.get_all_valid_roles()[1]
role.set_unit_fresnel_gradual(role, 1.0, math.Color(1, 0, 0, 1), 1, 1.0)Role.set_unit_visible
描述: 设置单位对玩家可见性
Role.set_unit_visible(_unit, _is_visible, _affect_children)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_unit | Unit | 单位 |
_is_visible | Bool | 是否显示 |
_affect_children | Bool | 是否影响绑定的子组件 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
local role = GameAPI.get_all_valid_roles()[1]
role.set_unit_visible(role, true, true)Role.set_voice_volume_sync_enabled
描述: 设置是否开启语音音量同步
Role.set_voice_volume_sync_enabled(_enabled)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_enabled | Bool | 是否同步 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.set_voice_volume_sync_enabled(true)Role.shake_camera
描述: 设置玩家屏幕震动
Role.shake_camera(_shake_type, _shake_max_amplitude, _shake_time, _shake_source, _shake_frequency, _shake_time_decay, _shake_effect_scope, _shake_undamped_scope, _shake_distance_decay)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_shake_type | CameraShakeType | 震动方向 |
_shake_max_amplitude | Fixed | 震幅 |
_shake_time | Fixed | 震动时间 |
_shake_source | Unit | 震源 |
_shake_frequency | Fixed | 频率 |
_shake_time_decay | Fixed | 时间衰减 |
_shake_effect_scope | Fixed | 生效范围 |
_shake_undamped_scope | Fixed | 不衰减范围 |
_shake_distance_decay | Fixed | 距离衰减 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
local role = GameAPI.get_all_valid_roles()[1]
role.shake_camera(Enums.CameraShakeType.DEFAULT, 1.0, 1.0, role, 1.0, 1.0, 1.0, 1.0, 1.0)Role.show_bag_panel
描述: 设置玩家的背包界面显隐
Role.show_bag_panel(_visible)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_visible | Bool | 是否显示 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.show_bag_panel(true)Role.show_like_panel
描述: 显示点赞界面
Role.show_like_panel()示例:
local role = GameAPI.get_all_valid_roles()[1]
role.show_like_panel()Role.show_map_share_panel
描述: 指定玩家显示地图分享界面
Role.show_map_share_panel()示例:
local role = GameAPI.get_all_valid_roles()[1]
role.show_map_share_panel()Role.show_ultimate_ability_panel
描述: 显示玩家决战技选择界面
Role.show_ultimate_ability_panel(_keep_time)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_keep_time | Int | 时间 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.show_ultimate_ability_panel(1)Role.skip_current_montage
描述: 跳过剧情动画
Role.skip_current_montage(_has_black_screen)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_has_black_screen | Bool | 是否有跳过黑幕 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.skip_current_montage(true)Role.start_vibration
描述: 开始手机震动
Role.start_vibration(_vibrate_type, _vibrate_count, _vibrate_interval)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_vibrate_type | Int | 震动模式 |
_vibrate_count | Int | 震动次数 |
_vibrate_interval | Fixed | 震动间隔 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.start_vibration(1, 1, 1.0)Role.stop_2d_sound
描述: 对指定单位停止2D声音
Role.stop_2d_sound(_sound_instance_id)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_sound_instance_id | SoundID | 音效ID |
示例:
local role = GameAPI.get_all_valid_roles()[1]
local sound_id = nil -- SoundID 需由 GameAPI.play_sound_* 系列 API 返回,请查阅文档
role.stop_2d_sound(sound_instance_id)Role.stop_ui_effect
描述: 停止界面动效
Role.stop_ui_effect(_effect_node)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_effect_node | EEffectNode | UI动效 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.stop_ui_effect(effect_node)Role.stop_camera_motor
描述: 停止玩家相机运动
Role.stop_camera_motor()示例:
local role = GameAPI.get_all_valid_roles()[1]
role.stop_camera_motor()Role.unbind_label_text
描述: UI文本节点解除属性
Role.unbind_label_text(_label)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_label | ELabel | UI文本节点 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.unbind_label_text(lbl_node)Role.unbind_progressbar_current
描述: 为UI进度条节点当前进度解绑属性
Role.unbind_progressbar_current(_progress_bar)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_progress_bar | EProgressbar | UI进度条节点 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.unbind_progressbar_current(progress_node)Role.unbind_progressbar_max
描述: UI进度条节点最大进度解绑属性
Role.unbind_progressbar_max(_progress_bar)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_progress_bar | EProgressbar | UI进度条节点 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.unbind_progressbar_max(progress_node)Ability.set_left_charge_time
描述: 设置技能剩余充能
Ability.set_left_charge_time(_cd_time)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_cd_time | Fixed | 充能时间 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
local ability = role.add_ability_to_slot(1, 150001, {}, {})
ability.set_left_charge_time(1.0)Ability.set_left_cd_time
描述: 设置技能剩余冷却
Ability.set_left_cd_time(_cd_time)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_cd_time | Fixed | 冷却时间 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
local ability = role.add_ability_to_slot(1, 150001, {}, {})
ability.set_left_cd_time(1.0)Ability.set_max_release_num
描述: 设置技能最大使用次数
Ability.set_max_release_num(_release_num_max)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_release_num_max | Int | 最大使用次数 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
local ability = role.add_ability_to_slot(1, 150001, {}, {})
ability.set_max_release_num(1)Ability.set_cur_release_num
描述: 设置技能当前使用次数
Ability.set_cur_release_num(_release_num)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_release_num | Int | 使用次数 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
local ability = role.add_ability_to_slot(1, 150001, {}, {})
ability.set_cur_release_num(1)Role.set_achievement_progress
描述: 设置成就进度
Role.set_achievement_progress(_event_id, _count)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_event_id | Achievement | 成就 |
_count | Int | 成就进度 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
local achievement = 1 -- Achievement 是成就编号(integer)
role.set_achievement_progress(event_id, 1)Character.set_aim_move_enabled
描述: 开关角色靶向移动
Character.set_aim_move_enabled(_enable)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_enable | Bool | 开关 |
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- Character 继承自 LifeEntity,代表NPC角色单位
npc.set_aim_move_enabled(true)Obstacle.set_billboard_text
描述: 设置公告板文本内容
Obstacle.set_billboard_text(_content)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_content | Str | 文本内容 |
示例:
local obstacle = GameAPI.create_obstacle(200001, math.Vector3(0,0,0), math.Quaternion(0,0,0), math.Vector3(1,1,1), nil)
obstacle.set_billboard_text("示例内容")Obstacle.set_billboard_text_color
描述: 设置公告板文本颜色
Obstacle.set_billboard_text_color(_color, _gradient_color_1, _gradient_color_2, _gradient_color_3, _gradient_color_4)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_color | Color | 文本颜色 |
_gradient_color_1 | Color | 渐变色1 |
_gradient_color_2 | Color | 渐变色2 |
_gradient_color_3 | Color | 渐变色3 |
_gradient_color_4 | Color | 渐变色4 |
示例:
local obstacle = GameAPI.create_obstacle(200001, math.Vector3(0,0,0), math.Quaternion(0,0,0), math.Vector3(1,1,1), nil)
obstacle.set_billboard_text_color(math.Color(1, 0, 0, 1), math.Color(1, 0, 0, 1), math.Color(1, 0, 0, 1), math.Color(1, 0, 0, 1), math.Color(1, 0, 0, 1))Obstacle.set_billboard_font_size
描述: 设置公告板文本字体大小
Obstacle.set_billboard_font_size(_font_size)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_font_size | Int | 字体大小 |
示例:
local obstacle = GameAPI.create_obstacle(200001, math.Vector3(0,0,0), math.Quaternion(0,0,0), math.Vector3(1,1,1), nil)
obstacle.set_billboard_font_size(1)Character.set_voice_enabled
描述: 设置角色配音是否生效
Character.set_voice_enabled(_enabled)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_enabled | Bool | 是否启用 |
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- Character 继承自 LifeEntity,代表NPC角色单位
npc.set_voice_enabled(true)Character.set_climb_enabled
描述: 设置角色是否开启攀爬
Character.set_climb_enabled(_enable)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_enable | Bool | 是否开启攀爬 |
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- Character 继承自 LifeEntity,代表NPC角色单位
npc.set_climb_enabled(true)Character.set_climb_max_angle
描述: 设置角色攀爬的最大角度
Character.set_climb_max_angle(_angle)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_angle | Fixed | 角度 |
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- Character 继承自 LifeEntity,代表NPC角色单位
npc.set_climb_max_angle(1.0)Character.set_climb_speed
描述: 设置角色攀爬速度
Character.set_climb_speed(_speed)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_speed | Fixed | 攀爬速度 |
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- Character 继承自 LifeEntity,代表NPC角色单位
npc.set_climb_speed(1.0)Character.set_climb_min_angle
描述: 设置角色攀爬的最小角度
Character.set_climb_min_angle(_angle)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_angle | Fixed | 角度 |
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- Character 继承自 LifeEntity,代表NPC角色单位
npc.set_climb_min_angle(1.0)LifeEntity.set_mass_bar_visible
描述: 设置质量条是否显示
LifeEntity.set_mass_bar_visible(_visible)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_visible | Bool | 是否显示 |
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- NPC单位,AI行为的执行者
npc.set_mass_bar_visible(true)Unit.set_scale
描述: 设置单位缩放
Unit.set_scale(_scale, _time)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_scale | Fixed | 缩放 |
_time | Fixed | 时间 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.set_scale(1.0, 1.0)Obstacle.set_chess_type_and_rank
描述: 设置牌面(对象只能为麻将/扑克)
Obstacle.set_chess_type_and_rank(_card_type, _card_rank)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_card_type | ChessType | 牌名 |
_card_rank | Int | 牌数 |
示例:
local obstacle = GameAPI.create_obstacle(200001, math.Vector3(0,0,0), math.Quaternion(0,0,0), math.Vector3(1,1,1), nil)
obstacle.set_chess_type_and_rank(Enums.ChessType.SPADE, 1)Equipment.set_auto_aim_enabled
描述: 设置枪械自动瞄准
Equipment.set_auto_aim_enabled(_is_auto_aim)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_is_auto_aim | Bool | 是否自动瞄准 |
示例:
local equipment = GameAPI.create_equipment(400001, math.Vector3(0,0,0))
equipment.set_auto_aim_enabled(true)Equipment.set_auto_fire_enabled
描述: 设置枪械自动开火
Equipment.set_auto_fire_enabled(_is_auto_fire)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_is_auto_fire | Bool | 是否自动开火 |
示例:
local equipment = GameAPI.create_equipment(400001, math.Vector3(0,0,0))
equipment.set_auto_fire_enabled(true)Equipment.set_current_stack_num
描述: 设置物品当前堆叠数
Equipment.set_current_stack_num(_num)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_num | Int | 堆叠数 |
示例:
local equipment = GameAPI.create_equipment(400001, math.Vector3(0,0,0))
equipment.set_current_stack_num(1)Equipment.set_desc
描述: 设置物品的描述
Equipment.set_desc(_desc)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_desc | Str | 描述 |
示例:
local equipment = GameAPI.create_equipment(400001, math.Vector3(0,0,0))
equipment.set_desc("示例字符串")Equipment.set_droppable
描述: 设置物品能否丢弃
Equipment.set_droppable(_droppable)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_droppable | Bool | 能否丢弃 |
示例:
local equipment = GameAPI.create_equipment(400001, math.Vector3(0,0,0))
equipment.set_droppable(true)Equipment.set_price
描述: 设置物品的抵押价格
Equipment.set_price(_res_type, _price)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_res_type | Str | 货币类型 |
_price | Int | 卖价 |
示例:
local equipment = GameAPI.create_equipment(400001, math.Vector3(0,0,0))
equipment.set_price("示例字符串", 1)Equipment.set_charge_cost_free
描述: 设置物品充能无消耗
Equipment.set_charge_cost_free(_is_free)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_is_free | Bool | 是否无消耗 |
示例:
local equipment = GameAPI.create_equipment(400001, math.Vector3(0,0,0))
equipment.set_charge_cost_free(true)Equipment.set_icon
描述: 设置物品的图标
Equipment.set_icon(_icon_key)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_icon_key | ImageKey | 图标 |
示例:
local equipment = GameAPI.create_equipment(400001, math.Vector3(0,0,0))
equipment.set_icon(170001)Equipment.set_max_stack_num
描述: 设置物品最大堆叠数
Equipment.set_max_stack_num(_num)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_num | Int | 堆叠数 |
示例:
local equipment = GameAPI.create_equipment(400001, math.Vector3(0,0,0))
equipment.set_max_stack_num(1)Equipment.set_name
描述: 设置物品的名称
Equipment.set_name(_name)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_name | Str | 名称 |
示例:
local equipment = GameAPI.create_equipment(400001, math.Vector3(0,0,0))
equipment.set_name("平凡蛋0")Equipment.set_saleable
描述: 设置物品能否出售
Equipment.set_saleable(_saleable)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_saleable | Bool | 能否出售 |
示例:
local equipment = GameAPI.create_equipment(400001, math.Vector3(0,0,0))
equipment.set_saleable(true)Equipment.start_charge
描述: 使物品开始充能
Equipment.start_charge()示例:
local equipment = GameAPI.create_equipment(400001, math.Vector3(0,0,0))
equipment.start_charge()Equipment.set_usable
描述: 设置物品能否使用
Equipment.set_usable(_usable)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_usable | Bool | 能否使用 |
示例:
local equipment = GameAPI.create_equipment(400001, math.Vector3(0,0,0))
equipment.set_usable(true)UnitInteractVolumeComp.set_interact_button_icon
描述: 设置单位互动按钮图标
UnitInteractVolumeComp.set_interact_button_icon(_interact_id, _icon)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_interact_id | InteractBtnID | 互动按钮ID |
_icon | ImageKey | 互动按钮图标 |
示例:
unitInteractVolumeComp.set_interact_button_icon(1, 170001)UnitInteractVolumeComp.set_interact_button_text
描述: 设置单位互动按钮文本
UnitInteractVolumeComp.set_interact_button_text(_interact_id, _text)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_interact_id | InteractBtnID | 互动按钮ID |
_text | Str | 互动按钮文本 |
示例:
unitInteractVolumeComp.set_interact_button_text(1, "示例文本")UnitInteractVolumeComp.set_interact_enabled
描述: 设置单位互动是否启用
UnitInteractVolumeComp.set_interact_enabled(_enable)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_enable | Bool | 是否启用 |
示例:
unitInteractVolumeComp.set_interact_enabled(true)UnitInteractVolumeComp.set_interact_enabled_by_index
描述: 设置单位互动是否启用(索引)
UnitInteractVolumeComp.set_interact_enabled_by_index(_interact_index, _enable)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_interact_index | Int | 互动索引 |
_enable | Bool | 是否启用 |
示例:
unitInteractVolumeComp.set_interact_enabled_by_index(1, true)JointAssistantComp.set_joint_assistant_enabled
描述: 设置关节组件的启用状态
JointAssistantComp.set_joint_assistant_enabled(_enable)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_enable | Bool | 开关 |
示例:
jointAssistantComp.set_joint_assistant_enabled(true)JointAssistantComp.set_joint_assistant_property
描述: 设置关节组件属性
JointAssistantComp.set_joint_assistant_property(_property_type, _value)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_property_type | JointAssistantProperty | 属性 |
_value | Fixed | 值 |
示例:
jointAssistantComp.set_joint_assistant_property(Enums.JointAssistantProperty.STIFFNESS, 1.0)JointAssistantComp.set_joint_assistant_visible
描述: 设置关节组件可见性
JointAssistantComp.set_joint_assistant_visible(_visible)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_visible | Bool | 可见性 |
示例:
jointAssistantComp.set_joint_assistant_visible(true)LifeEntity.set_hpbar_scale
描述: 设置生命体血条缩放
LifeEntity.set_hpbar_scale(_hpbar_scale_x, _hpbar_scale_y)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_hpbar_scale_x | Fixed | 宽度缩放 |
_hpbar_scale_y | Fixed | 高度缩放 |
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- NPC单位,AI行为的执行者
npc.set_hpbar_scale(1.0, 1.0)LiftComp.set_lift_cooldown
描述: 设置举起冷却时间
LiftComp.set_lift_cooldown(_cd_time)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_cd_time | Fixed | 时间 |
示例:
liftComp.set_lift_cooldown(1.0)LiftComp.set_lift_remaining_cooldown
描述: 设置举起剩余冷却时间
LiftComp.set_lift_remaining_cooldown(_time)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_time | Fixed | 时间 |
示例:
liftComp.set_lift_remaining_cooldown(1.0)Obstacle.set_ranklist_score
描述: 设置场景排行榜分数
Obstacle.set_ranklist_score(_role, _score)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_role | Role | 玩家 |
_score | Int | 分数 |
示例:
local obstacle = GameAPI.create_obstacle(200001, math.Vector3(0,0,0), math.Quaternion(0,0,0), math.Vector3(1,1,1), nil)
local role = GameAPI.get_all_valid_roles()[1]
obstacle.set_ranklist_score(role, 1)Unit.set_model_visible
描述: 设置单位模型是否可见
Unit.set_model_visible(_v)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_v | Bool | 是否可见 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.set_model_visible(true)Unit.set_physics_active
描述: 设置单位物理是否生效
Unit.set_physics_active(_is_active)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_is_active | Bool | 是否生效 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.set_physics_active(true)Modifier.set_remain_duration
描述: 设置效果剩余时间
Modifier.set_remain_duration(_remain_duration)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_remain_duration | Fixed | 剩余持续时间 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
local modifier = role.add_modifier_by_key(600001, {})
modifier.set_remain_duration(1.0)Obstacle.set_climbable
描述: 设置组件是否可攀爬
Obstacle.set_climbable(_enable)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_enable | Bool | 是否可攀爬 |
示例:
local obstacle = GameAPI.create_obstacle(200001, math.Vector3(0,0,0), math.Quaternion(0,0,0), math.Vector3(1,1,1), nil)
obstacle.set_climbable(true)Role.set_role_ctrl_enabled
描述: 设置玩家控制开启/关闭
Role.set_role_ctrl_enabled(_enable)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_enable | Bool | 开启/关闭 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.set_role_ctrl_enabled(true)Role.set_archive_point
描述: 设置存档点坐标
Role.set_archive_point(_position, _priority, _direction)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_position | Point3 | 坐标 |
_priority | Int | 复活优先级 |
_direction | Vector3 | 朝向 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.set_archive_point(math.Vector3(0, 0, 0), 1, math.Vector3(0, 0, 0))RollComp.set_roll_remaining_cooldown
描述: 设置滚动剩余冷却时间
RollComp.set_roll_remaining_cooldown(_remaining_time)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_remaining_time | Fixed | 剩余冷却时间 |
示例:
rollComp.set_roll_remaining_cooldown(1.0)RushComp.set_rush_remaining_cooldown
描述: 设置飞扑剩余冷却时间
RushComp.set_rush_remaining_cooldown(_time)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_time | Fixed | 时间 |
示例:
rushComp.set_rush_remaining_cooldown(1.0)LifeEntity.set_search_enemy_focus_target
描述: 设置搜敌集火目标
LifeEntity.set_search_enemy_focus_target(_target)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_target | Unit | 目标 |
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- NPC单位,AI行为的执行者
local role = GameAPI.get_all_valid_roles()[1]
npc.set_search_enemy_focus_target(role)EquipmentComp.select_equipment_slot
描述: 设置单位选中物品格
EquipmentComp.select_equipment_slot(_slot_type, _slot_index)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_slot_type | EquipmentSlotType | 槽位类型 |
_slot_index | Int | 槽位索引 |
示例:
equipmentComp.select_equipment_slot(Enums.EquipmentSlotType.EQUIPPED, 1)Modifier.set_stack_count
描述: 设置效果层数
Modifier.set_stack_count(_stack_count_add)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_stack_count_add | Int | 层数 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
local modifier = role.add_modifier_by_key(600001, {})
modifier.set_stack_count(1)KVBase.add_tag
描述: 添加标签
KVBase.add_tag(_tag)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_tag | Str | 标签 |
示例:
kVBase.add_tag("enemy")Role.set_unit_fresnel
描述: 设置单位菲尼尔效果
Role.set_unit_fresnel(_unit, _fresnel_scale, _color, _intensity)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_unit | Unit | 单位 |
_fresnel_scale | Fixed | 菲尼尔系数 |
_color | Color | 颜色 |
_intensity | Int | 强度 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
local role = GameAPI.get_all_valid_roles()[1]
role.set_unit_fresnel(role, 1.0, math.Color(1, 0, 0, 1), 1)LifeEntity.set_max_yaw_speed
描述: 设置单位每秒最大旋转速度
LifeEntity.set_max_yaw_speed(_limit_yaw_speed)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_limit_yaw_speed | Fixed | yaw值改变速度 |
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- NPC单位,AI行为的执行者
npc.set_max_yaw_speed(1.0)Role.set_unit_mask
描述: 设置单位蒙版
Role.set_unit_mask(_unit, _color)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_unit | Unit | 单位 |
_color | Color | 颜色 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
local role = GameAPI.get_all_valid_roles()[1]
role.set_unit_mask(role, math.Color(1, 0, 0, 1))Unit.set_mirror_reflect_enabled
描述: 开关镜面反射
Unit.set_mirror_reflect_enabled(_enable)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_enable | Bool | 是否启用 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.set_mirror_reflect_enabled(true)LifeEntity.disable_yaw_speed_limit
描述: 关闭单位最大旋转速度限制
LifeEntity.disable_yaw_speed_limit()示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- NPC单位,AI行为的执行者
npc.disable_yaw_speed_limit()Unit.set_orientation
描述: 设置单位旋转
Unit.set_orientation(_rot)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_rot | Quaternion | 旋转 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.set_orientation(math.Quaternion(0, 0, 0))Role.set_unit_outline
描述: 设置单位描边
Role.set_unit_outline(_unit, _width, _color)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_unit | Unit | 单位 |
_width | Int | 粗细 |
_color | Color | 颜色 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
local role = GameAPI.get_all_valid_roles()[1]
role.set_unit_outline(role, 1, math.Color(1, 0, 0, 1))Unit.set_position
描述: 重置单位坐标
Unit.set_position(_pos)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_pos | Vector3 | 坐标 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.set_position(math.Vector3(0, 0, 0))Role.set_unit_see_through_enabled
描述: 设置单位穿透显示
Role.set_unit_see_through_enabled(_unit, _enabled)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_unit | Unit | 单位 |
_enabled | Bool | 是否穿透显示 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
local role = GameAPI.get_all_valid_roles()[1]
role.set_unit_see_through_enabled(role, true)TriggerSpace.set_virtual_light_brightness
描述: 设置光源亮度
TriggerSpace.set_virtual_light_brightness(_brightness)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_brightness | Fixed | 亮度 |
示例:
local ts = GameAPI.create_triggerspace(900001, math.Vector3(0,0,0), math.Quaternion(0,0,0), math.Vector3(1,1,1), nil)
ts.set_virtual_light_brightness(1.0)Role.show_goods_purchase_panel
描述: 玩家显示指定商品购买界面
Role.show_goods_purchase_panel(_raw_goods_id, _show_time)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_raw_goods_id | UgcGoods | 商品 |
_show_time | Fixed | 显示时间 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.show_goods_purchase_panel(ugc_goods, 1.0)LifeEntity.start_ai
描述: 激活AI
LifeEntity.start_ai()示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- NPC单位,AI行为的执行者
npc.start_ai()LifeEntity.stop_ai
描述: 暂停AI
LifeEntity.stop_ai()示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- NPC单位,AI行为的执行者
npc.stop_ai()Unit.model_stop_animation
描述: 模型停止动画
Unit.model_stop_animation()示例:
local role = GameAPI.get_all_valid_roles()[1]
role.model_stop_animation()Unit.stop_sound
描述: 单位停止播放声音
Unit.stop_sound(_lres_id)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_lres_id | SoundID | 音效ID |
示例:
local role = GameAPI.get_all_valid_roles()[1]
local sound_id = nil -- SoundID 需由 GameAPI.play_sound_* 系列 API 返回,请查阅文档
role.stop_sound(lres_id)DisplayComp.bind_model
描述: 添加绑定模型
DisplayComp.bind_model(_model_id, _socket, _offset, _rot, _scale)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_model_id | UnitKey | 单位编号 |
_socket | ModelSocket | 挂点 |
_offset | Point3 | 偏移 |
_rot | Quaternion | 旋转 |
_scale | Vector3 | 缩放 |
返回值:
- 类型:
Str - 说明: 绑定ID
示例:
local result = displayComp.bind_model(100001, Enums.ModelSocket.socket_root, math.Vector3(0, 0, 0), math.Quaternion(0, 0, 0), math.Vector3(0, 0, 0))DisplayComp.bind_model_by_unit
描述: 添加绑定模型
DisplayComp.bind_model_by_unit(_unit, _socket, _offset, _rot)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_unit | Unit | 单位 |
_socket | ModelSocket | 挂点 |
_offset | Point3 | 偏移 |
_rot | Quaternion | 旋转 |
返回值:
- 类型:
Str - 说明: 绑定ID
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = displayComp.bind_model_by_unit(role, Enums.ModelSocket.socket_root, math.Vector3(0, 0, 0), math.Quaternion(0, 0, 0))Unit.disable_gravity
描述: 关闭重力影响
Unit.disable_gravity()示例:
local role = GameAPI.get_all_valid_roles()[1]
role.disable_gravity()Unit.enable_gravity
描述: 开启重力影响
Unit.enable_gravity()示例:
local role = GameAPI.get_all_valid_roles()[1]
role.enable_gravity()LiftedComp.is_lifted_enabled
描述: 获取是否可抓举
LiftedComp.is_lifted_enabled()返回值:
- 类型:
Bool - 说明: 是否可抓举
示例:
local result = liftedComp.is_lifted_enabled()Unit.get_max_linear_velocity
描述: 获取单位最大线速度
Unit.get_max_linear_velocity()返回值:
- 类型:
Fixed - 说明: 线速度
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = role.get_max_linear_velocity()Unit.recover_max_linear_velocity
描述: 恢复单位最大线速度
Unit.recover_max_linear_velocity()示例:
local role = GameAPI.get_all_valid_roles()[1]
role.recover_max_linear_velocity()LiftedComp.set_custom_thrown_force
描述: 设置自定义投掷力量
LiftedComp.set_custom_thrown_force(_force)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_force | Fixed | 力量 |
示例:
liftedComp.set_custom_thrown_force(1.0)LiftedComp.set_custom_thrown_force_enabled
描述: 设置是否自定义投掷力量
LiftedComp.set_custom_thrown_force_enabled(_enable)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_enable | Bool | 是否自定义 |
示例:
liftedComp.set_custom_thrown_force_enabled(true)LiftedComp.set_lifted_enabled
描述: 设置是否可抓举
LiftedComp.set_lifted_enabled(_enable)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_enable | Bool | 是否可被抓举 |
示例:
liftedComp.set_lifted_enabled(true)Unit.set_linear_velocity
描述: 改变单位线速度
Unit.set_linear_velocity(_vel)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_vel | Vector3 | 线速度 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.set_linear_velocity(math.Vector3(0, 0, 0))Unit.set_max_linear_velocity
描述: 设置单位最大线速度
Unit.set_max_linear_velocity(_velocity)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_velocity | Fixed | 线速度 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.set_max_linear_velocity(1.0)VehicleComp.reset
描述: 载具复位
VehicleComp.reset()示例:
vehicleComp.reset()VehicleComp.start_move_by_direction
描述: 使载具往某个方向移动一段时间
VehicleComp.start_move_by_direction(_direction, _duration)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_direction | Vector3 | 方向 |
_duration | Fixed | 持续时间 |
示例:
vehicleComp.start_move_by_direction(math.Vector3(0, 0, 0), 1.0)VehicleComp.stop_move
描述: 使载具停止移动
VehicleComp.stop_move()示例:
vehicleComp.stop_move()Role.start_level_vote
描述: 发起进入关卡投票
Role.start_level_vote(_level_key)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_level_key | LevelKey | 关卡编号 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.start_level_vote(290001)AbilityComp.cast_ability_by_ability_slot_and_direction
描述: 控制角色对目标方向释放指定槽位技能
AbilityComp.cast_ability_by_ability_slot_and_direction(_direction, _ability_slot, _duration)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_direction | Vector3 | 方向 |
_ability_slot | AbilitySlot | 技能槽位 |
_duration | Fixed | 时间 |
示例:
local ability_slot = 1 -- AbilitySlot 是槽位整数索引
abilityComp.cast_ability_by_ability_slot_and_direction(math.Vector3(0, 0, 0), ability_slot, 1.0)AbilityComp.cast_ability_by_ability_slot_and_position
描述: 控制角色对目标坐标释放指定槽位技能
AbilityComp.cast_ability_by_ability_slot_and_position(_position, _ability_slot, _duration)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_position | Point3 | 坐标 |
_ability_slot | AbilitySlot | 技能槽位 |
_duration | Fixed | 时间 |
示例:
local ability_slot = 1 -- AbilitySlot 是槽位整数索引
abilityComp.cast_ability_by_ability_slot_and_position(math.Vector3(0, 0, 0), ability_slot, 1.0)AbilityComp.cast_ability_by_ability_slot_and_target
描述: 控制角色对目标单位释放指定槽位技能
AbilityComp.cast_ability_by_ability_slot_and_target(_target, _ability_slot, _duration)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_target | LifeEntity | 目标 |
_ability_slot | AbilitySlot | 技能槽位 |
_duration | Fixed | 时间 |
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- NPC单位,AI行为的执行者
local ability_slot = 1 -- AbilitySlot 是槽位整数索引
abilityComp.cast_ability_by_ability_slot_and_target(npc, ability_slot, 1.0)AbilityComp.cast_ability_by_direction
描述: 控制角色对指定方向执行释放指定预设技能
AbilityComp.cast_ability_by_direction(_ability_key, _duration, _direction, _ability_slot)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_ability_key | AbilityKey | 技能编号 |
_duration | Fixed | 时间 |
_direction | Vector3 | 方向 |
_ability_slot | AbilitySlot | 技能槽位 |
示例:
local ability_slot = 1 -- AbilitySlot 是槽位整数索引
abilityComp.cast_ability_by_direction(150001, 1.0, math.Vector3(0, 0, 0), ability_slot)AbilityComp.cast_ability_by_position
描述: 控制角色对指定坐标执行释放预设技能
AbilityComp.cast_ability_by_position(_ability_key, _duration, _position, _ability_slot)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_ability_key | AbilityKey | 技能编号 |
_duration | Fixed | 时间 |
_position | Point3 | 坐标 |
_ability_slot | AbilitySlot | 技能槽位 |
示例:
local ability_slot = 1 -- AbilitySlot 是槽位整数索引
abilityComp.cast_ability_by_position(150001, 1.0, math.Vector3(0, 0, 0), ability_slot)AbilityComp.cast_ability_by_target
描述: 控制角色对指定目标执行释放指定预设技能
AbilityComp.cast_ability_by_target(_ability_key, _duration, _target, _ability_slot)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_ability_key | AbilityKey | 技能编号 |
_duration | Fixed | 时间 |
_target | LifeEntity | 目标 |
_ability_slot | AbilitySlot | 技能槽位 |
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- NPC单位,AI行为的执行者
local ability_slot = 1 -- AbilitySlot 是槽位整数索引
abilityComp.cast_ability_by_target(150001, 1.0, npc, ability_slot)AbilityComp.get_prop_ability
描述: 获取道具技能
AbilityComp.get_prop_ability()返回值:
- 类型:
Ability - 说明: 技能对象
示例:
local result = abilityComp.get_prop_ability()AbilityComp.remove_prop_ability
描述: 移除道具技能
AbilityComp.remove_prop_ability()返回值:
- 类型:
Bool - 说明: 是否成功移除
示例:
local result = abilityComp.remove_prop_ability()AbilityComp.set_ability_enabled_on_vehicle
描述: 设置是否能在载具上使用用技能
AbilityComp.set_ability_enabled_on_vehicle(_enable)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_enable | Bool | 是否能用技能 |
示例:
abilityComp.set_ability_enabled_on_vehicle(true)AttrComp.get_attr_by_type
描述: 获取属性
AttrComp.get_attr_by_type(_value_type, _key)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_value_type | ValueType | 值类型 |
_key | Str | 属性名 |
返回值:
- 类型:
ETypeMeta - 说明: 属性值
示例:
local result = attrComp.get_attr_by_type(Enums.ValueType.Int, "key_001")AttrComp.set_attr_bonus_fixed
描述: 设置属性的额外固定值(复杂模式)
AttrComp.set_attr_bonus_fixed(_key, _value)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_key | Str | 属性名 |
_value | Fixed | 额外固定值 |
示例:
attrComp.set_attr_bonus_fixed("key_001", 1.0)AttrComp.set_attr_by_type
描述: 设置属性
AttrComp.set_attr_by_type(_value_type, _key, _val)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_value_type | ValueType | 值类型 |
_key | Str | 属性名 |
_val | ETypeMeta | 属性值 |
示例:
attrComp.set_attr_by_type(Enums.ValueType.Int, "key_001", nil --[[ETypeMeta]])AttrComp.set_attr_ratio_fixed
描述: 设置属性的倍率值(复杂模式)
AttrComp.set_attr_ratio_fixed(_key, _value)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_key | Str | 属性名 |
_value | Fixed | 倍率值 |
示例:
attrComp.set_attr_ratio_fixed("key_001", 1.0)AttrComp.set_attr_raw_fixed
描述: 设置属性的基础值(复杂模式)
AttrComp.set_attr_raw_fixed(_key, _value)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_key | Str | 属性名 |
_value | Fixed | 基础值 |
示例:
attrComp.set_attr_raw_fixed("key_001", 1.0)Camp.change_camp_score
描述: 改变阵营积分
Camp.change_camp_score(_add_score)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_add_score | Int | 变化积分 |
示例:
local camp = GameAPI.get_camp(1)
camp.change_camp_score(1)Character.change_custom_model_by_creature
描述: 根据生物修改角色所有外观部位自定义模型
Character.change_custom_model_by_creature(_creature)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_creature | Creature | 生物 |
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- Character 继承自 LifeEntity,代表NPC角色单位
local creature = GameAPI.create_creature_fixed_scale(100001, math.Vector3(0,0,0), math.Quaternion(0,0,0), 1.0, GameAPI.get_all_valid_roles()[1])
npc.change_custom_model_by_creature(creature)Character.change_custom_model_by_creature_key
描述: 根据生物预设修改角色所有外观部位自定义模型
Character.change_custom_model_by_creature_key(_creature_key)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_creature_key | CreatureKey | 生物编号 |
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- Character 继承自 LifeEntity,代表NPC角色单位
npc.change_custom_model_by_creature_key(100001)Character.get_joystick_direction
描述: 获取角色原始输入前进方向
Character.get_joystick_direction()返回值:
- 类型:
Vector3 - 说明: 摇杆控制前进方向
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- Character 继承自 LifeEntity,代表NPC角色单位
local result = npc.get_joystick_direction()Character.set_socket_model_by_creature_key
描述: 修改角色指定外观部位为自定义模型
Character.set_socket_model_by_creature_key(_model_socket, _creature_key, _creature_model_socket)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_model_socket | ModelSocket | 外观部位 |
_creature_key | CreatureKey | 生物编号 |
_creature_model_socket | ModelSocket | 外观部位 |
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- Character 继承自 LifeEntity,代表NPC角色单位
npc.set_socket_model_by_creature_key(Enums.ModelSocket.socket_root, 100001, Enums.ModelSocket.socket_root)Creature.force_start_move
描述: 命令生物移动
Creature.force_start_move(_direction, _t)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_direction | Vector3 | 方向 |
_t | Fixed | 时间 |
示例:
local creature = GameAPI.create_creature_fixed_scale(100001, math.Vector3(0,0,0), math.Quaternion(0,0,0), 1.0, GameAPI.get_all_valid_roles()[1])
creature.force_start_move(math.Vector3(0, 0, 0), 1.0)Creature.force_stop_move
描述: 命令生物停止移动
Creature.force_stop_move()示例:
local creature = GameAPI.create_creature_fixed_scale(100001, math.Vector3(0,0,0), math.Quaternion(0,0,0), 1.0, GameAPI.get_all_valid_roles()[1])
creature.force_stop_move()Creature.reset_target_socket_model
描述: 还原生物指定外观部位变化
Creature.reset_target_socket_model(_model_socket)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_model_socket | ModelSocket | 外观部位 |
示例:
local creature = GameAPI.create_creature_fixed_scale(100001, math.Vector3(0,0,0), math.Quaternion(0,0,0), 1.0, GameAPI.get_all_valid_roles()[1])
creature.reset_target_socket_model(Enums.ModelSocket.socket_root)Creature.set_socket_model
描述: 修改生物指定外观部位为自定义模型
Creature.set_socket_model(_model_socket, _creature, _creature_model_socket)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_model_socket | ModelSocket | 外观部位 |
_creature | Creature | 生物 |
_creature_model_socket | ModelSocket | 外观部位 |
示例:
local creature = GameAPI.create_creature_fixed_scale(100001, math.Vector3(0,0,0), math.Quaternion(0,0,0), 1.0, GameAPI.get_all_valid_roles()[1])
creature.set_socket_model(Enums.ModelSocket.socket_root, creature, Enums.ModelSocket.socket_root)Creature.set_socket_model_by_creature_key
描述: 修改生物指定外观部位为自定义模型
Creature.set_socket_model_by_creature_key(_model_socket, _creature_key, _creature_model_socket)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_model_socket | ModelSocket | 外观部位 |
_creature_key | CreatureKey | 生物编号 |
_creature_model_socket | ModelSocket | 外观部位 |
示例:
local creature = GameAPI.create_creature_fixed_scale(100001, math.Vector3(0,0,0), math.Quaternion(0,0,0), 1.0, GameAPI.get_all_valid_roles()[1])
creature.set_socket_model_by_creature_key(Enums.ModelSocket.socket_root, 100001, Enums.ModelSocket.socket_root)DisplayComp.force_play_animation_by_anim_key
描述: 强制播放动画
DisplayComp.force_play_animation_by_anim_key(_anim_key, _start_time, _play_time, _play_rate, _is_loop)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_anim_key | AnimKey | 动画编号 |
_start_time | Fixed | 开始时间 |
_play_time | Fixed | 持续时间 |
_play_rate | Fixed | 播放速率 |
_is_loop | Bool | 是否循环 |
示例:
displayComp.force_play_animation_by_anim_key(250001, 1.0, 1.0, 1.0, true)Equipment.drop
描述: 物品被丢弃
Equipment.drop()示例:
local equipment = GameAPI.create_equipment(400001, math.Vector3(0,0,0))
equipment.drop()EquipmentComp.set_equipment_max_count
描述: 修改最大可持有的物品数量
EquipmentComp.set_equipment_max_count(_slot_type, _slot_num)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_slot_type | EquipmentSlotType | 槽位类型 |
_slot_num | Int | 数量 |
示例:
equipmentComp.set_equipment_max_count(Enums.EquipmentSlotType.EQUIPPED, 1)ItemBox.add_equipment
描述: 添加物品箱刷新预设
ItemBox.add_equipment(_key, _weight)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_key | EquipmentKey | 物品编号 |
_weight | Int | 权重 |
示例:
itemBox.add_equipment(400001, 1)ItemBox.remove_equipment
描述: 移除物品箱刷新预设
ItemBox.remove_equipment(_key)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_key | EquipmentKey | 物品编号 |
示例:
itemBox.remove_equipment(400001)JumpComp.get_multi_jump_remaining_cooldown
描述: 获取多段跳剩余冷却
JumpComp.get_multi_jump_remaining_cooldown()返回值:
- 类型:
Fixed - 说明: 冷却时间
示例:
local result = jumpComp.get_multi_jump_remaining_cooldown()JumpComp.set_multi_jump_remaining_cooldown
描述: 设置多段跳剩余冷却
JumpComp.set_multi_jump_remaining_cooldown(_cd)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_cd | Fixed | 冷却时间 |
示例:
jumpComp.set_multi_jump_remaining_cooldown(1.0)KVBase.get_kv_by_type
描述: 获取自定义值
KVBase.get_kv_by_type(_value_type, _key)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_value_type | ValueType | 值类型 |
_key | Str | 名称 |
返回值:
- 类型:
ETypeMeta - 说明: 自定义值
示例:
local result = kVBase.get_kv_by_type(Enums.ValueType.Int, "key_001")KVBase.set_kv_by_type
描述: 设置自定义值
KVBase.set_kv_by_type(_value_type, _key, _val)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_value_type | ValueType | 值类型 |
_key | Str | 名称 |
_val | ETypeMeta | 自定义值 |
示例:
kVBase.set_kv_by_type(Enums.ValueType.Int, "key_001", nil --[[ETypeMeta]])LifeComp.change_hp
描述: 改变健康值
LifeComp.change_hp(_value)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_value | Fixed | 改变健康值 |
示例:
lifeComp.change_hp(1.0)LifeComp.get_hp
描述: 获取健康值
LifeComp.get_hp()返回值:
- 类型:
Fixed - 说明: 健康值
示例:
local result = lifeComp.get_hp()LifeComp.get_hp_max
描述: 获取最大健康值
LifeComp.get_hp_max()返回值:
- 类型:
Fixed - 说明: 最大健康值
示例:
local result = lifeComp.get_hp_max()LifeComp.get_life
描述: 获取当前命数
LifeComp.get_life()返回值:
- 类型:
Int - 说明: 当前命数
示例:
local result = lifeComp.get_life()LifeComp.get_life_max
描述: 获取最大命数
LifeComp.get_life_max()返回值:
- 类型:
Int - 说明: 当前命数
示例:
local result = lifeComp.get_life_max()LifeComp.set_hp_max
描述: 设置最大健康值
LifeComp.set_hp_max(_value)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_value | Fixed | 最大健康值 |
示例:
lifeComp.set_hp_max(1.0)LifeComp.set_life_count
描述: 改变当前命数
LifeComp.set_life_count(_value)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_value | Int | 当前命数 |
示例:
lifeComp.set_life_count(1)LifeComp.set_life_max
描述: 改变最大命数
LifeComp.set_life_max(_value)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_value | Int | 最大命数 |
示例:
lifeComp.set_life_max(1)LifeComp.set_reborn_in_place
描述: 设置是否原地复活
LifeComp.set_reborn_in_place(_reborn_in_place, _reset_camera)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_reborn_in_place | Bool | 是否原地复活 |
_reset_camera | Bool | 是否重置相机 |
示例:
lifeComp.set_reborn_in_place(true, true)LifeEntity.ai_command_chase_with_ability
描述: 控制AI执行追击行为(技能)
LifeEntity.ai_command_chase_with_ability(_target, _chase_range, _reject_time, _action_distance, _ability_key, _move_mode, _action_count)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_target | Unit | 目标 |
_chase_range | Fixed | 追击范围 |
_reject_time | Fixed | 厌恶时间 |
_action_distance | Fixed | 反应距离 |
_ability_key | AbilityKey | 反应行为 |
_move_mode | MoveMode | 移动方式 |
_action_count | Int | 追击次数 |
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- NPC单位,AI行为的执行者
local role = GameAPI.get_all_valid_roles()[1]
npc.ai_command_chase_with_ability(role, 1.0, 1.0, 1.0, 150001, Enums.MoveMode.DEFAULT, 1)LifeEntity.ai_command_chase_with_action
描述: 控制AI执行追击行为(命令)
LifeEntity.ai_command_chase_with_action(_target, _chase_range, _reject_time, _action_distance, _action_mode, _move_mode, _action_count)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_target | Unit | 目标 |
_chase_range | Fixed | 追击范围 |
_reject_time | Fixed | 厌恶时间 |
_action_distance | Fixed | 反应距离 |
_action_mode | AIBasicCommand | 反应行为 |
_move_mode | MoveMode | 移动方式 |
_action_count | Int | 追击次数 |
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- NPC单位,AI行为的执行者
local role = GameAPI.get_all_valid_roles()[1]
npc.ai_command_chase_with_action(role, 1.0, 1.0, 1.0, Enums.AIBasicCommand.MOVE, Enums.MoveMode.DEFAULT, 1)LifeEntity.ai_command_chase_with_equipment
描述: 控制AI执行追击行为(物品)
LifeEntity.ai_command_chase_with_equipment(_target, _chase_range, _reject_time, _action_distance, _equipment_key, _move_mode, _action_count)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_target | Unit | 目标 |
_chase_range | Fixed | 追击范围 |
_reject_time | Fixed | 厌恶时间 |
_action_distance | Fixed | 反应距离 |
_equipment_key | EquipmentKey | 反应行为 |
_move_mode | MoveMode | 移动方式 |
_action_count | Int | 追击次数 |
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- NPC单位,AI行为的执行者
local role = GameAPI.get_all_valid_roles()[1]
npc.ai_command_chase_with_equipment(role, 1.0, 1.0, 1.0, 400001, Enums.MoveMode.DEFAULT, 1)LifeEntity.ai_command_start_move_high_priority
描述: 控制AI执行高优先级寻路命令
LifeEntity.ai_command_start_move_high_priority(_target_position, _duration, _threshold)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_target_position | ListVector3 | 坐标 |
_duration | Fixed | 持续时间 |
_threshold | Fixed | 距离阈值 |
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- NPC单位,AI行为的执行者
npc.ai_command_start_move_high_priority({math.Vector3(0, 0, 0), math.Vector3(1, 0, 0)}, 1.0, 1.0)LifeEntity.jump
描述: 命令角色跳跃
LifeEntity.jump()示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- NPC单位,AI行为的执行者
npc.jump()LifeEntity.set_model_by_creature_key
描述: 根据生物预设设置模型
LifeEntity.set_model_by_creature_key(_creature_key, _include_custom_model, _inherit_scale, _inherit_capsule_size)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_creature_key | CreatureKey | 生物编号 |
_include_custom_model | Bool | 是否包含自定义形象 |
_inherit_scale | Bool | 是否继承缩放 |
_inherit_capsule_size | Bool | 是否继承胶囊体 |
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- NPC单位,AI行为的执行者
npc.set_model_by_creature_key(100001, true, true, true)LifeEntity.set_search_enemy_priority_value_by_tag
描述: 设置搜敌优先级值by标签
LifeEntity.set_search_enemy_priority_value_by_tag(_tag, _priority)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_tag | Str | 标签 |
_priority | Int | 优先级 |
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- NPC单位,AI行为的执行者
npc.set_search_enemy_priority_value_by_tag("enemy", 1)LifeEntity.set_search_enemy_priority_value_by_unit
描述: 设置搜敌优先级值by单位实体
LifeEntity.set_search_enemy_priority_value_by_unit(_unit, _priority)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_unit | Unit | 单位实体 |
_priority | Int | 优先级 |
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- NPC单位,AI行为的执行者
local role = GameAPI.get_all_valid_roles()[1]
npc.set_search_enemy_priority_value_by_unit(role, 1)LifeEntity.set_search_enemy_priority_value_by_unit_key
描述: 设置搜敌优先级值by预设编号
LifeEntity.set_search_enemy_priority_value_by_unit_key(_unit_key, _priority)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_unit_key | CreatureKey | 预设编号 |
_priority | Int | 优先级 |
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- NPC单位,AI行为的执行者
npc.set_search_enemy_priority_value_by_unit_key(100001, 1)LifeEntity.set_search_enemy_priority_value_by_unit_type
描述: 设置搜敌优先级值by单位类型
LifeEntity.set_search_enemy_priority_value_by_unit_type(_unit_prefab_type, _priority)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_unit_prefab_type | UnitType | 单位类型 |
_priority | Int | 优先级 |
示例:
local npc = LuaAPI.query_unit("平凡蛋0") -- NPC单位,AI行为的执行者
npc.set_search_enemy_priority_value_by_unit_type(Enums.UnitType.CHARACTER, 1)Modifier.get_releaser_unit
描述: 获取效果释放者
Modifier.get_releaser_unit()返回值:
- 类型:
Unit - 说明: 效果释放者
示例:
local role = GameAPI.get_all_valid_roles()[1]
local modifier = role.add_modifier_by_key(600001, {})
local result = modifier.get_releaser_unit()ModifierComp.add_modifier
描述: 添加效果
ModifierComp.add_modifier(_modifier_id)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_modifier_id | ModifierKey | 效果编号 |
返回值:
- 类型:
Modifier - 说明: 是否添加成功
示例:
local result = modifierComp.add_modifier(600001)Obstacle.set_collision_count_limit
描述: 设置组件碰撞次数限制
Obstacle.set_collision_count_limit(_limit_type, _value)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_limit_type | CollisionLimitType | 碰撞限制类型 |
_value | Int | 值 |
示例:
local obstacle = GameAPI.create_obstacle(200001, math.Vector3(0,0,0), math.Quaternion(0,0,0), math.Vector3(1,1,1), nil)
obstacle.set_collision_count_limit(Enums.CollisionLimitType.NONE, 1)Obstacle.set_collision_interval_limit
描述: 设置组件碰撞间隔限制
Obstacle.set_collision_interval_limit(_limit_type, _value)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_limit_type | CollisionLimitType | 碰撞限制类型 |
_value | Fixed | 值 |
示例:
local obstacle = GameAPI.create_obstacle(200001, math.Vector3(0,0,0), math.Quaternion(0,0,0), math.Vector3(1,1,1), nil)
obstacle.set_collision_interval_limit(Enums.CollisionLimitType.NONE, 1.0)Role.game_lose_and_show_result_panel
描述: 玩家游戏失败并显示失败界面
Role.game_lose_and_show_result_panel()示例:
local role = GameAPI.get_all_valid_roles()[1]
role.game_lose_and_show_result_panel()Role.game_win_and_show_result_panel
描述: 玩家游戏胜利并显示胜利界面
Role.game_win_and_show_result_panel()示例:
local role = GameAPI.get_all_valid_roles()[1]
role.game_win_and_show_result_panel()Role.get_archive_by_type
描述: 获取存档值
Role.get_archive_by_type(_archive_type, _key)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_archive_type | ArchiveType | 存档类型 |
_key | Archive | 存档 |
返回值:
- 类型:
ETypeMeta - 说明: 存档值
示例:
local role = GameAPI.get_all_valid_roles()[1]
local archive = 1 -- Archive 是存档编号(integer)
local result = role.get_archive_by_type(Enums.ArchiveType.ROLE, key)Role.get_archive_sheetid
描述: 获取表格存档
Role.get_archive_sheetid(_key)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_key | Archive | 存档 |
返回值:
- 类型:
SheetID - 说明: 表格id
示例:
local role = GameAPI.get_all_valid_roles()[1]
local archive = 1 -- Archive 是存档编号(integer)
local result = role.get_archive_sheetid(key)Role.get_game_result
描述: 获取玩家游戏结果
Role.get_game_result()返回值:
- 类型:
GameResult - 说明: 游戏结局
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = role.get_game_result()Role.get_roleid
描述: 播放广告并触发成功失败事件
Role.get_roleid()返回值:
- 类型:
RoleID - 说明: 玩家ID
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = role.get_roleid()Role.lose
描述: 玩家游戏失败
Role.lose()示例:
local role = GameAPI.get_all_valid_roles()[1]
role.lose()Role.send_ui_custom_event
描述: 发送UI自定义消息
Role.send_ui_custom_event(_event_name, _data)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_event_name | Str | 自定义事件名 |
_data | Dict | 附带参数 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.send_ui_custom_event(role, { -- 自定义参数
weapon_id = 1001
})Role.set_archive_by_type
描述: 设置存档值
Role.set_archive_by_type(_archive_type, _key, _val)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_archive_type | ArchiveType | 存档类型 |
_key | Archive | 存档 |
_val | ETypeMeta | 存档值 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
local archive = 1 -- Archive 是存档编号(integer)
role.set_archive_by_type(Enums.ArchiveType.ROLE, key, nil --[[ETypeMeta]])Role.set_archive_sheetid
描述: 设置表格存档
Role.set_archive_sheetid(_key, _val)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_key | Archive | 存档 |
_val | SheetID | 表格id |
示例:
local role = GameAPI.get_all_valid_roles()[1]
local archive = 1 -- Archive 是存档编号(integer)
local sheet = GameAPI.create_sheet()
role.set_archive_sheetid(key, sheet)Role.set_camera_bind_mode
描述: 设置玩家相机的模式
Role.set_camera_bind_mode(_mode)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_mode | CameraBindMode | 模式 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.set_camera_bind_mode(Enums.CameraBindMode.FOLLOW)Role.set_camera_draggable
描述: 设置玩家相机是否可拖动
Role.set_camera_draggable(_draggable)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_draggable | Bool | 可拖动 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.set_camera_draggable(true)Role.set_camera_gyroscope_control_enabled
描述: 设置玩家陀螺仪控制镜头
Role.set_camera_gyroscope_control_enabled(_is_control)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_is_control | Bool | 陀螺仪控制 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.set_camera_gyroscope_control_enabled(true)Role.set_camera_lock_position
描述: 设置玩家相机的绑定坐标
Role.set_camera_lock_position(_pos)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_pos | Point3 | 点 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.set_camera_lock_position(math.Vector3(0, 0, 0))Role.set_camera_projection_type
描述: 设置玩家相机的投影类型
Role.set_camera_projection_type(_projection_type)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_projection_type | CameraProjectionType | 投影类型 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.set_camera_projection_type(Enums.CameraProjectionType.PERSPECTIVE)Role.set_camera_property
描述: 设置玩家相机的属性
Role.set_camera_property(_property, _value)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_property | CameraPropertyType | 属性 |
_value | Fixed | 值 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.set_camera_property(Enums.CameraPropertyType.FOLLOW, 1.0)Role.set_camera_rotation_by_direction
描述: 设置玩家相机面向指定朝向
Role.set_camera_rotation_by_direction(_target_dir, _duration)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_target_dir | Vector3 | 目标方向 |
_duration | Fixed | 用时 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.set_camera_rotation_by_direction(math.Vector3(0, 0, 0), 1.0)Role.set_image_texture_with_auto_resize
描述: 设置UI图片节点图片
Role.set_image_texture_with_auto_resize(_image, _image_path, _reset_size)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_image | EImage | UI图片节点 |
_image_path | Str | 图片 |
_reset_size | Bool | 是否重置大小 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.set_image_texture_with_auto_resize(img_node, "res/path", true)Role.show_tips
描述: 玩家显示飘字信息
Role.show_tips(_content, _duration)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_content | Str | 字符串 |
_duration | Fixed | 时长 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.show_tips("示例内容", 1.0)Role.stop_montage
描述: 结束指定剧情动画
Role.stop_montage(_montage_key, _has_black_screen)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_montage_key | MontageKey | 剧情动画编号 |
_has_black_screen | Bool | 是否有跳过黑幕 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.stop_montage(260001, true)Role.win
描述: 玩家胜利
Role.win()示例:
local role = GameAPI.get_all_valid_roles()[1]
role.win()RollComp.get_roll_cooldown
描述: 获取滚动冷却时间
RollComp.get_roll_cooldown()返回值:
- 类型:
Fixed - 说明: 冷却时间
示例:
local result = rollComp.get_roll_cooldown()RollComp.set_roll_cooldown
描述: 设置滚动冷却时间
RollComp.set_roll_cooldown(_time)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_time | Fixed | 时间 |
示例:
rollComp.set_roll_cooldown(1.0)RushComp.get_rush_cooldown
描述: 获取飞扑冷却时间
RushComp.get_rush_cooldown()返回值:
- 类型:
Fixed - 说明: 冷却时间
示例:
local result = rushComp.get_rush_cooldown()RushComp.set_rush_cooldown
描述: 设置飞扑冷却时间
RushComp.set_rush_cooldown(_time)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_time | Fixed | 时间 |
示例:
rushComp.set_rush_cooldown(1.0)TriggerSystem.has_timer
描述: 判断计时器是否存在
TriggerSystem.has_timer(_timer)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_timer | Timer | 计时器 |
返回值:
- 类型:
Bool - 说明: 是否存在
示例:
local timer = nil -- Timer 对象需由引擎事件回调提供
local result = TriggerSystem.has_timer(timer)Unit.apply_force_at_local_point
描述: 对单位施加外力(局部坐标)
Unit.apply_force_at_local_point(_force, _local_point)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_force | Vector3 | 力 |
_local_point | Point3 | 局部坐标点 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.apply_force_at_local_point(math.Vector3(0, 0, 0), math.Vector3(0, 0, 0))Unit.apply_force_at_world_point
描述: 对单位施加外力(世界坐标)
Unit.apply_force_at_world_point(_force, _world_point)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_force | Vector3 | 力 |
_world_point | Point3 | 世界坐标点 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.apply_force_at_world_point(math.Vector3(0, 0, 0), math.Vector3(0, 0, 0))Unit.apply_torque
描述: 对单位施加扭矩
Unit.apply_torque(_torque)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_torque | Vector3 | 扭矩 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.apply_torque(math.Vector3(0, 0, 0))Unit.disable_unit_ccd
描述: 关闭单位CCD
Unit.disable_unit_ccd()示例:
local role = GameAPI.get_all_valid_roles()[1]
role.disable_unit_ccd()Unit.enable_unit_ccd
描述: 开启单位CCD
Unit.enable_unit_ccd()示例:
local role = GameAPI.get_all_valid_roles()[1]
role.enable_unit_ccd()Unit.get_camp
描述: 获取单位所属阵营
Unit.get_camp()返回值:
- 类型:
Camp - 说明: 阵营
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = role.get_camp()Unit.get_camp_id
描述: 获取单位所属阵营id
Unit.get_camp_id()返回值:
- 类型:
CampID - 说明: 阵营ID
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = role.get_camp_id()Unit.get_child_by_name
描述: 根据单位编号获取子组件
Unit.get_child_by_name(_name)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_name | Str | 子单位名称 |
返回值:
- 类型:
Unit - 说明: 单位
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = role.get_child_by_name("平凡蛋0")Unit.get_current_mass
描述: 获取当前质量
Unit.get_current_mass()返回值:
- 类型:
Fixed - 说明: 质量
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = role.get_current_mass()Unit.get_current_mass_center
描述: 获取当前质心位置(局部坐标)
Unit.get_current_mass_center()返回值:
- 类型:
Vector3 - 说明: 质心位置
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = role.get_current_mass_center()Unit.get_role
描述: 获取单位所属玩家
Unit.get_role()返回值:
- 类型:
Role - 说明: 所属玩家
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = role.get_role()Unit.get_role_id
描述: 获取单位所属玩家ID
Unit.get_role_id()返回值:
- 类型:
RoleID - 说明: 玩家ID
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = role.get_role_id()Unit.is_creature
描述: 是否为生物
Unit.is_creature()返回值:
- 类型:
Bool - 说明: 是否为生物
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = role.is_creature()Unit.is_dynamic_body
描述: 是受力物体
Unit.is_dynamic_body()返回值:
- 类型:
Bool - 说明: 是否受力物体
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = role.is_dynamic_body()Unit.is_kinematic_body
描述: 是动力学物体
Unit.is_kinematic_body()返回值:
- 类型:
Bool - 说明: 是否动力学物体
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = role.is_kinematic_body()Unit.is_static_body
描述: 是静态物体
Unit.is_static_body()返回值:
- 类型:
Bool - 说明: 是否静态物体
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = role.is_static_body()Unit.play_3d_sound
描述: 单位开始播放3d音效
Unit.play_3d_sound(_sound_key, _duration, _volume)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_sound_key | SoundKey | 声音编号 |
_duration | Fixed | 持续时间 |
_volume | Fixed | 音量 |
返回值:
- 类型:
SoundID - 说明: 音效ID
示例:
local role = GameAPI.get_all_valid_roles()[1]
local result = role.play_3d_sound(800001, 1.0, 1.0)Unit.set_acc_motor_init_velocity
描述: 设置加速运动初速度并重置
Unit.set_acc_motor_init_velocity(_index, _init_vel)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_index | Int | 索引 |
_init_vel | Vector3 | 初速度 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.set_acc_motor_init_velocity(1, math.Vector3(0, 0, 0))Unit.set_aircraft_tick_handler
描述: 飞行器自定义
Unit.set_aircraft_tick_handler(_handler)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_handler | Function | 飞行核心函数 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.set_aircraft_tick_handler(function() end)Unit.set_current_mass
描述: 设置当前质量
Unit.set_current_mass(_mass)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_mass | Fixed | 质量 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.set_current_mass(1.0)Unit.set_current_mass_center
描述: 设置当前质心位置(局部坐标)
Unit.set_current_mass_center(_center)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_center | Vector3 | 质心位置 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.set_current_mass_center(math.Vector3(0, 0, 0))Unit.set_linear_motor_velocity
描述: 设置直线运动速度
Unit.set_linear_motor_velocity(_index, _vel, _is_local)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_index | Int | 索引 |
_vel | Vector3 | 线速度 |
_is_local | Bool | 是否局部空间 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.set_linear_motor_velocity(1, math.Vector3(0, 0, 0), true)Unit.set_orientation_smooth
描述: 设置单位旋转(带平滑)
Unit.set_orientation_smooth(_rot)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_rot | Quaternion | 旋转 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.set_orientation_smooth(math.Quaternion(0, 0, 0))Unit.set_position_smooth
描述: 重置单位坐标(带平滑)
Unit.set_position_smooth(_pos)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_pos | Vector3 | 坐标 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.set_position_smooth(math.Vector3(0, 0, 0))Unit.set_world_scale
描述: 设置单位世界空间下的缩放
Unit.set_world_scale(_scale)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_scale | Vector3 | 缩放 |
示例:
local role = GameAPI.get_all_valid_roles()[1]
role.set_world_scale(math.Vector3(0, 0, 0))UnitInteractVolumeComp.set_interact_button_text_by_index
描述: 设置单位互动按钮文本
UnitInteractVolumeComp.set_interact_button_text_by_index(_interact_index, _text)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_interact_index | Int | 互动索引 |
_text | Str | 互动按钮文本 |
示例:
unitInteractVolumeComp.set_interact_button_text_by_index(1, "示例文本")EVENT
ABILITY_BULLET_HIT
子弹命中
事件主体 Ability 技能
事件携带参数 ability Ability 触发事件的技能 事件携带参数 unit Unit 技能拥有者 事件携带参数 target_unit Unit 目标对象 事件携带参数 dmg Fixed 伤害值
ABILITY_SWITCH_IN
技能切入
事件主体 Ability 技能
事件携带参数 ability Ability 触发事件的技能 事件携带参数 unit Unit 技能拥有者 事件携带参数 switch_out_ability Ability 切换前的技能
ABILITY_SWITCH_OUT
技能切出
事件主体 Ability 技能
事件携带参数 ability Ability 触发事件的技能 事件携带参数 unit Unit 技能拥有者 事件携带参数 switch_in_ability Ability 切换后的技能
ABILITY_ACCUMULATE_BEGIN
技能蓄力阶段开始
事件主体 Ability 技能
事件携带参数 ability Ability 触发事件的技能 事件携带参数 unit Unit 技能拥有者
ABILITY_ACCUMULATE_INTERRUPT
技能蓄力阶段被打断
事件主体 Ability 技能
事件携带参数 ability Ability 触发事件的技能 事件携带参数 unit Unit 技能拥有者
ABILITY_ACCUMULATE_END
技能蓄力阶段结束
事件主体 Ability 技能
事件携带参数 ability Ability 触发事件的技能 事件携带参数 unit Unit 技能拥有者
ABILITY_CAST_BEGIN
技能施法阶段开始
事件主体 Ability 技能
事件携带参数 ability Ability 触发事件的技能 事件携带参数 unit Unit 技能拥有者
ABILITY_CAST_BREAK
技能施法阶段被打断
事件主体 Ability 技能
事件携带参数 ability Ability 触发事件的技能 事件携带参数 unit Unit 技能拥有者
ABILITY_CAST_END
技能施法阶段结束
事件主体 Ability 技能
事件携带参数 ability Ability 触发事件的技能 事件携带参数 unit Unit 技能拥有者
ABILITY_CD_END
技能冷却完成
事件主体 Ability 技能
事件携带参数 ability Ability 触发技能 事件携带参数 unit Unit 技能拥有者
ABILITY_CHARGE_END
技能充能完成
事件主体 Ability 技能
事件携带参数 ability Ability 触发技能 事件携带参数 unit Unit 技能拥有者
ABILITY_DOWNGRADE
技能降级
事件主体 Ability 技能
事件携带参数 ability Ability 触发事件的技能
ABILITY_REMOVE
失去技能
事件主体 Ability 技能
事件携带参数 ability Ability 触发事件的技能 事件携带参数 unit Unit 技能拥有者
ABILITY_ADD
获得技能
事件主体 Ability 技能
事件携带参数 ability Ability 触发事件的技能 事件携带参数 unit Unit 技能拥有者
ABILITY_UPGRADE
技能升级
事件主体 Ability 技能
事件携带参数 ability Ability 触发事件的技能 事件携带参数 unit Unit 技能拥有者
ANY_CAMP_SCORE_UPDATE
阵营积分变化
事件主体 Global 全局触发器
事件携带参数 camp Camp 触发阵营 事件携带参数 old_camp_score Int 得分前积分 事件携带参数 new_camp_score Int 得分后积分
ANY_CUSTOMTRIGGERSPACE_CREATE
任意触发区域创建
事件主体 Global 全局触发器
事件携带参数 unit CustomTriggerSpace 被创建的触发区域
ANY_CUSTOMTRIGGERSPACE_DESTROY
任意触发区域销毁
事件主体 Global 全局触发器
事件携带参数 unit CustomTriggerSpace 被销毁的触发区域
ANY_EQUIPMENT_CHANGE_SLOT
任意物品位置发生变化
事件主体 Global 全局触发器
事件携带参数 equipment Equipment 触发事件的物品 事件携带参数 owner LifeEntity 持有者 事件携带参数 old_slot_type EquipmentSlotType 旧槽位类型 事件携带参数 old_index Int 旧槽位索引 事件携带参数 new_slot_type EquipmentSlotType 新槽位类型 事件携带参数 new_index Int 新槽位索引
ANY_EQUIPMENT_TRIGGER_SPACE
任意物品进出区域事件
事件主体 Global 全局触发器
注册参数 trigger_event_type TriggerSpaceEventType 触发类型 注册参数 customtriggerspace_id CustomTriggerSpaceID 触发区域ID
事件携带参数 event_unit Equipment 触发物品 事件携带参数 event_unit_id EquipmentID TRIGGER_EQUIPMENT_ID 事件携带参数 trigger_event_type TriggerSpaceEventType 触发类型 事件携带参数 trigger_zone_id CustomTriggerSpaceID 触发区域ID 事件携带参数 trigger_zone CustomTriggerSpace 事件触发区域
ANY_LIFEENTITY_TRIGGER_SPACE
任意生命体进出区域事件
事件主体 Global 全局触发器
注册参数 trigger_event_type TriggerSpaceEventType 触发类型 注册参数 trigger_zone_id CustomTriggerSpaceID 触发区域ID
事件携带参数 event_unit LifeEntity 触发角色/生物 事件携带参数 event_unit_id UnitID 触发角色/生物ID 事件携带参数 trigger_event_type TriggerSpaceEventType 触发类型 事件携带参数 trigger_zone_id CustomTriggerSpaceID 触发区域ID 事件携带参数 trigger_zone CustomTriggerSpace 事件触发区域
ANY_OBSTACLE_CREATE
任意组件创建
事件主体 Global 全局触发器
事件携带参数 unit Obstacle 被创建的组件
ANY_OBSTACLE_DESTROY
任意组件销毁
事件主体 Global 全局触发器
事件携带参数 unit Obstacle 被销毁的组件
ANY_OBSTACLE_LIFTED_BEGAN
任意组件被举起
事件主体 Global 全局触发器
事件携带参数 lift_unit Unit 抓举者 事件携带参数 lifted_unit Obstacle 被抓举者
ANY_OBSTACLE_LIFTED_ENDED
任意组件被放下
事件主体 Global 全局触发器
事件携带参数 lift_unit Unit 抓举者 事件携带参数 lifted_unit Obstacle 被抓举者
ANY_OBSTACLE_TRIGGER_SPACE
任意组件进出触发区域
事件主体 Global 全局触发器
注册参数 trigger_event_type TriggerSpaceEventType 触发类型 注册参数 trigger_zone_id CustomTriggerSpaceID 触发区域ID
事件携带参数 event_unit Obstacle 触发组件 事件携带参数 event_unit_id ObstacleID 触发组件ID 事件携带参数 trigger_event_type TriggerSpaceEventType 触发类型 事件携带参数 trigger_zone_id CustomTriggerSpaceID 触发区域ID 事件携带参数 trigger_zone CustomTriggerSpace 事件触发区域
ANY_ROLE_SCORE_UPDATE
玩家积分变化
事件主体 Global 全局触发器
事件携带参数 role Role 触发玩家 事件携带参数 old_role_score Int 得分前积分 事件携带参数 new_role_score Int 得分后积分
ANY_TRIGGERSPACE_CREATE
任意逻辑体创建
事件主体 Global 全局触发器
事件携带参数 unit TriggerSpace 被创建的逻辑体
ANY_TRIGGERSPACE_DESTROY
任意逻辑体销毁
事件主体 Global 全局触发器
事件携带参数 unit TriggerSpace 被销毁的逻辑体
CUSTOM_EVENT
自定义事件
事件主体 Default 多类型
注册参数 name Str 自定义事件
ENV_TIME_REACHED
环境时间到达指定时刻
事件主体 Global 全局触发器
注册参数 target_time Fixed TARGET_MAP_TIME
GAME_END
游戏结束
事件主体 Global 全局触发器
GAME_INIT
游戏初始化
事件主体 Global 全局触发器
LEVEL_BEGIN
进入关卡
事件主体 Default 多类型
事件携带参数 level_key LevelKey 当前关卡
LEVEL_END
离开关卡
事件主体 Default 多类型
事件携带参数 level_key LevelKey 当前关卡
MODIFIER_OBTAIN
获得效果
事件主体 Modifier 效果
事件携带参数 from_unit_id UnitID 效果来源单位ID 事件携带参数 modifier Modifier 触发效果 事件携带参数 unit Unit 效果拥有者
MODIFIER_REOBTAIN
覆盖效果
事件主体 Modifier 效果
事件携带参数 modifier Modifier 触发效果 事件携带参数 unit Unit 效果拥有者
MODIFIER_STACK_COUNT_CHANGE
效果层数变化
事件主体 Modifier 效果
事件携带参数 stack_count_change Int 变化层数 事件携带参数 modifier Modifier 触发效果 事件携带参数 unit Unit 效果拥有者
ON_MONTAGE_BEGIN
剧情动画开始播放事件
事件主体 Default 多类型
事件携带参数 play_role Role PLAY_MONTAGE_ROLE 事件携带参数 montage_id MontageKey 触发的剧情动画
ON_MONTAGE_END
剧情动画结束播放事件
事件主体 Default 多类型
事件携带参数 play_role Role PLAY_MONTAGE_ROLE 事件携带参数 montage_id MontageKey 触发的剧情动画
ON_PLAYER_TAKE_PHOTO
玩家拍照
事件主体 Global 全局触发器
事件携带参数 role Role 触发玩家
REPEAT_TIMEOUT
周期性计时器超时
事件主体 Default 多类型
注册参数 delay Fixed 延时
ON_SKY_ENV_CHANGE
天空环境变化
事件主体 Global 全局触发器
SPEC_CHARACTER_SELECT_EQUIPMENT_SLOT
指定角色选中物品格
事件主体 Character 角色
注册参数 event_unit Character 触发角色 注册参数 slot_type EquipmentSlotType 物品格类型 注册参数 slot_index Int EQUIPMENT_SLOT_INDEX
事件携带参数 event_unit Character 触发角色
SPEC_COMMODITY_BRING_INTO_GAME
指定UGC物品被带入游戏
事件主体 Default 多类型
注册参数 commodity_id UgcCommodity SPEC_UGC_COMMODITY
事件携带参数 camp_role_owner Role 携带道具的玩家
SPEC_COMMODITY_PURCHASE
指定UGC物品购买事件
事件主体 Default 多类型
注册参数 commodity_id UgcCommodity SPEC_UGC_COMMODITY
事件携带参数 commodity_id UgcCommodity SPEC_UGC_COMMODITY 事件携带参数 purchase_role Role 购买道具的玩家
SPEC_LIFEENTITY_INTERACTED
指定生物互动按钮被按下
事件主体 Creature 生物
事件携带参数 interact_lifeentity LifeEntity 互动触发者 事件携带参数 interact_unit Creature 互动目标 事件携带参数 interact_id InteractBtnID 互动按钮
SPEC_CUSTOMTRIGGERSPACE_DESTROY
指定触发区域销毁
事件主体 CustomTriggerSpace 触发区域
SPEC_EQUIPMENT_CHANGE_SLOT
指定物品位置发生变化
事件主体 Equipment 物品
事件携带参数 equipment Equipment 当前物品 事件携带参数 owner LifeEntity 持有者 事件携带参数 old_slot_type EquipmentSlotType 旧槽位类型 事件携带参数 old_index Int 旧槽位索引 事件携带参数 new_slot_type EquipmentSlotType 新槽位类型 事件携带参数 new_index Int 新槽位索引
SPEC_EQUIPMENT_DESTROY
指定物品销毁事件
事件主体 Equipment 物品
事件携带参数 equipment Equipment 当前物品
SPEC_EQUIPMENT_ENTER_CHAR_SLOT
指定物品进入角色栏位
事件主体 Equipment 物品
注册参数 equipment Equipment 当前物品 注册参数 slot_type EquipmentSlotType 物品格类型
事件携带参数 equipment Equipment 当前物品 事件携带参数 slot_type EquipmentSlotType 物品格类型 事件携带参数 owner Character 触发事件的角色
SPEC_EQUIPMENT_LEAVE_CHAR_SLOT
指定物品离开角色栏位
事件主体 Equipment 物品
注册参数 equipment Equipment 当前物品 注册参数 slot_type EquipmentSlotType 物品格类型
事件携带参数 equipment Equipment 当前物品 事件携带参数 slot_type EquipmentSlotType 物品格类型 事件携带参数 owner Character 触发事件的角色
SPEC_EQUIPMENT_LOST
指定物品被失去
事件主体 Equipment 物品
事件携带参数 equipment Equipment 当前物品 事件携带参数 owner LifeEntity 持有者 事件携带参数 slot_type EquipmentSlotType 物品槽位类型 事件携带参数 slot_index Int 物品槽位索引
SPEC_EQUIPMENT_OBTAIN
指定物品被获得
事件主体 Equipment 物品
事件携带参数 equipment Equipment 当前物品 事件携带参数 owner LifeEntity 持有者 事件携带参数 count Int 获得数量
SPEC_EQUIPMENT_SELECT
指定物品被选中
事件主体 Equipment 物品
事件携带参数 equipment Equipment 当前物品
SPEC_EQUIPMENT_STACK_NUM_CHANGE
指定物品堆叠层数变化
事件主体 Equipment 物品
事件携带参数 equipment Equipment 当前物品 事件携带参数 variation Int 变化层数
SPEC_EQUIPMENT_SWAP_SLOT
指定物品发生位置交换
事件主体 Equipment 物品
事件携带参数 equipment Equipment 当前物品
SPEC_EQUIPMENT_UNSELECT
指定物品被取消选中
事件主体 Equipment 物品
事件携带参数 equipment Equipment 当前物品
SPEC_EQUIPMENT_USE
指定物品被使用
事件主体 Equipment 物品
事件携带参数 equipment Equipment 当前物品
SPEC_LIFEENTITY_ABILITY_DOWNGRADE
指定生命体技能降级
事件主体 LifeEntity 生命体
事件携带参数 unit LifeEntity 技能拥有者 事件携带参数 ability Ability 触发技能
SPEC_LIFEENTITY_ABILITY_OBTAIN
指定生命体获得技能
事件主体 LifeEntity 生命体
事件携带参数 unit LifeEntity 技能拥有者 事件携带参数 ability Ability 触发技能
SPEC_LIFEENTITY_ABILITY_REMOVE
指定生命体失去技能
事件主体 LifeEntity 生命体
事件携带参数 unit LifeEntity 技能拥有者 事件携带参数 ability Ability 触发技能
SPEC_LIFEENTITY_ABILITY_UPGRADE
指定生命体技能升级
事件主体 LifeEntity 生命体
事件携带参数 unit LifeEntity 技能拥有者 事件携带参数 ability Ability 触发技能
SPEC_LIFEENTITY_CHANGE_PREFAB_AFTER
指定生命体切换预设后
事件主体 LifeEntity 生命体
事件携带参数 unit LifeEntity 切换预设的角色/生物
SPEC_LIFEENTITY_CHANGE_PREFAB_BEFORE
指定生命体切换预设前
事件主体 LifeEntity 生命体
事件携带参数 unit LifeEntity 切换预设的角色/生物
SPEC_LIFEENTITY_CONTACT_BEGIN
指定生命体发生碰撞开始
事件主体 LifeEntity 生命体
事件携带参数 unit1 LifeEntity 碰撞者 事件携带参数 unit2 Unit 被碰撞者
SPEC_LIFEENTITY_CONTACT_END
指定生命体发生碰撞结束
事件主体 LifeEntity 生命体
事件携带参数 unit1 LifeEntity 碰撞者 事件携带参数 unit2 Unit 被碰撞者
SPEC_LIFEENTITY_DEFEAT
指定生命体击败其他生命体
事件主体 LifeEntity 生命体
事件携带参数 dmg_unit LifeEntity 伤害来源 事件携带参数 die_unit LifeEntity 被击败者
SPEC_LIFEENTITY_DESTROY
指定生命体被销毁
事件主体 LifeEntity 生命体
SPEC_LIFEENTITY_DIE
指定生命体被击败
事件主体 LifeEntity 生命体
事件携带参数 die_unit LifeEntity 被击败者 事件携带参数 dmg_unit LifeEntity 伤害来源
SPEC_LIFEENTITY_DIE_BEFORE
指定生命体被击败前
事件主体 LifeEntity 生命体
事件携带参数 unit LifeEntity 被击败者 事件携带参数 dmg_unit Unit 伤害来源
SPEC_LIFEENTITY_DMGED_AFTER
指定生命体受到伤害后
事件主体 LifeEntity 生命体
事件携带参数 _dmg_schema DamageSchema DAMAGE_TYPE 事件携带参数 _src Unit 伤害来源 事件携带参数 _dst LifeEntity 伤害目标 事件携带参数 _dmg Damage DAMAGE_OBJ
SPEC_LIFEENTITY_DMGED_BEFORE
指定生命体受到伤害前
事件主体 LifeEntity 生命体
事件携带参数 _dmg_schema DamageSchema DAMAGE_TYPE 事件携带参数 _src Unit 伤害来源 事件携带参数 _dst LifeEntity 伤害目标 事件携带参数 _dmg Damage DAMAGE_OBJ
SPEC_LIFEENTITY_DMG_AFTER
指定生命体造成伤害后
事件主体 LifeEntity 生命体
事件携带参数 _dmg_schema DamageSchema DAMAGE_TYPE 事件携带参数 _src LifeEntity 伤害来源 事件携带参数 _dst LifeEntity 伤害目标 事件携带参数 _dmg Damage DAMAGE_OBJ
SPEC_LIFEENTITY_DMG_BEFORE
指定生命体造成伤害前
事件主体 LifeEntity 生命体
事件携带参数 _dmg_schema DamageSchema DAMAGE_TYPE 事件携带参数 _src LifeEntity 伤害来源 事件携带参数 _dst LifeEntity 伤害目标 事件携带参数 _dmg Damage DAMAGE_OBJ
SPEC_LIFEENTITY_ENTER_VEHICLE
指定生命体上载具
事件主体 LifeEntity 生命体
事件携带参数 unit LifeEntity 触发角色/生物
SPEC_LIFEENTITY_EQUIPMENT_SLOT_CHANGE
指定生命体持有物品槽位发生变化
事件主体 LifeEntity 生命体
事件携带参数 equipment Equipment 触发物品 事件携带参数 old_slot_type EquipmentSlotType 旧槽位类型 事件携带参数 old_index Int 旧槽位索引 事件携带参数 new_slot_type EquipmentSlotType 新槽位类型 事件携带参数 new_index Int 新槽位索引
SPEC_LIFEENTITY_EXIT_VEHICLE
指定生命体下载具
事件主体 LifeEntity 生命体
事件携带参数 unit LifeEntity 触发角色/生物
SPEC_LIFEENTITY_GAIN_EXP
生命体获得经验
事件主体 LifeEntity 生命体
事件携带参数 unit LifeEntity 获得者 事件携带参数 exp Fixed 经验值
SPEC_LIFEENTITY_GET_ITEMBOX
指定生命体获得道具箱
事件主体 LifeEntity 生命体
事件携带参数 life_entity LifeEntity 获得道具的角色/生物
SPEC_LIFEENTITY_JUMP
指定生命体跳跃
事件主体 LifeEntity 生命体
事件携带参数 unit LifeEntity 跳跃者
SPEC_LIFEENTITY_LEVEL_UP
生命体升级
事件主体 LifeEntity 生命体
事件携带参数 unit LifeEntity 获得者 事件携带参数 level Int 当前等级
SPEC_LIFEENTITY_LIFTED_BEGIN
指定生命体被其他单位举起
事件主体 LifeEntity 生命体
事件携带参数 lift_unit Unit 抓举者 事件携带参数 lifted_unit LifeEntity 被抓举者
SPEC_LIFEENTITY_LIFTED_END
指定生命体被其他单位放下
事件主体 LifeEntity 生命体
事件携带参数 lift_unit Unit 抓举者 事件携带参数 lifted_unit LifeEntity 被抓举者
SPEC_LIFEENTITY_LIFT_BEGIN
指定生命体举起其他单位
事件主体 LifeEntity 生命体
事件携带参数 lift_unit LifeEntity 抓举者 事件携带参数 lifted_unit Unit 被抓举者
SPEC_LIFEENTITY_LIFT_END
指定生命体放下其他单位
事件主体 LifeEntity 生命体
事件携带参数 lift_unit LifeEntity 抓举者 事件携带参数 lifted_unit Unit 被抓举者
SPEC_LIFEENTITY_MOVE_BEGIN
指定生命体移动开始
事件主体 LifeEntity 生命体
事件携带参数 unit LifeEntity 获得者
SPEC_LIFEENTITY_MOVE_END
指定生命体移动结束
事件主体 LifeEntity 生命体
事件携带参数 unit LifeEntity 获得者
SPEC_LIFEENTITY_REBORN
指定生命体复活
事件主体 LifeEntity 生命体
事件携带参数 unit LifeEntity 复活者
SPEC_LIFEENTITY_RELEASE_ABILITY
指定生命体释放技能
事件主体 LifeEntity 生命体
事件携带参数 unit LifeEntity 触发角色/生物 事件携带参数 ability Ability 触发事件的技能
SPEC_LIFEENTITY_ROLL_BEGIN
指定生命体滚动开始
事件主体 LifeEntity 生命体
事件携带参数 unit LifeEntity 滚动者
SPEC_LIFEENTITY_ROLL_END
指定生命体滚动结束
事件主体 LifeEntity 生命体
事件携带参数 unit LifeEntity 滚动者
SPEC_LIFEENTITY_RUSH
指定生命体前扑
事件主体 LifeEntity 生命体
事件携带参数 unit LifeEntity 前扑者 事件携带参数 dir Vector3 前扑方向
SPEC_LIFEENTITY_START_LIFT
指定生命体抓举
事件主体 LifeEntity 生命体
事件携带参数 unit LifeEntity 抓举者 事件携带参数 dir Vector3 抓举方向
MODIFIER_LOSS
失去效果
事件主体 Modifier 效果
事件携带参数 modifier Modifier 触发效果 事件携带参数 unit Unit 效果拥有者
SPEC_OBSTACLE_LIFTED_BEGAN
指定组件发生碰撞开始
事件主体 Obstacle 组件
事件携带参数 unit1 Obstacle 碰撞者 事件携带参数 unit2 Unit 被碰撞者 事件携带参数 contact_pos Vector3 碰撞位置
SPEC_OBSTACLE_CONTACT_END
指定组件发生碰撞结束
事件主体 Obstacle 组件
事件携带参数 unit1 Obstacle 碰撞者 事件携带参数 unit2 Unit 被碰撞者
SPEC_OBSTACLE_DESTROY
指定组件销毁
事件主体 Obstacle 组件
SPEC_OBSTACLE_INTERACTED
指定组件互动按钮被按下
事件主体 Obstacle 组件
事件携带参数 interact_lifeentity LifeEntity 互动触发者 事件携带参数 interact_unit Obstacle 互动目标 事件携带参数 interact_id InteractBtnID 互动按钮
SPEC_OBSTACLE_LIFTED_BEGIN
指定组件被举起
事件主体 Obstacle 组件
事件携带参数 lift_unit Unit 抓举者 事件携带参数 lifted_unit Obstacle 被抓举者
SPEC_OBSTACLE_LIFTED_ENDED
指定组件被放下
事件主体 Obstacle 组件
事件携带参数 lift_unit Unit 抓举者 事件携带参数 lifted_unit Obstacle 被抓举者
SPEC_OBSTACLE_ON_DAMAGED
指定组件受到伤害
事件主体 Obstacle 组件
事件携带参数 src Unit 伤害来源 事件携带参数 src_ability Ability 来源技能 事件携带参数 damage Fixed 伤害值
SPEC_OBSTACLE_TOUCH_BEGIN
指定组件被点击开始
事件主体 Obstacle 组件
事件携带参数 touch_unit Role TOUCH_ROLE 事件携带参数 touched_unit Obstacle 被点击的物体 事件携带参数 touch_pos Vector3 TOUCH_START_POS
SPEC_OBSTACLE_TOUCH_END
指定组件被点击结束
事件主体 Obstacle 组件
事件携带参数 touch_unit Role TOUCH_ROLE 事件携带参数 touched_unit Obstacle 被点击的物体 事件携带参数 touch_pos Vector3 松开位置
SPEC_ROLE_ACHIEVEMENT_COMPLETE
指定玩家完成自定义成就
事件主体 Global 全局触发器
注册参数 role RoleID 目标玩家
事件携带参数 role Role 目标玩家 事件携带参数 achieve_id Achievement TARGET_ACHIEVE
SPEC_ROLE_ACHIEVEMENT_REWARD_GAIN
指定玩家领取成就奖励
事件主体 Global 全局触发器
注册参数 role RoleID 目标玩家 注册参数 achievement Achievement TARGET_ACHIEVE
事件携带参数 role Role 目标玩家 事件携带参数 achieve_id Achievement TARGET_ACHIEVE
SPEC_ROLE_CAMP_CHANGE
指定玩家阵营发生变化
事件主体 Global 全局触发器
注册参数 role RoleID 目标玩家
事件携带参数 role Role 目标玩家 事件携带参数 camp_before_change Camp 变化前的阵营 事件携带参数 camp_after_change Camp 变化后的阵营
SPEC_ROLE_EXIT_GAME
指定玩家离开游戏
事件主体 Global 全局触发器
注册参数 role Role 目标玩家
事件携带参数 role Role 目标玩家
SPEC_ROLE_GAME_LOSE
指定玩家游戏失败
事件主体 Global 全局触发器
注册参数 role RoleID 目标玩家
事件携带参数 role Role 目标玩家
SPEC_ROLE_GAME_WIN
指定玩家游戏胜利
事件主体 Global 全局触发器
注册参数 role RoleID 目标玩家
事件携带参数 role Role 目标玩家
SPEC_ROLE_PURCHASE_GOODS
指定玩家成功购买商品
事件主体 Global 全局触发器
注册参数 role Role 目标玩家
事件携带参数 role Role 目标玩家 事件携带参数 goods_id UgcGoods TARGET_GOODS
SPEC_ROLE_VOICE_VOLUME_CHANGE
语音音量变化事件',
事件主体 Default 多类型
注册参数 role Role 目标玩家
事件携带参数 voice_volume Fixed ECA_PARA_VOICE_VOLUME
SPEC_TRIGGERSPACE_DESTROY
指定逻辑体销毁
事件主体 TriggerSpace 逻辑体
SPEC_COMMODITY_CONSUME
指定UGC物品消费事件
事件主体 Default 多类型
注册参数 commodity_id UgcCommodity SPEC_UGC_COMMODITY
事件携带参数 commodity_id UgcCommodity SPEC_UGC_COMMODITY 事件携带参数 consume_num Int 使用道具的数量 事件携带参数 consume_role Role 使用道具的玩家
TIMEOUT
计时器超时
事件主体 Default 多类型
注册参数 delay Fixed 延时
UI_CUSTOM_EVENT
UI自定义事件(附带玩家)
事件主体 Default 多类型
注册参数 name Str 自定义事件
事件携带参数 role_id RoleID 触发事件的玩家ID 事件携带参数 role Role 触发事件的玩家 事件携带参数 eui_node_id ENode 触发事件的界面控件
TRACK_BULLET_HIT
追踪弹道命中
事件主体 Default 多类型
注册参数 tag Str TAG
事件携带参数 target_unit Unit 追踪目标 事件携带参数 from_unit Unit 子弹来源
TRACK_BULLET_REACH_POSITION
追踪弹道到达目标点
事件主体 Default 多类型
注册参数 tag Str TAG
事件携带参数 target_point Vector3 到达目标 事件携带参数 from_unit Unit 子弹来源
