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,30 @@
using UnityEngine;
public class ItemComponent : MonoBehaviour, IObjectDestroyer {
[SerializeField] private ItemType type;
[SerializeField] private SpriteRenderer spriteRenderer;
[SerializeField] private Animator animator;
private Item _item;
public Item Item => _item;
private void Start() {
_item = GameManager.Instance.ItemBase.GetItemOfId((int) type);
spriteRenderer.sprite = _item.Icon;
GameManager.Instance.itemsContainer.Add(gameObject, this);
}
public void Destroy(GameObject gameObj) {
animator.SetTrigger("StartDestroy");
}
public void EndDestroy() {
MonoBehaviour.Destroy(gameObject);
}
}
public enum ItemType {
ForcePotion = 0, DamagePotion = 1, ArmorPotion = 2
}