Separate ParticleEmitter & ParticleEmitterPrefab classes - the emission timer (and maybe some other values in the future) can't be in the prefab class because multiple objects may use the same prefab.

This commit is contained in:
Joonas Rikkonen
2017-08-20 22:05:30 +03:00
parent 04834f9f7f
commit cc40970b58
4 changed files with 68 additions and 49 deletions
@@ -30,7 +30,7 @@ namespace Barotrauma
public readonly Vector2 DepthRange;
public readonly Particles.ParticleEmitter ParticleEmitter;
public readonly Particles.ParticleEmitterPrefab ParticleEmitterPrefab;
public readonly Vector2 EmitterPosition;
public readonly float SwingAmount;
@@ -90,7 +90,7 @@ namespace Barotrauma
}
break;
case "particleemitter":
ParticleEmitter = new Particles.ParticleEmitter(subElement);
ParticleEmitterPrefab = new Particles.ParticleEmitterPrefab(subElement);
EmitterPosition = ToolBox.GetAttributeVector2(subElement, "position", Vector2.Zero);
break;
}