- Home /
Question by
ashkanaral · Feb 11, 2020 at 07:07 PM ·
buttonsceneswapping
Option Menu save click for Start Menu Button Play- Easy-Medium-Hard,How to save button click from Options Menu to Start Menu - Play-Easy-Medium-Hard Modes
I am trying to save a button click such as Easy or Medium or Hard in options menu. Then, go to Main Menu I hit play it takes the click from Easy or Medium or Hard whichever one was chosen. These Easy or Medium or Hard modes are different whole scenes. They do not have any different saved settings so far.
So far, I got help from forums, but I am still confused.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class SetDiffMode : MonoBehaviour
{
public UnityEngine.Events.UnityEvent modes;
public enum DifficultyLevel { Easy, Medium, Hard };
public static DifficultyLevel CurrentDifficulty = DifficultyLevel.Easy;
public void DiffLevel()
{
switch (CurrentDifficulty)
{
case DifficultyLevel.Easy:
SceneManager.LoadScene("Easy Scene");
break;
case DifficultyLevel.Medium:
SceneManager.LoadScene("Medium Scene");
break;
case DifficultyLevel.Hard:
SceneManager.LoadScene("Hard Scene");
break;
}
}
}
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612223146im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How can I intercept "Play scene" event at code? 1 Answer
Move camera upon button press 0 Answers
I can't click to an UI button. 3 Answers
How to get the button Working? 2 Answers