void SetarLimitantesTransitorio() { DadosDeCena c = GlobalController.g.SceneDates.GetCurrentSceneDates(); if (c != null) { GetComponent <Camera>().backgroundColor = c.bkColor; } /* * DadosDeCena.LimitantesDaCena dl = c.limitantes; * Debug.Log(dl.xMin+" : "+dl.xMax+" : "+dl.yMin+" : "+dl.yMax); */ lerpLimitantes = c != null?CalcularLimitantes(c.limitantes) : null; if (lerpLimitantes != null) { useLimitsCam = true; } else { useLimitsCam = false; } }
public void IniciarMusicaDaCena(DadosDeCena d) { //DadosDeCena d = SceneDates.GetCurrentSceneDates(); if (d != null) { IniciarMusica(d.musicName); } }
void OnChangeActiveScene(IGameEvent e) { DadosDeCena d = sceneDates.GetCurrentSceneDates(); bool foi = true; //Debug.Log(d + " : " + musica + " : " + musica.MusicaAtualAtiva + " : " + d.musicName+" : "+d.musicName.Musica); if (musica.MusicaAtualAtiva != null && d != null) { if (musica.MusicaAtualAtiva.Musica.name == d.musicName.Musica.ToString()) { foi = false; } } if (foi && d != null) { musica.IniciarMusica(d.musicName.Musica, d.musicName.Volume); } }
/*Essa função precisa de grandes melhorias*/ void TentarSetarCena(NomesCenas s) { DadosDeCena dd = null; bool foi = false; foreach (DadosDeCena d in meusDados) { if (d.nomeDaCena == s) { foi = true; dd = d; } } if (foi) { if (dd.limitantes.xMax == dd.limitantes.xMin) { GameObject G = GameObject.Find("startBlock"); if (G != null) { dd.limitantes.xMin = G.transform.position.x; dd.limitantes.yMin = G.transform.position.y; } G = GameObject.Find("endBlock"); if (G != null) { dd.limitantes.xMax = G.transform.position.x; dd.limitantes.yMax = G.transform.position.y; } } } else { GameObject G1 = GameObject.Find("startBlock"); GameObject G2 = GameObject.Find("endBlock"); if (G1 != null && G2 != null) { Vector3 V1 = G1.transform.position; Vector3 V2 = G2.transform.position; meusDados.Add(new DadosDeCena() { bkColor = new Color(.25f, .35f, .75f), limitantes = new DadosDeCena.LimitantesDaCena() { xMin = V1.x, xMax = V2.x, yMax = V2.y, yMin = V1.y }, nomeDaCena = s }); } else { Debug.LogWarning("startBlock e endBlock não inseridos"); } } }