Advertisement
rengetsu

PD_MenuMain

Apr 13th, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.03 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine.SceneManagement;
  4. using UnityEngine;
  5.  
  6. public class MenuMain : MonoBehaviour {
  7.     public GameObject settings; //variable to check settings panel
  8.     public void StartGame() //Rooms button
  9.     {
  10.         Application.LoadLevel(1); //load level 1
  11.         //SceneManager.LoadScene("Level_01", LoadSceneMode.Additive);
  12.         //if we don't want to destroy menu object to test, use this:
  13.         //GameObject.DontDestroyOnLoad(gameObject);
  14.     }
  15.     public void LoadGame()
  16.     {
  17.         //currently absent
  18.     }
  19.     public void Settings()
  20.     {
  21.         settings.SetActive(!settings.activeSelf);
  22.     }
  23.     public void ExitGame() //Exit button
  24.     {
  25.         Application.Quit(); //close our game
  26.     }
  27.  
  28.     public void setMusic(float value) //music settings from globalsettings
  29.     {
  30.         GlobalSettings.music = value;
  31.     }
  32.  
  33.     public void setSound(float value) //sound settings from globalsettings
  34.     {
  35.         GlobalSettings.sound = value;
  36.     }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement