Added project

This commit is contained in:
2023-06-11 00:35:07 +03:00
parent 5bfa765889
commit f06629200c
545 changed files with 44339 additions and 2 deletions

View File

@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using UnityEngine;
public class PlayerInventory : MonoBehaviour {
public int CoinsCount { get; set; }
public BuffReceiver BuffReceiver;
public List<Item> Items { get; private set; }
private void Start() {
GameManager.Instance.inventory = this;
Items = new List<Item>();
}
private void OnTriggerEnter2D(Collider2D other) {
if (GameManager.Instance.coinContainer.ContainsKey(other.gameObject)) {
var coin = GameManager.Instance.coinContainer[other.gameObject];
coin.StartDestroy();
}
if (GameManager.Instance.itemsContainer.ContainsKey(other.gameObject)) {
var itemComponent = GameManager.Instance.itemsContainer[other.gameObject];
Items.Add(itemComponent.Item);
itemComponent.Destroy(other.gameObject);
}
}
}