44 lines
953 B
C#
44 lines
953 B
C#
using System;
|
|
using UnityEngine;
|
|
using UnityEngine.SceneManagement;
|
|
|
|
public class MainMenuHandler : MonoBehaviour
|
|
{
|
|
[SerializeField] private Animator uiAnimator;
|
|
[SerializeField] private string openUIAction;
|
|
[SerializeField] private string closeUIAction;
|
|
[SerializeField] private string gameStartAction;
|
|
[SerializeField] private Transform uiMovingObject;
|
|
[SerializeField] private DialogueScript startingScript;
|
|
|
|
|
|
private void Start()
|
|
{
|
|
//uiAnimator.SetTrigger(gameStartAction);
|
|
}
|
|
|
|
public void StartGame()
|
|
{
|
|
LevelSwitcher.instance.SwitchLevel(2, startingScript);
|
|
}
|
|
|
|
public void StartEndless()
|
|
{
|
|
|
|
}
|
|
|
|
public void QuitGame()
|
|
{
|
|
Application.Quit();
|
|
}
|
|
public void OpenUI(GameObject uiToOpen)
|
|
{
|
|
uiAnimator.SetTrigger(openUIAction);
|
|
uiToOpen.transform.SetParent(uiMovingObject);
|
|
uiToOpen.transform.position = uiMovingObject.position;
|
|
}
|
|
public void CloseUI(GameObject uiToClose)
|
|
{
|
|
uiAnimator.SetTrigger(closeUIAction);
|
|
}
|
|
}
|