Open zanqwq opened 4 days ago
3.8.4
android xiaomi tablet
封装判空的 createMesh 方法传入两个可选参数导致 android 端崩溃
No response
新建节点绑定以下脚本即可
import { _decorator, Component, Mesh, MeshRenderer, Node, utils } from 'cc'; const { ccclass, property } = _decorator; @ccclass('test') export class test extends Component { start() { const createMesh: typeof utils.MeshUtils.createMesh = (geo, out, opt) => { console.log('@@@', geo, out, opt); if (geo.positions.length > 0) { return utils.MeshUtils.createMesh(geo, out, opt); } return new Mesh(); } this.getComponent(MeshRenderer).mesh = createMesh({ positions: [0, 0, 0, 1, 0, 0, 0, 1, 0] }); } update(deltaTime: number) { } }
web端没提示warn或error吗
没有嘞好像 @longchuan
web端没提示warn或error吗 没有嘞好像 @longchuan
为什么是好像,createMesh函数并没有赋值out, opt,这个不会报错吗
Cocos Creator version
3.8.4
System information
android xiaomi tablet
Issue description
封装判空的 createMesh 方法传入两个可选参数导致 android 端崩溃
Relevant error log output
No response
Steps to reproduce
新建节点绑定以下脚本即可
Minimal reproduction project
No response