(5a377a8ee) Unstable v0.9.1000.0

This commit is contained in:
Juan Pablo Arce
2020-05-13 12:55:42 -03:00
parent b143329701
commit a1ca41aa5d
426 changed files with 14384 additions and 5708 deletions
@@ -10,6 +10,8 @@ namespace Barotrauma.Particles
{
private ParticlePrefab prefab;
private string debugName = "Particle (uninitialized)";
public delegate void OnChangeHullHandler(Vector2 position, Hull currentHull);
public OnChangeHullHandler OnChangeHull;
@@ -92,10 +94,16 @@ namespace Barotrauma.Particles
{
get { return prefab; }
}
public override string ToString()
{
return debugName;
}
public void Init(ParticlePrefab prefab, Vector2 position, Vector2 speed, float rotation, Hull hullGuess = null, bool drawOnTop = false)
{
this.prefab = prefab;
debugName = $"Particle ({prefab.Name})";
spriteIndex = Rand.Int(prefab.Sprites.Count);
@@ -89,7 +89,21 @@ namespace Barotrauma.Particles
{
public readonly string Name;
public readonly ParticlePrefab ParticlePrefab;
private string particlePrefabName;
private ParticlePrefab particlePrefab;
public ParticlePrefab ParticlePrefab
{
get
{
if (particlePrefab == null && particlePrefabName != null)
{
particlePrefab = GameMain.ParticleManager?.FindPrefab(particlePrefabName);
if (particlePrefab == null) { particlePrefabName = null; }
}
return particlePrefab;
}
}
public readonly float AngleMin, AngleMax;
@@ -114,8 +128,7 @@ namespace Barotrauma.Particles
public ParticleEmitterPrefab(XElement element)
{
Name = element.Name.ToString();
ParticlePrefab = GameMain.ParticleManager.FindPrefab(element.GetAttributeString("particle", ""));
particlePrefabName = element.GetAttributeString("particle", "");
if (element.Attribute("startrotation") == null)
{