Use `private` for internally used property

This commit is contained in:
Dean Herbert 2021-09-16 16:54:22 +09:00
parent 2df4073946
commit 9127a706ac
1 changed files with 3 additions and 2 deletions

View File

@ -26,12 +26,13 @@ public abstract class ParticleSpewer : Sprite
/// </summary> /// </summary>
public readonly BindableBool Active = new BindableBool(); public readonly BindableBool Active = new BindableBool();
public bool HasActiveParticles => Active.Value || (lastParticleAdded + maxLifetime) > Time.Current; public override bool IsPresent => base.IsPresent && hasActiveParticles;
public override bool IsPresent => base.IsPresent && HasActiveParticles;
protected virtual bool CanSpawnParticles => true; protected virtual bool CanSpawnParticles => true;
protected virtual float ParticleGravity => 0; protected virtual float ParticleGravity => 0;
private bool hasActiveParticles => Active.Value || (lastParticleAdded + maxLifetime) > Time.Current;
protected ParticleSpewer(Texture texture, int perSecond, double maxLifetime) protected ParticleSpewer(Texture texture, int perSecond, double maxLifetime)
{ {
Texture = texture; Texture = texture;