using UnityEngine;
using AC;
[RequireComponent (typeof (Hotspot))]
[AddComponentMenu("Adventure Creator/Hotspots/Override Item Prefix")]
public class OverrideItemPrefix : MonoBehaviour
{
private Hotspot _hotspot;
private int interactionIndex = -1;
private void Awake()
{
_hotspot = GetComponent<Hotspot>();
}
private void OnEnable()
{
EventManager.OnHotspotSelect += OnHotspotSelect;
}
private void OnDisable()
{
EventManager.OnHotspotSelect -= OnHotspotSelect;
}
private void OnHotspotSelect(Hotspot hotspot)
{
int itemIndex = 0;
InvItem item = KickStarter.runtimeInventory.GetItem(_hotspot.invButtons[itemIndex].invID);
if (item != null)
{
if (_hotspot.invButtons[itemIndex].syntax != "")
{
KickStarter.cursorManager.hotspotPrefix2.label = _hotspot.invButtons[itemIndex].syntax;
}
else
{
KickStarter.cursorManager.hotspotPrefix2.label = "on";
}
}
}
}
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.