diff --git a/Assets/Scripts/Entities/Player.cs b/Assets/Scripts/Entities/Player.cs index 8d0816b..a6a48b7 100644 --- a/Assets/Scripts/Entities/Player.cs +++ b/Assets/Scripts/Entities/Player.cs @@ -2,6 +2,8 @@ using UnityEngine; public class Player : Mob { + + Rigidbody2D body; [SerializeField] private GameObject bulletPrefab; @@ -26,6 +28,7 @@ public class Player : Mob { g.SetPrefab(bulletPrefab); g.SetSpawn(bulletSpawn); ggun = g; + body = GetComponent(); SetAttack(s); } @@ -47,6 +50,10 @@ public class Player : Mob { nextAttackTime = Time.timeSinceLevelLoad + attack.GetCooldownTime(); } } + float velocity = body.velocity.magnitude; + ParticleSystem.EmissionModule emission = GetComponentInChildren().emission; + emission.rateOverTime = velocity * (velocity / 2) * 20 + 20; + Debug.Log(emission.rateOverTime.constant); }