add all mechanics

This commit is contained in:
Sylvia 2026-07-13 17:46:02 -07:00
parent 87383d5b8c
commit 0e2a7cc7c3
434 changed files with 238349 additions and 2092 deletions

View file

@ -12,7 +12,7 @@ public class DelayedAimShot : Projectile
return (WaveManager.instance.GetRandomPlayerPoint() - transform.position).normalized;
}
private void Update()
protected override void Update()
{
if (aimDelay > 0)
{

View file

@ -18,6 +18,8 @@ public class Projectile : MonoBehaviour
public float volume;
[SerializeField] private Rigidbody2D rb;
public SpriteRenderer sprite;
public bool willUnparent;
public float unparentTime;
protected virtual void Start()
{
@ -25,6 +27,18 @@ public class Projectile : MonoBehaviour
direction = transform.right;
}
protected virtual void Update()
{
if (willUnparent && unparentTime > 0)
{
unparentTime -= Time.deltaTime;
if (unparentTime <= 0)
{
transform.SetParent(null);
}
}
}
private void FixedUpdate()
{
rb.linearVelocity = direction * speed;