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,39 @@
using System;
using UnityEngine.UI;
using UnityEngine;
public class Cell : MonoBehaviour {
public Action OnUpdateCell;
[SerializeField] private Image icon;
private Item item;
private void Awake() {
icon.sprite = null;
}
public void Init(Item item) {
this.item = item;
if (item == null) {
icon.sprite = null;
}
else {
icon.sprite = item.Icon;
}
}
public void OnClickCell() {
if (item == null) {
return;
}
GameManager.Instance.inventory.Items.Remove(item);
var buff = new Buff {
type = item.Type,
additiveBonus = item.Value
};
GameManager.Instance.inventory.BuffReceiver.AddBuff(buff);
OnUpdateCell?.Invoke();
}
}