alotta upgrade stuff but no upgrades

This commit is contained in:
myondev 2026-02-23 06:26:50 -08:00
parent b9fb490dce
commit 3b60583c76
35 changed files with 2937 additions and 61 deletions

View file

@ -12,18 +12,16 @@ public class ItemPickup : MonoBehaviour
{
if (inRange)
{
rb.linearVelocity = (transform.position - AbilityManager.instance.player.transform.position).normalized * speed;
rb.linearVelocity = (AbilityManager.instance.player.transform.position - transform.position).normalized * speed;
}
}
private void OnTriggerEnter2D(Collider2D other)
{
PickupEffects();
Destroy(gameObject);
}
protected virtual void PickupEffects()
public virtual void PickupEffects()
{
Destroy(gameObject);
}
}

View file

@ -7,6 +7,9 @@ public class ItemPickupRange : MonoBehaviour
private void OnTriggerEnter2D(Collider2D other)
{
thisItem.inRange = true;
if (other.CompareTag(tag))
{
thisItem.inRange = true;
}
}
}

View file

@ -3,8 +3,8 @@ using UnityEngine;
public class PowerPickup : ItemPickup
{
[SerializeField] private float powerAmount;
protected override void PickupEffects()
public override void PickupEffects()
{
base.PickupEffects();
}
}

View file

@ -0,0 +1,11 @@
using UnityEngine;
public class UpgradePickup : ItemPickup
{
public AbilityUpgrade upgradeDropped;
public override void PickupEffects()
{ //i'll figure out the hashset later
base.PickupEffects();
AbilityManager.instance.StoreUpgrade(upgradeDropped);
}
}

View file

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 414126e6ddc5f8085af89e294a8deb38

View file

@ -0,0 +1,15 @@
using UnityEngine;
public class UpgradePickupEffects : MonoBehaviour
{
[SerializeField] private UpgradePickup thisPickup;
public void OnTriggerEnter2D(Collider2D other)
{
if (other.CompareTag(tag))
{
thisPickup.PickupEffects();
Destroy(gameObject);
}
}
}

View file

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 3826d3871547e566aa448bea0f340014