(client) chore
This commit is contained in:
24
Client/Assets/Scripts/Entity/Pickup.cs
Normal file
24
Client/Assets/Scripts/Entity/Pickup.cs
Normal file
@ -0,0 +1,24 @@
|
||||
using Base;
|
||||
using Data;
|
||||
using Item;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Entity
|
||||
{
|
||||
public class Pickup:Entity
|
||||
{
|
||||
public ItemResource itemResource;
|
||||
protected override void AutoBehave()
|
||||
{
|
||||
}
|
||||
private void OnTriggerEnter2D(Collider2D other)
|
||||
{
|
||||
var entity = other.GetComponent<Character>();
|
||||
if (entity == null) return;
|
||||
if (entity.TryPickupItem(itemResource, 1) == 0)
|
||||
{
|
||||
Kill();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user