Commit 15e510cd authored by Andrew Van Buren's avatar Andrew Van Buren
Browse files

Adjusted walk particles and animation.

parent ae59fabf
...@@ -6,6 +6,7 @@ public class WalkParticles : MonoBehaviour { ...@@ -6,6 +6,7 @@ public class WalkParticles : MonoBehaviour {
private ParticleSystem ps; private ParticleSystem ps;
private ParticleSystem.EmissionModule module; private ParticleSystem.EmissionModule module;
private HeroMobility hm; private HeroMobility hm;
public float speedThreshold = 0.001f;
// Use this for initialization // Use this for initialization
...@@ -17,7 +18,7 @@ public class WalkParticles : MonoBehaviour { ...@@ -17,7 +18,7 @@ public class WalkParticles : MonoBehaviour {
// Update is called once per frame // Update is called once per frame
void LateUpdate () { void LateUpdate () {
if (hm.deltaPos.sqrMagnitude > 0) { if (hm.deltaPos.sqrMagnitude > speedThreshold) {
if (!ps.isPlaying) { if (!ps.isPlaying) {
ps.Simulate(0.0f, true, false); ps.Simulate(0.0f, true, false);
module.enabled = true; module.enabled = true;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment