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.
47 lines
1.2 KiB
C#
47 lines
1.2 KiB
C#
|
3 years ago
|
using System.Collections;
|
||
|
|
using System.Collections.Generic;
|
||
|
|
using UnityEngine;
|
||
|
|
using UnityEngine.UI;
|
||
|
|
using SiegeSong;
|
||
|
|
|
||
|
|
namespace SiegeSong
|
||
|
|
{
|
||
|
|
public class IconHint : MonoBehaviour
|
||
|
|
{
|
||
|
|
public HintManager HintManager;
|
||
|
|
public Image Icon;
|
||
|
|
public Text Text;
|
||
|
|
|
||
|
|
public string Message;
|
||
|
|
public InputButton Button;
|
||
|
|
|
||
|
|
public bool Overridable;
|
||
|
|
public InputScheme OverrideScheme;
|
||
|
|
public bool OverrideInputHidden;
|
||
|
|
public InputButton OverrideInput;
|
||
|
|
public string OverrideMessage = "";
|
||
|
|
|
||
|
|
void Start()
|
||
|
|
{
|
||
|
|
HintManager.IconHintReferences.Add(this);
|
||
|
|
RefreshHint();
|
||
|
|
}
|
||
|
|
|
||
|
|
void Update() { }
|
||
|
|
|
||
|
|
public void RefreshHint()
|
||
|
|
{
|
||
|
|
Icon.enabled = true;
|
||
|
|
Icon.sprite = HintManager.GetInputIcon(Button);
|
||
|
|
Text.text = Message;
|
||
|
|
if (Overridable && HintManager.InputManager.CurrentScheme == OverrideScheme)
|
||
|
|
{
|
||
|
|
Text.text = OverrideMessage;
|
||
|
|
if (!OverrideInputHidden)
|
||
|
|
Icon.sprite = HintManager.GetInputIcon(OverrideInput);
|
||
|
|
else
|
||
|
|
Icon.enabled = false;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|