mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 08:02:39 +08:00
3.6.1 trail buffer insufficient space fix (#12567)
* enlarge trail buffer * add warning information * use warn id instead
This commit is contained in:
@@ -2471,6 +2471,10 @@ cc.ParticleSystem: shouldn't be initialized repetitively, otherwise there will b
|
||||
|
||||
cc.ParticleSystem: change material failed, please use proper particle material
|
||||
|
||||
### 6036
|
||||
|
||||
cc.ParticleSystem: life time should bigger than 1 or buffer will be insufficient
|
||||
|
||||
### 6100
|
||||
|
||||
<!-- DEPRECATED -->
|
||||
|
||||
@@ -38,6 +38,7 @@ import { Space, TextureMode, TrailMode } from '../enum';
|
||||
import { Particle } from '../particle';
|
||||
import { legacyCC } from '../../core/global-exports';
|
||||
import { TransformBit } from '../../core/scene-graph/node-enum';
|
||||
import { warnID } from '../../core';
|
||||
|
||||
const PRE_TRIANGLE_INDEX = 1;
|
||||
const NEXT_TRIANGLE_INDEX = 1 << 2;
|
||||
@@ -368,7 +369,10 @@ export default class TrailModule {
|
||||
const b = ps.bursts[i];
|
||||
burstCount += b.getMaxCount(ps) * Math.ceil(psTime / duration);
|
||||
}
|
||||
this._trailNum = Math.ceil(psTime * this.lifeTime.getMax() * 60 * (psRate * duration + burstCount));
|
||||
if (this.lifeTime.getMax() < 1.0) {
|
||||
warnID(6036);
|
||||
}
|
||||
this._trailNum = Math.ceil(psTime * Math.ceil(this.lifeTime.getMax()) * 60 * (psRate * duration + burstCount));
|
||||
this._trailSegments = new Pool(() => new TrailSegment(10), Math.ceil(psRate * duration), (obj: TrailSegment) => obj.trailElements.length = 0);
|
||||
if (this._enable) {
|
||||
this.enable = this._enable;
|
||||
|
||||
Reference in New Issue
Block a user