Skip to content

Commit

Permalink
Add support for single transform fx
Browse files Browse the repository at this point in the history
  • Loading branch information
sarbian committed Mar 10, 2018
1 parent 96816d2 commit e5dcb7c
Showing 1 changed file with 36 additions and 1 deletion.
37 changes: 36 additions & 1 deletion ModelMultiShurikenPersistFX.cs
Expand Up @@ -279,7 +279,42 @@ public override void OnEvent(float power)
}
}


public override void OnEvent(float power, int transformIdx)
{
if (persistentEmitters == null || transformIdx >= persistentEmitters.Count)
{
return;
}

if (transformIdx == -1)
{
OnEvent(power);
return;
}

PersistentKSPShurikenEmitter pkse = persistentEmitters[transformIdx];
if ((overRideInputs || power > 0) && activated)
{
UpdateEmitters(power);

pkse.fixedEmit = true;
if (pkse.pe != null)
{
ParticleSystem.EmissionModule em = pkse.pe.emission;
em.enabled = false;
}
}
else
{
pkse.fixedEmit = false;
if (pkse.pe != null)
{
ParticleSystem.EmissionModule em = pkse.pe.emission;
em.enabled = false;
}
}
}

public void FixedUpdate()
{
//Print("FixedUpdate");
Expand Down

0 comments on commit e5dcb7c

Please sign in to comment.