SHARE
TWEET

Untitled

a guest Jun 26th, 2019 81 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var isPaused : boolean = false;
  2. var texture1 : Texture;
  3. var texture2 : Texture;
  4.  
  5. function update()
  6. {
  7.    if(Input.GetKey(KeyCode.escape) && !isPaused)
  8.    {
  9.       print("Paused");
  10.       Time.timeScale = 0.0;
  11.       Paused = true;
  12.  
  13.    }
  14.    else if(Input.GetKey(KeyCode.Escape)&& isPaused)
  15.    {
  16.       Time.timeScale = 1.0;
  17.       isPaused = false;
  18.       print("Resume");
  19.    }
  20. }
  21.  
  22. function onGUI()
  23. {
  24.     var text : String="";
  25.     var tooltip : String="";
  26.     var buttonWidth  = texture1.width;
  27.     var buttonHeight = texture1.height;
  28.  
  29.  
  30.     var x1 = ( Screen.width - buttonWidth ) / 2.0f;
  31.     var y1 = ( Screen.height - buttonHeight ) / 2.0f;
  32.     var x2=x1;
  33.     var y2 = y1 + buttonHeight + 10;
  34.      if(isPaused){
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top