31 lines
606 B
C#
31 lines
606 B
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using OCES.Audio;
|
|
|
|
namespace OCES
|
|
{
|
|
public class ButtonInvoker : MonoBehaviour
|
|
{
|
|
public GameState targetGameState;
|
|
|
|
Button m_button;
|
|
|
|
void Awake()
|
|
{
|
|
this.m_button = GetComponent<Button>();
|
|
|
|
this.m_button.onClick.AddListener(ButtonPressed);
|
|
}
|
|
|
|
void OnDestroy()
|
|
{
|
|
this.m_button.onClick.RemoveListener(ButtonPressed);
|
|
}
|
|
|
|
private void ButtonPressed()
|
|
{
|
|
AudioSystem.Instance.SetState(this.targetGameState);
|
|
}
|
|
}
|
|
}
|