add spawn particles to Scorpions
This commit is contained in:
parent
35a3c21c91
commit
72fa6f2f90
3 changed files with 4679 additions and 3 deletions
File diff suppressed because it is too large
Load diff
|
@ -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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue