插个眼,600行代码实现高性能Navmesh

可以使用用fs鸭,data是需要储存的内容
const projectPath = window.cce.project as string; //当前项目文件路径

    projectPath.replace("\\", " / ");

    const filePath = `${projectPath}/` + SCENE_PATH;

    const fs: any = require('fs');

    const write = () => {

        fs.writeFile(filePath + this.sceneName + this.sceneIDSave + typename, data, (err: Error) => {

            if (err) {

                console.warn("生产配置失败" + ':' + filePath + this.sceneName + this.sceneIDSave);

                console.error("error", err);

            } else {

                console.warn("生产配置成功" + ':' + filePath + this.sceneName + this.sceneIDSave);

            }

            this._isFinish = true;

        });

    }

    fs.exists(filePath, function (e: boolean) {

        if (!e) {

            fs.mkdir(filePath, function (err: Error) {

                if (err) {

                } else {

                    write();

                }

            });

        } else {

            write();

        }

    });

太牛逼了这个

感谢大佬的分享,但是cocos creator 3.x后已经无法使用require了。image import 也无法直接引用到node对应的fs模块

他这个应该是插件,插件编写可以引入node模块

插个眼,坐等后期分享

可以用插件 引入,也可以忽略这个报错,不影响执行

膜拜大佬 顶

mark!

跪求大佬,分享插件怎样引入,最好能详细一点,我们也能把这技术用到自己的项目中。。。

love it!

方案上架了,大佬们请多多指教

战略性 mark

该主题在最后一个回复创建后14天后自动关闭。不再允许新的回复。