Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var isPaused : boolean = false;
- var texture1 : Texture;
- var texture2 : Texture;
- function update()
- {
- if(Input.GetKey(KeyCode.escape) && !isPaused)
- {
- print("Paused");
- Time.timeScale = 0.0;
- Paused = true;
- }
- else if(Input.GetKey(KeyCode.Escape)&& isPaused)
- {
- Time.timeScale = 1.0;
- isPaused = false;
- print("Resume");
- }
- }
- function onGUI()
- {
- var text : String="";
- var tooltip : String="";
- var buttonWidth = texture1.width;
- var buttonHeight = texture1.height;
- var x1 = ( Screen.width - buttonWidth ) / 2.0f;
- var y1 = ( Screen.height - buttonHeight ) / 2.0f;
- var x2=x1;
- var y2 = y1 + buttonHeight + 10;
- if(isPaused){
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement