31 lines
817 B
C#
31 lines
817 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using Ichni.RhythmGame;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
using UnityEngine.Events;
|
|
using UnityEngine.UI;
|
|
|
|
namespace Ichni.Editor
|
|
{
|
|
public class DynamicUIButton : DynamicUIElement
|
|
{
|
|
public Button button;
|
|
public TMP_Text buttonText;
|
|
|
|
public void SetText(string buttonText, bool hasTitle)
|
|
{
|
|
this.buttonText.text = buttonText;
|
|
if(!hasTitle) title.gameObject.SetActive(false);
|
|
}
|
|
|
|
public void ApplyFunction(UnityAction function)
|
|
{
|
|
button.onClick.AddListener(function);
|
|
if (connectedBaseElement != null)
|
|
{
|
|
button.onClick.AddListener(connectedBaseElement.Refresh);
|
|
}
|
|
}
|
|
}
|
|
} |