/// <summary> /// Use this for initialization. /// </summary> private void Awake() { DontDestroyOnLoad(gameObject); if (InstanceDataLevel == null) { InstanceDataLevel = this; } else if (InstanceDataLevel != null) { Debug.Log("YA EXISTIA"); //InstanceDataLevel.gameObject.SetActive(false); //gameObject.SetActive(false); /**/ Destroy(InstanceDataLevel.gameObject); InstanceDataLevel = this; // Seteando el valor de cada uno de los (por ahora 4) jugadores for (int i = 1; i <= GameConstants.MAX_NUMBER_OF_PLAYERS; i++) { InstanceDataLevel.SetPlayerByNumber(i, 0); } InstanceDataLevel.SetWiningScore(0); InstanceDataLevel.SetGameMode(0); InstanceDataLevel.SetNumberPlayer(0); InstanceDataLevel.pause = false; // Reseteando el tiempo para cancelar la selección del jugador if (app != null) { app.timeCancelPlayer[0] = 0; app.timeCancelPlayer[1] = 0; app.timeCancelPlayer[2] = 0; app.timeCancelPlayer[3] = 0; } for (int i = 0; i < InstanceDataLevel.avatarsControllers.Count; i++) { InstanceDataLevel.avatarsControllers[i].SetNotMove(false); InstanceDataLevel.avatarsControllers[i].SetRevive(true); InstanceDataLevel.avatarsControllers[i].Death = false; InstanceDataLevel.avatarsControllers[i].SetScore(0); } if (app != null) { app.CancelSelectionAvatarControler(); } } //numberPlayers = 1; }