miepzerino
2023-12-17 3d3813d164cca88294e348f7b13f65b408011cda
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
using Assets.Scripts.Enums;
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
using UnityEngine.SceneManagement;
 
public class MainMenuManager : MonoBehaviour
{
    [SerializeField]
    public SceneAsset startGameScene;
    public void StartGame()
    {
        SceneManager.LoadScene(startGameScene.name);
    }
    public void SwitchToSettings()
    {
    }
    public void SwitchToHome()
    {
    }
 
    public void EndGame()
    {
#if (UNITY_EDITOR || DEVELOPMENT_BUILD)
            Debug.Log(this.name + ": " + this.GetType() + ": " + System.Reflection.MethodBase.GetCurrentMethod().Name);
#endif
#if (UNITY_EDITOR)
            UnityEditor.EditorApplication.isPlaying = false;
#elif (UNITY_STANDALONE)
            Application.Quit();
#elif (UNITY_WEBGL)
            // NOT WORKING
            // Need to add new scene "QuitScene"
            // change camera to solid color "black"
            // add scene to build settings
            // SceneManager.LoadScene("QuitScene");
#else
            Application.Quit();
#endif
    }
 
    public void OnMouseOver()
    {
        SoundManager.instance.PlaySound(SoundName.ButtonOnHover);
    }
    public void OnMouseDown()
    {
        SoundManager.instance.PlaySound(SoundName.ButtonOnClick);
    }
    public void OnSaveClick()
    {
        SoundManager.instance.PlaySound(SoundName.ButtonOnSave);
    }
}