Particle additions:

- Support for subemitters (= particles can emit particles).
- Option to set a different velocity change value for particles in water (can be used to simulate buouancy).
- Fixed drag vector & timer not being reset when initializing a particle.
This commit is contained in:
Joonas Rikkonen
2017-12-29 20:58:29 +02:00
parent a8749f3d87
commit 454e0def3b
5 changed files with 98 additions and 22 deletions
@@ -32,13 +32,11 @@ namespace Barotrauma.Particles
this.cam = cam;
particles = new Particle[MaxParticles];
LoadPrefabs(configFile);
}
public void LoadPrefabs(string file)
public void LoadPrefabs()
{
XDocument doc = XMLExtensions.TryLoadXml(file);
XDocument doc = XMLExtensions.TryLoadXml(ConfigFile);
if (doc == null || doc.Root == null) return;
prefabs = new Dictionary<string, ParticlePrefab>();
@@ -47,7 +45,7 @@ namespace Barotrauma.Particles
{
if (prefabs.ContainsKey(element.Name.ToString()))
{
DebugConsole.ThrowError("Error in " + file + "! Each particle prefab must have a unique name.");
DebugConsole.ThrowError("Error in " + ConfigFile + "! Each particle prefab must have a unique name.");
continue;
}
prefabs.Add(element.Name.ToString(), new ParticlePrefab(element));