Scriptum/Assets/Scripts/Item/PickableController.cs
2022-05-29 21:56:08 +02:00

26 lines
555 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
public class PickableController : MonoBehaviour
{
public EquippableItem item;
public void Start()
{
item.Name = gameObject.name;
Console.WriteLine("xd");
Console.WriteLine(gameObject.name);
}
private void OnTriggerEnter2D(Collider2D collision)
{
if (collision.tag == "Player")
{
InventoryManager.Instance.AddToInventory(this.item);
Destroy(gameObject);
}
}
}