RestartButton.Update C# (CSharp) Method

Update() private method

private Update ( ) : void
return void
    void Update()
    {
        if ( Input.GetKeyDown (KeyCode.R) ) {
            // restart game by reloading current scene
            Application.LoadLevel ( Application.loadedLevel );
        }

        // load a different level
        // Application.LoadLevel( 2 ); // 3rd item in the Build List
        // Application.LoadLevel( "mainMenu" );
    }

Usage Example

Ejemplo n.º 1
0
        public override void Update(GameTime gameTime, bool otherScreenHasFocus, bool coveredByOtherScreen)
        {
            base.Update(gameTime, otherScreenHasFocus, coveredByOtherScreen);

            foreach (var b in _blocks)
            {
                b.Update(this._fixedMouseJoint);
            }

            _silhouette.Update();


            if (IsGameEnd)
            {
                ScreenOfFinalBuilding();
            }

            restartButton.Update(gameTime, otherScreenHasFocus, coveredByOtherScreen);
        }
RestartButton