UNPKG

@tomiaa/live2d

Version:
30 lines (29 loc) 719 B
import { Live2d_3_ModelList as d, Live2dModelList as l } from "../modelList.js"; import { URLHelper as i } from "../utils/url.js"; class M { /** * 加载模型列表 */ static loadModelList(t, o) { if (!t && !o) return console.error("loadLive2d_2与loadLive2d_3至少加载一种!"), []; const e = []; return o && e.push(...d), t && e.push(...l), e; } /** * 获取模型基础 URL */ static getModelBaseURL(t, o, e, r) { return t === 3 ? i.getLive2d_3_ModelBaseURL(e, r) : i.getLive2d_2_ModelBaseURL(o, r); } /** * 加载模型 */ static async loadModel(t, o, e, r) { const s = o.list[e]; return await t.from(r + s); } } export { M as ModelManager };