using System.Collections; using System.Collections.Generic; using UnityEngine; using SiegeSong; namespace SiegeSong { public class Selectable : MonoBehaviour { public string Name = "Selectable"; public string Interaction = "Interact with"; public bool Danger = false; public int ItemID; public int ItemAmount; public Sprite Icon; public UnityEngine.Events.UnityEvent OnInteract; public InventoryManager InventoryManager; public Container Container; void Start() { } void Update() { } public void Activate(InventoryManager inventory) { InventoryManager = inventory; if (InventoryManager != null) { if (Container == null) { InventoryManager.SelectedItemID = ItemID; InventoryManager.SelectedAmount = ItemAmount; InventoryManager.AddItem(); Destroy(gameObject); } else { InventoryManager.OpenTransferMenu(Container); } } else { if (OnInteract != null) OnInteract.Invoke(); } } } }