hey guys. i made a pause menu script and i have my character model set on mouse orbit but it doesnt work with the pause script. here’s the pause menu script:
using UnityEngine;
using System.Collections;
public class PauseMenu : MonoBehaviour
{
public GUISkin myskin;
private Rect windowRect;
private bool paused = false , waited = true;
private void Start()
{
windowRect = new Rect(Screen.width / 2 - 100 , Screen.height / 2 - 100, 200, 200);
}
private void waiting()
{
waited = true;
}
private void Update ()
{
if (waited)
if(Input.GetKey(KeyCode.P) || Input.GetKey(KeyCode.Escape))
{
if (paused)
paused = false;
else
paused = true;
waited = false;
Invoke("waiting",0.3f);
}
}
private void OnGUI()
{
if (paused)
windowRect = GUI.Window(0,windowRect, windowFunc, "Pause Menu");
}
private void windowFunc(int id)
{
if(GUILayout.Button("Resume"))
{
paused = false;
}
if(GUILayout.Button("Options"))
{
}
if(GUILayout.Button("Return to Main Menu"))
{
Application.LoadLevel ("Main Menu");
}
}
}
Do you think you could send me some advice on how to make the orbit pause along with the menu? Thanks!