CLASS
LuaAPI
GlobalAPI
GameAPI
单位API
EditorAPI.create_obstacle
描述: 在场景中创建组件
lua
EditorAPI.create_obstacle(_unit_key, _pos)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_unit_key | ObstacleKey | 组件编号 |
_pos | Point3 | 坐标 |
返回值
- 类型:
UnitID - 说明: 组件ID
EditorAPI.destroy_obstacle
描述: 删除场景中的组件
lua
EditorAPI.destroy_obstacle(_unit_id)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_unit_id | UnitID | 组件ID |
EditorAPI.game_execute
描述: 执行游戏指令
lua
EditorAPI.game_execute(_content)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_content | Str | 代码 |
EditorAPI.get_all_scene_unit_data
描述: 获取场景中所有组件的数据
lua
EditorAPI.get_all_scene_unit_data()返回值
- 类型:
Dict - 说明: 组件列表
EditorAPI.get_all_unit_ids
描述: 获取所有单位
lua
EditorAPI.get_all_unit_ids()返回值
- 类型:
ListUnit - 说明: 单位列表
EditorAPI.get_scene_unit_data
描述: 获取场景中指定ID的组件的数据
lua
EditorAPI.get_scene_unit_data(_uid)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_uid | Int | 组件ID |
返回值
- 类型:
Dict - 说明: 组件数据
EditorAPI.get_selected_unit_ids
描述: 获取当前被选中单位
lua
EditorAPI.get_selected_unit_ids()返回值
- 类型:
ListUnit - 说明: 单位列表
EditorAPI.get_unit_attr
描述: 获取单位属性
lua
EditorAPI.get_unit_attr(_unit_id, _attr_key)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_unit_id | UnitID | 单位ID |
_attr_key | Str | 属性名 |
返回值
- 类型:
ETypeMeta - 说明: 单位列表
EditorAPI.input_ability_prefab
描述: 导入技能预设数据
lua
EditorAPI.input_ability_prefab(_path)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_path | Str | 文件路径 |
EditorAPI.input_char_prefab
描述: 导入蛋仔角色预设数据
lua
EditorAPI.input_char_prefab(_path)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_path | Str | 文件路径 |
EditorAPI.input_creature_prefab
描述: 导入生物预设数据
lua
EditorAPI.input_creature_prefab(_path)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_path | Str | 文件路径 |
EditorAPI.input_decoration_prefab
描述: 导入装饰物预设数据
lua
EditorAPI.input_decoration_prefab(_path)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_path | Str | 文件路径 |
EditorAPI.input_equipment_prefab
描述: 导入物品预设数据
lua
EditorAPI.input_equipment_prefab(_path)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_path | Str | 文件路径 |
EditorAPI.input_group_prefab
描述: 导入组件组预设数据
lua
EditorAPI.input_group_prefab(_path)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_path | Str | 文件路径 |
EditorAPI.input_modifier_prefab
描述: 导入效果预设数据
lua
EditorAPI.input_modifier_prefab(_path)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_path | Str | 文件路径 |
EditorAPI.input_trigger_prefab
描述: 导入逻辑体预设数据
lua
EditorAPI.input_trigger_prefab(_path)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_path | Str | 文件路径 |
EditorAPI.input_unit_prefab
描述: 导入组件预设数据
lua
EditorAPI.input_unit_prefab(_path)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_path | Str | 文件路径 |
EditorAPI.input_virtual_point_prefab
描述: 导入路径点预设数据
lua
EditorAPI.input_virtual_point_prefab(_path)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_path | Str | 文件路径 |
EditorAPI.log
描述: 输出日志
lua
EditorAPI.log(_content)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_content | Str | 日志内容 |
EditorAPI.output_ability_prefab
描述: 导出技能预设数据
lua
EditorAPI.output_ability_prefab(_eid, _path)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_eid | Int | 预设ID |
_path | Str | 文件路径 |
EditorAPI.output_char_prefab
描述: 导出蛋仔角色预设数据
lua
EditorAPI.output_char_prefab(_eid, _path)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_eid | Int | 预设ID |
_path | Str | 文件路径 |
EditorAPI.output_creature_prefab
描述: 导出生物预设数据
lua
EditorAPI.output_creature_prefab(_eid, _path)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_eid | Int | 预设ID |
_path | Str | 文件路径 |
EditorAPI.output_decoration_prefab
描述: 导出装饰物预设数据
lua
EditorAPI.output_decoration_prefab(_eid, _path)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_eid | Int | 预设ID |
_path | Str | 文件路径 |
EditorAPI.output_equipment_prefab
描述: 导出物品预设数据
lua
EditorAPI.output_equipment_prefab(_eid, _path)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_eid | Int | 预设ID |
_path | Str | 文件路径 |
EditorAPI.output_group_prefab
描述: 导出组件组预设数据
lua
EditorAPI.output_group_prefab(_eid, _path)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_eid | Int | 预设ID |
_path | Str | 文件路径 |
EditorAPI.output_modifier_prefab
描述: 导出效果预设数据
lua
EditorAPI.output_modifier_prefab(_eid, _path)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_eid | Int | 预设ID |
_path | Str | 文件路径 |
EditorAPI.output_trigger_prefab
描述: 导出逻辑体预设数据
lua
EditorAPI.output_trigger_prefab(_eid, _path)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_eid | Int | 预设ID |
_path | Str | 文件路径 |
EditorAPI.output_unit_prefab
描述: 导出组件预设数据
lua
EditorAPI.output_unit_prefab(_eid, _path)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_eid | Int | 预设ID |
_path | Str | 文件路径 |
EditorAPI.output_virtual_point_prefab
描述: 导出路径点预设数据
lua
EditorAPI.output_virtual_point_prefab(_eid, _path)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_eid | Int | 预设ID |
_path | Str | 文件路径 |
EditorAPI.query_scene_units
描述: 查询场景中的单位
lua
EditorAPI.query_scene_units(_pattern, _reg_math)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_pattern | Str | 名称 |
_reg_math | Bool | 启用正则匹配 |
返回值
- 类型:
List - 说明: 单位信息列表
EditorAPI.query_unit_ids
描述: 查询场景中的单位
lua
EditorAPI.query_unit_ids(_pattern, _reg_math)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_pattern | Str | 名称 |
_reg_math | Bool | 启用正则匹配 |
返回值
- 类型:
List - 说明: 单位信息列表
EditorAPI.random
描述: 生成随机数
lua
EditorAPI.random(_a, _b)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_a | Fixed | 随机范围开始 |
_b | Fixed | 随机范围结束 |
返回值
- 类型:
Fixed - 说明: 随机结果
EditorAPI.require
描述: 加载脚本模块
lua
EditorAPI.require(_name)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_name | Str | 模块名 |
EditorAPI.set_menu_dialog
描述: 设置菜单对话框
lua
EditorAPI.set_menu_dialog(_name, _config)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_name | Str | 入口名称 |
_config | Dict | 配置描述表 |
EditorAPI.set_unit_attr
描述: 设置单位属性
lua
EditorAPI.set_unit_attr(_unit_id, _attr_key, _attr_value)参数列表:
| 参数 | 类型 | 说明 |
|---|---|---|
_unit_id | UnitID | 单位ID |
_attr_key | Str | 属性名 |
_attr_value | ETypeMeta | 属性值 |
