1
0
Fork 0

add spawn particles to Scorpions

This commit is contained in:
Jan 2018-04-23 19:31:50 +02:00
parent 35a3c21c91
commit 72fa6f2f90
3 changed files with 4679 additions and 3 deletions

File diff suppressed because it is too large Load diff

View file

@ -50,10 +50,10 @@ public class Player : Mob {
nextAttackTime = Time.timeSinceLevelLoad + attack.GetCooldownTime(); nextAttackTime = Time.timeSinceLevelLoad + attack.GetCooldownTime();
} }
} }
// scale particle emissions by speed
float velocity = body.velocity.magnitude; float velocity = body.velocity.magnitude;
ParticleSystem.EmissionModule emission = GetComponentInChildren<ParticleSystem>().emission; ParticleSystem.EmissionModule emission = GetComponentInChildren<ParticleSystem>().emission;
emission.rateOverTime = velocity * (velocity / 2) * 20 + 20; emission.rateOverTime = velocity * (velocity / 2) * 20 + 20;
Debug.Log(emission.rateOverTime.constant);
} }

View file

@ -11,6 +11,7 @@ namespace Assets.Scripts.Entities {
private void Start() { private void Start() {
SetAttack(new MeleeAttack(this.gameObject)); SetAttack(new MeleeAttack(this.gameObject));
GetComponentInChildren<ParticleSystem>().Play();
} }
} }
} }