you really gotta calm down, marisa...
This commit is contained in:
parent
13bb58ea03
commit
b9fb490dce
68 changed files with 990 additions and 44 deletions
29
Assets/Scripts/Items/ItemPickup.cs
Normal file
29
Assets/Scripts/Items/ItemPickup.cs
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
public class ItemPickup : MonoBehaviour
|
||||
{
|
||||
public bool inRange;
|
||||
[Header("Movement")]
|
||||
[SerializeField] private Rigidbody2D rb;
|
||||
[SerializeField] private float speed;
|
||||
|
||||
private void FixedUpdate()
|
||||
{
|
||||
if (inRange)
|
||||
{
|
||||
rb.linearVelocity = (transform.position - AbilityManager.instance.player.transform.position).normalized * speed;
|
||||
}
|
||||
}
|
||||
|
||||
private void OnTriggerEnter2D(Collider2D other)
|
||||
{
|
||||
PickupEffects();
|
||||
Destroy(gameObject);
|
||||
}
|
||||
|
||||
protected virtual void PickupEffects()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/Items/ItemPickup.cs.meta
Normal file
2
Assets/Scripts/Items/ItemPickup.cs.meta
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 271a03dda998936fa99eb33e6272307b
|
||||
12
Assets/Scripts/Items/ItemPickupRange.cs
Normal file
12
Assets/Scripts/Items/ItemPickupRange.cs
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
public class ItemPickupRange : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private ItemPickup thisItem;
|
||||
|
||||
private void OnTriggerEnter2D(Collider2D other)
|
||||
{
|
||||
thisItem.inRange = true;
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/Items/ItemPickupRange.cs.meta
Normal file
2
Assets/Scripts/Items/ItemPickupRange.cs.meta
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 8ed6160da3b86db81b18fdaf0abf65da
|
||||
10
Assets/Scripts/Items/PowerPickup.cs
Normal file
10
Assets/Scripts/Items/PowerPickup.cs
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
using UnityEngine;
|
||||
|
||||
public class PowerPickup : ItemPickup
|
||||
{
|
||||
[SerializeField] private float powerAmount;
|
||||
protected override void PickupEffects()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/Items/PowerPickup.cs.meta
Normal file
2
Assets/Scripts/Items/PowerPickup.cs.meta
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
fileFormatVersion: 2
|
||||
guid: dac707185c38816bbb658ebbb2885694
|
||||
Loading…
Add table
Add a link
Reference in a new issue