void ComunsCarregado() { if (ExistenciaDoController.AgendaExiste(ComunsCarregado, this)) { fase = FasesDoLoad.carregando; S = new LoadAndSaveGame().Load(indiceDoJogo); if (S == null) { a2 = new AsyncOperation[1]; a2[0] = SceneManager.LoadSceneAsync("MbInfinity", LoadSceneMode.Additive); } else { a2 = new AsyncOperation[S.VariaveisChave.CenasAtivas.Count]; for (int i = 0; i < a2.Length; i++) { a2[i] = SceneManager.LoadSceneAsync(S.VariaveisChave.CenasAtivas[i].ToString(), LoadSceneMode.Additive); } } Time.timeScale = 0; SceneManager.sceneLoaded -= CarregouComuns; SceneManager.sceneLoaded += SetarCenaPrincipal; } }
private void OnRequestFillDates(IGameEvent e) { StandardSendGameEvent ssge = (StandardSendGameEvent)e; SaveDates S = (SaveDates)ssge.MyObject[0]; if (S == null) { Dados = new DadosDoJogador(); transform.position = new Vector3(4, 47, 0); } else { Dados = S.Dados; transform.position = S.Posicao; } particulaDoDanoMortal.SetActive(false); particulaDoMorrendo.SetActive(false); derrota.DesligarLosangulo(); atk.ChangeSwirdColor((int)dados.CorDeEspadaSelecionada); /* * EventAgregator.Publish(new StandardSendGameEvent(EventKey.changeMoneyAmount, Dados.Dinheiro)); * EventAgregator.Publish(new StandardSendGameEvent(EventKey.changeLifePoints, Dados.PontosDeVida,Dados.MaxVida)); * EventAgregator.Publish(new StandardSendGameEvent(EventKey.changeMagicPoints, Dados.PontosDeMana, Dados.MaxMana)); */ EventAgregator.Publish(EventKey.colorSwordShow); }
private void OnRequestFillDates(IGameEvent e) { StandardSendGameEvent ssge = (StandardSendGameEvent)e; SaveDates S = (SaveDates)ssge.MyObject[0]; if (S == null) { MyKeys = new KeyVar(); } else { VerifiqueDinheiroCaido(S.Dados.DinheiroCaido); MyKeys = S.VariaveisChave; } new MyInvokeMethod().InvokeAoFimDoQuadro(() => { new MyInvokeMethod().InvokeAoFimDoQuadro(() => { //new MyInvokeMethod().InvokeAoFimDoQuadro(() =>{ new MyInvokeMethod().InvokeAoFimDoQuadro(() => { // Debug.Log(mapConstruct+" : "+MyKeys.MapDates); mapConstruct.GetMapDates = MyKeys.MapDates; OnChangeActiveScene(null); }); }); // }); }); }
private void OnRequestFillDates(IGameEvent e) { StandardSendGameEvent ssge = (StandardSendGameEvent)e; SaveDates S = (SaveDates)ssge.MyObject[0]; if (S == null) { MostrarBotaoDash(false); } else { MostrarBotaoDash(S.Dados.TemDash); } }
public static void InvocarSetScene(Scene scene, SaveDates S) { SceneManager.SetActiveScene(scene); if (SceneManager.GetActiveScene() != scene) { GlobalController.g.StartCoroutine(setarScene(scene, S)); } else { EventAgregator.Publish(new StandardSendGameEvent(EventKey.requestToFillDates, S));//ComoPode(); } }
private void OnRequestFillDates(IGameEvent e) { StandardSendGameEvent ssge = (StandardSendGameEvent)e; SaveDates S = (SaveDates)ssge.MyObject[0]; if (S == null) { transform.position = new Vector3(-8, -2, -10); } else { transform.position = S.Posicao + new Vector3(0, 0, -10); } SetarLimitantesTransitorio(); limitantes = lerpLimitantes; }
private void OnRequestFillDates(IGameEvent e) { StandardSendGameEvent ssge = (StandardSendGameEvent)e; SaveDates S = (SaveDates)ssge.MyObject[0]; DadosDoJogador dados; if (S == null) { dados = new DadosDoJogador(); } else { dados = S.Dados; } SetarDadosIniciaisDaHud(dados); }
public static void InvocarSetScene(Scene scene, SaveDates S) { SceneManager.SetActiveScene(scene); if (SceneManager.GetActiveScene() != scene) { SupportSingleton.Instance.InvokeInSeconds(() => { InvocarSetScene(scene, S); }, 0.5f); } else { //EventAgregator.Publish(new StandardSendGameEvent(EventKey.requestToFillDates, S));//ComoPode(); MessageAgregator <MsgUpdateDates> .Publish(new MsgUpdateDates() { saveDates = S }); } }
void ComunsCarregado() { if (StaticInstanceExistence <IGameController> .SchelduleExistence(ComunsCarregado, this, () => { return(AbstractGameController.Instance); })) //if (ExistenciaDoController.AgendaExiste(ComunsCarregado, this)) { SceneManager.sceneLoaded -= CarregouComuns; SceneManager.sceneLoaded += SetarCenaPrincipal; SceneManager.sceneLoaded += TatudoCarregado; if (SaveDatesManager.s.SavedGames.Count > indiceDoJogo) { S = SaveDatesManager.s.SavedGames[indiceDoJogo]; } else { S = null; } if (S == null) { fase = FasesDoLoad.carregando; aSerCarregado = 1; a2 = new AsyncOperation[1]; a2[0] = AditiveLoadScene(NomesCenas.TutoScene); } else { NomesCenas[] N2 = DescarregarCenasDesnecessarias(S.VariaveisChave.CenasAtivas.ToArray()); numCarregador = 0; aSerCarregado = N2.Length; for (int i = 0; i < N2.Length; i++) { SceneManager.UnloadSceneAsync(N2[i].ToString()); } FuncaoCarregadora(); } } }
// Use this for initialization void Start() { SceneManager.LoadSceneAsync("comunsDeFase", LoadSceneMode.Additive); S = new LoadAndSaveGame().Load(0); if (S == null) { a2 = new AsyncOperation[1]; a2[0] = SceneManager.LoadSceneAsync("MbInfinity", LoadSceneMode.Additive); } else { a2 = new AsyncOperation[S.VariaveisChave.CenasAtivas.Count]; for (int i = 0; i < a2.Length; i++) { a2[i] = SceneManager.LoadSceneAsync(S.VariaveisChave.CenasAtivas[i].ToString(), LoadSceneMode.Additive); } } Time.timeScale = 0; SceneManager.sceneLoaded += SetarCenaPrincipal; }
static IEnumerator setarScene(Scene scene, SaveDates S) { yield return(new WaitForSeconds(0.5f)); InvocarSetScene(scene, S); }
public void Save(SaveDates paraSalvar) { Debug.Log(indiceDoJogoAtualSelecionado); SalvarArquivo("criatures.ori" + indiceDoJogoAtualSelecionado, paraSalvar); }