i Made a Custom Pause Script for a Certain function in my game. But Apparently My Buttons Do Not Appear When I Press the C Key to Pause the Game. Can Someone Help me? here’s My Code.
var isPaused : boolean = false;
function Update()
{
if(Input.GetKeyDown(KeyCode.C) !isPaused)
{
print("Paused");
Time.timeScale = 0.0;
isPaused = true;
GameObject.Find("First Person Controller").GetComponent("MouseLook").enabled=false;
GameObject.Find("First Person Controller/Main Camera").GetComponent("MouseLook").enabled=false;
}
else if(Input.GetKeyDown(KeyCode.C) isPaused)
{
print("Unpaused");
Time.timeScale = 1.0;
isPaused = false;
GameObject.Find("First Person Controller").GetComponent("MouseLook").enabled=true;
GameObject.Find("First Person Controller/Main Camera").GetComponent("MouseLook").enabled=true;
}
}
function ButtonUpdate(){
if(isPaused){
Button();
}
}
function Button(){
if(GUI.Button(Rect(0,0, 100, 50),"Category1"));
}