//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); } }
// Use this for initialization void Start() { instancia = this; Kouvinte = CapturarMovimentos.Instance; botoes.Add(this); }