alotta upgrade stuff but no upgrades
This commit is contained in:
parent
b9fb490dce
commit
3b60583c76
35 changed files with 2937 additions and 61 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,9 @@ public class ItemPickupRange : MonoBehaviour
|
|||
|
||||
private void OnTriggerEnter2D(Collider2D other)
|
||||
{
|
||||
thisItem.inRange = true;
|
||||
if (other.CompareTag(tag))
|
||||
{
|
||||
thisItem.inRange = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ using UnityEngine;
|
|||
public class PowerPickup : ItemPickup
|
||||
{
|
||||
[SerializeField] private float powerAmount;
|
||||
protected override void PickupEffects()
|
||||
public override void PickupEffects()
|
||||
{
|
||||
|
||||
base.PickupEffects();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
11
Assets/Scripts/Items/UpgradePickup.cs
Normal file
11
Assets/Scripts/Items/UpgradePickup.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/Items/UpgradePickup.cs.meta
Normal file
2
Assets/Scripts/Items/UpgradePickup.cs.meta
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 414126e6ddc5f8085af89e294a8deb38
|
||||
15
Assets/Scripts/Items/UpgradePickupEffects.cs
Normal file
15
Assets/Scripts/Items/UpgradePickupEffects.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/Items/UpgradePickupEffects.cs.meta
Normal file
2
Assets/Scripts/Items/UpgradePickupEffects.cs.meta
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 3826d3871547e566aa448bea0f340014
|
||||
Loading…
Add table
Add a link
Reference in a new issue