Need help with menu.
Hello! I'm quite new to this so bare with me, I have replicated "2D Roguelike tutorial" and wanted to add a simple main menu, I found some tutorial on YouTube, set two buttons(Play and Exit). I use this code.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
public class MainMeniu : MonoBehaviour {
public void LoadByIndex(int sceneIndex)
{
SceneManager.LoadScene(sceneIndex);
}
public void Quit()
{
#if UNITY_EDITOR
UnityEditor.EditorApplication.isPlaying = false;
#else
Application.Quit();
#endif
}
}
And the problem is when I press Play button it loads the game scene but not from level 1, but level 2 and after getting to exit it gets to level 4 with zero food.
+Could I get an advice on how to make the menu to pop up mid game when pressing "Esc" button.
Your answer
Follow this Question
Related Questions
My C# code is not working as planned. Please help. (Level Unlocking) 1 Answer
I need help with boss design. I am new to coding so any help would be nice. 0 Answers
Character moves without arrow keys 0 Answers
How to make bullet auto find target unity 2d game? 0 Answers
How to add a Control Page to Pause Menu? 0 Answers