You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
56 lines
1.3 KiB
C#
56 lines
1.3 KiB
C#
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();
|
|
}
|
|
}
|
|
}
|
|
}
|