34 lines
559 B
C#
34 lines
559 B
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class GamepadPopup : MonoBehaviour
|
|
{
|
|
[SerializeField]
|
|
private Text text;
|
|
|
|
private Animator animator;
|
|
|
|
private void Awake()
|
|
{
|
|
animator = GetComponent<Animator>();
|
|
}
|
|
|
|
public void ShowGamepadPopup(string message)
|
|
{
|
|
text.text = message;
|
|
animator.Play("GamepadPopupShow");
|
|
Invoke("HideGamepadPopup", 3.5f);
|
|
}
|
|
|
|
private void HideGamepadPopup()
|
|
{
|
|
animator.Play("GamepadPopupHide");
|
|
Invoke("DestroyPopup", 1f);
|
|
}
|
|
|
|
private void DestroyPopup()
|
|
{
|
|
Object.DestroyImmediate(base.gameObject);
|
|
}
|
|
}
|