cocos-engine icon indicating copy to clipboard operation
cocos-engine copied to clipboard

[3.8.1] When preloading the spine prefab resource, the loading result obtained in web preview is inconsistent with the loading result obtained when running the project after building and publishing

Open zhefengzhang opened this issue 1 year ago • 1 comments

Cocos Creator version

3.8.1

System information

Windows10

Issue description

When preloading the spine prefab resource, the loading result obtained in web preview is inconsistent with the loading result obtained when running the project after building and publishing 预加载 spine 预制体资源时在 web 预览得到的加载结果与构建发布后项目运行的加载结果不一致

The result when previewing in the browser web:

ee27289d59d38f53d48f5859b2e7378

The result when running the web-mobile project after building and publishing:

eb1db1bf8e6f5e92924ab8b330a8f4b

Test code:

import { _decorator, assetManager, Component, Node, Prefab } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('PreloadTest')
export class PreloadTest extends Component {
    preloadBundleResTest () {
        assetManager.loadBundle("spine", (err, bundleInfo)=>{
            if (bundleInfo) {
                bundleInfo.preload("spineRaptor/SpinePrefabTest", Prefab , (err, preloadSpine)=>{
                    if (preloadSpine) {
                        console.log(preloadSpine);
                    }
                })
            }
        });
    }
}

Relevant error log output

Steps to reproduce

Minimal reproduction project

20240117002.zip

zhefengzhang avatar Jan 17 '24 07:01 zhefengzhang

Currently, a temporary solution has been found by modifying the engine code: dafd2a888a959c01c8f84fdd203c509

zhefengzhang avatar Jan 19 '24 06:01 zhefengzhang