sunlight-dota2-utils
v1.3.33
Published
用于拓展dota2游廊开发。
Downloads
132
Readme
Sunlight Node Package
- 包的作用域为全局。在开发时不要写任何 export。
- 只收录通用的方法。
使用
- 在项目的 addon_game_mode 中 import 模块的 index 文件:
import 'sunlight-dota2-utils/dist/index';
- 在项目的 addon_game_mode 中 import 模块的 client_index 文件:
import 'sunlight-dota2-utils/dist/client_index';
- 在 client 导入,必须不加密编译后的 lua_modules
"dota_developer": {
"publish_options": {
"encryptFiles": [
"!game/scripts/vscripts/lua_modules/**/*.lua"
]
}
}
使用本 module 需要移除自身项目内重复的 module,比如 [timers] [string] [math] 等模块。
dota 元素的类型定义添加(可选)。
{
"compilerOptions": {
"types": ["sunlight-dota2-utils/dist/types"]
}
}
- 类型定义扩展方法。以英雄名举例。
declare const enum CustomHero {
/** 赵云 */
zhaoyun = 'npc_dota_hero_meepo',
}
declare type HeroName = HeroNameFormat & (DotaHero | CustomHero);