Permalink
Browse files

fix butterfly pr issues

  • Loading branch information...
1 parent ac96109 commit f8004ab32d0452c84bab6e7643a8948e69934a6a @JimMarlowe JimMarlowe committed Dec 29, 2016
Showing with 16 additions and 16 deletions.
  1. +16 −16 Butterflies/CSharp/Resources/Components/Spawner.cs
@@ -20,13 +20,13 @@ void Update(float timeStep)
for (var i = 0; i < 10; i++)
createButterflyNode(new Vector2(mousePos.X, mousePos.Y));
- }
- else if (input.GetMouseButtonDown(Constants.MOUSEB_RIGHT))
- {
- var mousePos = input.GetMousePosition();
+ }
+ else if (input.GetMouseButtonDown(Constants.MOUSEB_RIGHT))
+ {
+ var mousePos = input.GetMousePosition();
- createButterflyParticle(new Vector2(mousePos.X, mousePos.Y));
- }
+ createButterflyParticle(new Vector2(mousePos.X, mousePos.Y));
+ }
}
@@ -44,21 +44,21 @@ void createButterflyNode(Vector2 pos)
}
- void createButterflyParticle(Vector2 pos)
- {
- //project mouse screen position to the world position
- var screenPos = viewport.ScreenToWorldPoint((int) pos.X, (int) pos.Y, 0);
+ void createButterflyParticle(Vector2 pos)
+ {
+ //project mouse screen position to the world position
+ var screenPos = viewport.ScreenToWorldPoint((int) pos.X, (int) pos.Y, 0);
- //create particle emitter
- var emitter = Scene.CreateChild("ButterflyEmitter");
+ //create particle emitter
+ var emitter = Scene.CreateChild("ButterflyEmitter");
- emitter.Position2D = new Vector2(screenPos.X, screenPos.Y);
+ emitter.Position2D = new Vector2(screenPos.X, screenPos.Y);
- var pex = emitter.CreateComponent<ParticleEmitter2D>();
+ var pex = emitter.CreateComponent<ParticleEmitter2D>();
- pex.SetEffect(GetSubsystem<ResourceCache>().GetResource<ParticleEffect2D> ("Particles/particle.pex"));
+ pex.SetEffect(GetSubsystem<ResourceCache>().GetResource<ParticleEffect2D> ("Particles/particle.pex"));
- }
+ }
Viewport viewport;

0 comments on commit f8004ab

Please sign in to comment.