Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions cocos/particle/particle-system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
@range([0, Number.POSITIVE_INFINITY])
@displayOrder(10)
@tooltip('i18n:particle_system.startSizeY')
@visible(function (this: ParticleSystem): boolean { return this.startSize3D; })

Check warning on line 144 in cocos/particle/particle-system.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unexpected unnamed function
public startSizeY = new CurveRange();

/**
Expand All @@ -153,7 +153,7 @@
@range([0, Number.POSITIVE_INFINITY])
@displayOrder(10)
@tooltip('i18n:particle_system.startSizeZ')
@visible(function (this: ParticleSystem): boolean { return this.startSize3D; })

Check warning on line 156 in cocos/particle/particle-system.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unexpected unnamed function
public startSizeZ = new CurveRange();

/**
Expand Down Expand Up @@ -184,7 +184,7 @@
@radian
@displayOrder(12)
@tooltip('i18n:particle_system.startRotationX')
@visible(function (this: ParticleSystem): boolean { return this.startRotation3D; })

Check warning on line 187 in cocos/particle/particle-system.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unexpected unnamed function
public startRotationX = new CurveRange();

/**
Expand All @@ -196,7 +196,7 @@
@radian
@displayOrder(12)
@tooltip('i18n:particle_system.startRotationY')
@visible(function (this: ParticleSystem): boolean { return this.startRotation3D; })

Check warning on line 199 in cocos/particle/particle-system.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unexpected unnamed function
public startRotationY = new CurveRange();

/**
Expand Down Expand Up @@ -1443,7 +1443,8 @@
// emit particles.
const startDelay = self.startDelay.evaluate(0, 1)!;
if (self._time > startDelay) {
if (self._time > (self.duration + startDelay)) {
const timeLeft = self._time - (self.duration + startDelay);
if (timeLeft > dt) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

对于粒子系统已激活时间减去粒子可活动时间与延迟播放时间之后剩余的时间不足一帧的,允许播放一次粒子。

// self._time = startDelay; // delay will not be applied from the second loop.(Unity)
// self._emitRateTimeCounter = 0.0;
// self._emitRateDistanceCounter = 0.0;
Expand Down Expand Up @@ -1478,8 +1479,10 @@
}

// bursts
for (const burst of self.bursts) {
burst.update(self, dt);
if (timeLeft <= 0 || self.loop) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

对于在 burst 中配置发射频率进行播放的粒子,使用原本的逻辑

for (const burst of self.bursts) {
burst.update(self, dt);
}
}
}
}
Expand Down
Loading