cocos creator 3.x版本遇到的问题及优化方法

2021-12-08  本文已影响0人  Jey
System.import('./src/application.js').then(({ createApplication }) => {
    return createApplication({
        loadJsListFile: (url) => require(url),
    });
}).then((application) => {
    return application.import('cc').then((cc) => {
        require('jsb-adapter/jsb-engine.js');
        cc.sys.__init();
        // cc.macro.CLEANUP_IMAGE_CACHE = false;
        cc.macro.CLEANUP_IMAGE_CACHE = true;
        cc.dynamicAtlasManager.enabled = false;
    }).then(() => {
        return application.start({
            settings: window._CCSettings,
            findCanvas: () => {
                var container = document.createElement('div');
                var frame = document.documentElement;
                var canvas = window.__canvas;
                return { frame, canvas, container };
            },
        });
    });
}).catch((err) => {
    console.error(err.toString());
});

替换部分:
// cc.macro.CLEANUP_IMAGE_CACHE = false;
        cc.macro.CLEANUP_IMAGE_CACHE = true;
        cc.dynamicAtlasManager.enabled = false;
let scale1 = t().to(0.35, {scale: new Vec3(1.15, 1.15)});
正确写法,三个参数:let scale1 = t().to(0.35, {scale: new Vec3(1.15,  1.15, 1.15)});
上一篇 下一篇

猜你喜欢

热点阅读