Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.SceneManagement; // narzedzie do ladowania scen
- public class Game_Menager_Script : MonoBehaviour
- {
- public static int lives = 3;
- public static int Difficulty = 0;
- public enum MenuState { main, options, how, game } //typ zmiennej , pozwala wyszczegolnic opcje do wyboru
- public MenuState state; // konkretna zmienna do enuma
- public static bool IsMushroom = false;
- // Use this for initialization
- void Start ()
- {
- }
- // Update is called once per frame
- void Update ()
- {
- }
- private void OnGUI()
- {
- if (state == MenuState.main)
- {
- if (GUI.Button(new Rect(0, 0, 200, 30), "Nowa Gra")) // odleglosc,odstep,szerokosc,wysokosc
- {
- SceneManager.LoadScene("level_1");
- }
- if (GUI.Button(new Rect(0, 40, 200, 30), "Opcje"))
- {
- state = MenuState.options;
- }
- if (GUI.Button(new Rect(0, 80, 200, 30), "Jak graΔ?"))
- {
- state = MenuState.how;
- }
- if (GUI.Button(new Rect(0, 120, 200, 30), "WyjΕcie"))
- {
- Application.Quit();
- }
- }
- if (state == MenuState.options)
- {
- if (GUI.Button(new Rect(0, 0, 200, 30), "Easy"))
- {
- Difficulty = 0;
- state = MenuState.main;
- }
- if (GUI.Button(new Rect(0, 40, 200, 30), "Medium"))
- {
- Difficulty = 1;
- state = MenuState.main;
- }
- if (GUI.Button(new Rect(0, 80, 200, 30), "Hard"))
- {
- Difficulty = 2;
- state = MenuState.main;
- }
- if (GUI.Button(new Rect(0, 120, 200, 30), "Back"))
- {
- state = MenuState.main;
- }
- }
- if (state == MenuState.how)
- {
- GUI.Label(new Rect(0, 0, 500, 100), "Zbierz wszystkie punkty");
- if (GUI.Button(new Rect(0, 120, 200, 30), "Back"))
- {
- state = MenuState.main;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement