Created
February 25, 2015 15:45
-
-
Save pmarinr/da2c2517f70454bf814e to your computer and use it in GitHub Desktop.
Sistema de variables globales
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
public class GameControl : MonoBehaviour { | |
public int puntuacion = 0; | |
public int vidas = 3; | |
public static GameControl gamecontrol; | |
void Awake(){ | |
if (gamecontrol == null) { | |
gamecontrol = this; | |
DontDestroyOnLoad (gameObject); | |
} else if (gamecontrol != this) { | |
Destroy (this); | |
} | |
} | |
public void Level2(){ | |
Application.LoadLevel ("escena2"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment