smart-interactive-display/Assets/GadGame/Scripts/MiniGame/Basket.cs

25 lines
517 B
C#
Raw Normal View History

2024-04-22 00:09:55 -07:00
using Pools.Runtime;
2024-04-15 04:10:00 -07:00
using UnityEngine;
namespace GadGame.MiniGame
{
public class Basket : MonoBehaviour
{
public bool Active;
public Vector3 Position
{
get => transform.position;
set => transform.position = value;
}
2024-04-15 04:10:00 -07:00
private void OnTriggerEnter2D(Collider2D other)
{
if(!Active) return;
2024-04-15 04:10:00 -07:00
if (other.TryGetComponent(out ICollect item))
{
item.Collect();
}
}
}
}