using System.Collections; using System.Collections.Generic; using UnityEngine; using SiegeSong; namespace SiegeSong { public class Selectable : MonoBehaviour { public string InstanceID; public string DroppableKey; public string StationKey; public string ArchitectureKey; 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 Container Container; void Start() { } void Update() { } public void Activate(InventoryManager inventoryManager) { if (inventoryManager != null) { if (Container == null) { inventoryManager.InstanceManager.WorldObjectInstances.Remove(inventoryManager.InstanceManager.GetWorldObjectInstanceByID(InstanceID)); inventoryManager.InstanceManager.WorldObjectInstanceIDs.Remove(InstanceID); inventoryManager.SelectedItemID = ItemID; inventoryManager.SelectedAmount = ItemAmount; inventoryManager.AddItem(); Destroy(gameObject); } else { inventoryManager.OpenTransferMenu(Container); } } else { if (OnInteract != null) OnInteract.Invoke(); } } } }