first commit
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user