Beispiel #1
0
 //Metodo que é chamado assim que essa classe é carregada, uma unica vez
 void Awake()
 {
     if (instancia != null)
     {
         Destroy(gameObject);
         print("Duplicate Listener self-destructing!");
     }
     else
     {
         instancia = this;
         //Há uma diferença entre o GameObject e o gameObject! o gameObject é o objeto que chamou esse script!
         GameObject.DontDestroyOnLoad(gameObject);
     }
 }
Beispiel #2
0
 // Use this for initialization
 void Start()
 {
     instancia = this;
     Kouvinte  = CapturarMovimentos.Instance;
     botoes.Add(this);
 }