mirror of
https://github.com/cocos/cocos-engine.git
synced 2026-09-09 09:08:54 +08:00
* fix particle capacity <= 0 * fix issue 10417 particle capacity 0 * fix issue 10417 particle capacity setter range limitation * remove unused package
21 lines
628 B
TypeScript
21 lines
628 B
TypeScript
import { director, Node, Scene } from "../../cocos/core";
|
|
import { legacyCC } from "../../cocos/core/global-exports";
|
|
import { ParticleSystem } from "../../exports/particle";
|
|
|
|
test('particle system capacity test', function () {
|
|
const scene = new Scene('test');
|
|
director.runSceneImmediate(scene);
|
|
|
|
const temp0 = new Node();
|
|
scene.addChild(temp0);
|
|
|
|
const particle = temp0.addComponent(ParticleSystem) as ParticleSystem;
|
|
|
|
particle.capacity = 0;
|
|
particle.renderer.useGPU = false;
|
|
|
|
legacyCC.game.step();
|
|
|
|
// @ts-expect-error
|
|
expect(!!particle.processor.getModel()._vBuffer).toBe(true);
|
|
}); |