using UnityEngine;
using System.Collections;

public class MainMenuState : SceneState {

    private MainMenuGUIState menuGUI;

    private void Awake() {
        stateManager = StateManager.Instance;
        stateManager.OnStateChange += HandleOnStateChange;

        //Debug.Log("State on awake: " + stateManager.currentGameState);

        //stateManager.SetGameState(Object.FindObjectOfType<TRexGameState>());
    }

    private void Start() {
        //Debug.Log("State on start: " + stateManager.currentGameState);
        AudioManager.Instance.Play("MenuBackground", 1f, true);

        menuGUI = new MainMenuGUIState();

        menuGUI.Initialize();
    }

    private void Update() {
        if (this.isActive) {
            menuGUI.UpdateGameTime();
        }
    }

    private void HandleOnStateChange() {
        //Debug.Log("Set state from entry to: " + stateManager.currentGameState);
    }
}
