版本3.3.2
把一个3D粒子转到屏幕上(添加UIMeshRender),存储为Prefab。粒子不循环,duration为2。
播放后,会残留一个在屏幕上不消失。
预览和编辑器都会出现。出现概率90%以上。
我把粒子导出了来。
test.zip (40.3 KB) [test.zip|attachment]
大佬,真机试过吗?
真机也有。
这个就得等官方来要demo了吧?
你如果直接销毁这个粒子,它还存在吗?
我现在就是使用销毁,销毁后就不在了。
import { _decorator, Component } from "cc";
import { ParticleSystem } from "cc";
const { ccclass, property } = _decorator;
@ccclass("ParticleAutoDestroy")
export default class ParticleAutoDestroy extends Component {
onEnable(): void {
let particles = this.getComponentsInChildren(ParticleSystem);
let maxTime: number = 0;
for (let particle of particles) {
let liveTime = particle.duration + particle.startLifetime.getMax();
if (liveTime > maxTime)
maxTime = liveTime;
}
this.scheduleOnce(() => this.node.destroy(), maxTime);
}
}
可以问一下,这个是怎么 设置的?
我把粒子上传上来了。
3.2.1遇到了同样的问题
