This repository has been archived on 2025-04-11. You can view files and clone it, but cannot push or open issues or pull requests.
project-undercover/Project Undercover/Assets/Scripts/UI/InteractionButtonProperties.cs

35 lines
845 B
C#
Raw Permalink Normal View History

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class InteractionButtonProperties : MonoBehaviour {
public Text text;
public Interaction interaction;
void Awake () {
if (transform.childCount > 0)
{
text = transform.GetChild(0).GetComponent<Text>();
}
if (text == null)
Debug.LogError("No text child object iside of this interaction button");
}
public void SetInteraction(Interaction inter)
{
interaction = inter;
text.text = interaction.interactionDescription;
}
public void InteractionSelected()
{
Debug.Log("Selected interaction " + interaction.name + " from button " + name);
InteractionPanelController.ActivePanel.SetInteraction(interaction);
}
}