I need to know what is being called in this snipit of code so i can try and create it in c#.
I normally would just use the javascript myself but i want to do some learning on the c# side of things.
function Update () {
if(Input.GetKey(“escape”)) {
//pause the game
Time.timeScale = 0;
//show the pause menu
var script3 = GetComponent(“PauseMenuScript”);
script3.enabled = true;
//disable the cursor hiding script
var script4 = GetComponent(“HideCursorScript”);
script4.enabled = false;
}
}
mainly i would like to know how you would call var script3 = GetComponent(“PauseMenuScript”);
i’ve done some looking around and i’m not really finding a solid answer to this. Any help would be great.