Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

android 端 createMesh crash #17907

Open
zanqwq opened this issue Nov 22, 2024 · 2 comments
Open

android 端 createMesh crash #17907

zanqwq opened this issue Nov 22, 2024 · 2 comments
Labels
Bug Needs Triage Needs to be assigned by the team

Comments

@zanqwq
Copy link

zanqwq commented Nov 22, 2024

Cocos Creator version

3.8.4

System information

android xiaomi tablet

Issue description

封装判空的 createMesh 方法传入两个可选参数导致 android 端崩溃

Relevant error log output

No response

Steps to reproduce

新建节点绑定以下脚本即可

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) {
        
    }
}

Minimal reproduction project

No response

@zanqwq zanqwq added Bug Needs Triage Needs to be assigned by the team labels Nov 22, 2024
@longchuan
Copy link
Contributor

web端没提示warn或error吗

@zanqwq
Copy link
Author

zanqwq commented Nov 25, 2024

web端没提示warn或error吗

没有嘞好像 @longchuan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Needs Triage Needs to be assigned by the team
Projects
None yet
Development

No branches or pull requests

2 participants