fix(canvas): Live2D 外观 - 补齐随部署发布的 Cubism Core 运行库
This commit is contained in:
@@ -9,13 +9,13 @@ function loadCore() {
|
||||
if (corePromise) return corePromise;
|
||||
corePromise = new Promise<void>((resolve, reject) => {
|
||||
const script = document.createElement("script");
|
||||
// Deployment-owned runtime only. Uploaded models may never provide executable code.
|
||||
// Bundled same-origin runtime only. Uploaded models may never provide executable code.
|
||||
script.src = `${import.meta.env.BASE_URL}live2d/live2dcubismcore.min.js`;
|
||||
const timer = window.setTimeout(() => fail(), 15000);
|
||||
const fail = () => {
|
||||
clearTimeout(timer);
|
||||
script.remove();
|
||||
reject(new Error("Live2D 运行库未安装或加载失败,请部署 Cubism Core 后重试"));
|
||||
reject(new Error("Live2D 运行库加载失败,请确认部署产物包含 Cubism Core 且静态资源可访问后重试"));
|
||||
};
|
||||
script.onload = () => {
|
||||
if (!("Live2DCubismCore" in window)) {
|
||||
|
||||
@@ -163,7 +163,7 @@ export function CanvasAppearanceEditor({ value, onChange, disabled, onUploading
|
||||
}
|
||||
/>
|
||||
) : null}
|
||||
<p className="text-xs text-foreground/60">部署者需自行确认 Live2D 授权并安装 Cubism Core 至 /live2d/live2dcubismcore.min.js。未安装时名称、文案和默认动态球仍可使用。未启用的导入包可在资源管理中清理。</p>
|
||||
<p className="text-xs text-foreground/60">项目已内置 Cubism Core,无需另行安装。使用前仍需确认 Live2D SDK 及模型素材的适用授权。未启用的导入包可在资源管理中清理。</p>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user