Resume Button error

Posted by user3178359 on Game Development See other posts from Game Development or by user3178359
Published on 2014-06-13T09:04:37Z Indexed on 2014/06/13 9:43 UTC
Read the original article Hit count: 219

Filed under:
|

i have two class. if i press button pause it can show button resume, retry,menu and the game time is paused. but when i press the resume the game time still paused. help me plase how to continue the game time ??

code for button pause :

using UnityEngine;
using System.Collections;

public class pause : MonoBehaviour  {
    public GUITexture showMenu;
    public GUITexture btnResume;
    public bool gamePaused = false;

    void OnMouseDown() {
        gamePaused = true;
        Time.timeScale = 0;

        showMenu.pixelInset = new Rect(220, 200, showMenu.pixelInset.width, showMenu.pixelInset.height);
        btnResume.pixelInset = new Rect(300, 300, btnResume.pixelInset.width, btnResume.pixelInset.height);

code for button resume :

using UnityEngine;
using System.Collections;

public class btResume : pause {
    //public GUITexture shoe;

    void onMouseDown() {
        base.gamePaused = false;
        Time.timeScale = 1;
            btnResume.pixelInset = new Rect(300, -300, btnResume.pixelInset.width, btnResume.pixelInset.height);
            showMenu.pixelInset = new Rect(220, -200, showMenu.pixelInset.width, showMenu.pixelInset.height);

    }
}

© Game Development or respective owner

Related posts about c#

Related posts about unity