void Update() { if (transition) { fadein = true; ID++; if (ID > 3) { ID = 1; } transition = false; } if (fadein) { sx = circulo.transform.localScale.x; sy = circulo.transform.localScale.y; MoverObjeto.DestroyInst = true; disableCol = true; Score.SetActive(false); Spaw.SetActive(false); canvas.SetActive(false); sx += 1.5f * Time.deltaTime; sy += 1.5f * Time.deltaTime; if (sx <= 1) { circulo.transform.localScale = new Vector3(sx, sy, 0); } else { if (ID == 1) { SpawControler.bg1 = false; SpawControler.bg2 = true; bg1.SetActive(false); bg2.SetActive(true); } else if (ID == 2) { SpawControler.bg2 = false; SpawControler.bg3 = true; bg2.SetActive(false); bg3.SetActive(true); } else if (ID == 3) { SpawControler.bg3 = false; SpawControler.bg1 = true; bg1.SetActive(true); bg3.SetActive(false); } Score.SetActive(true); Spaw.SetActive(true); fadein = false; fadeout = true; MoverObjeto.DestroyInst = false; } } if (fadeout) { sx -= 1f * Time.deltaTime; sy -= 1f * Time.deltaTime; if (sx > 0) { circulo.transform.localScale = new Vector3(sx, sy, 0); } else { circulo.transform.localScale = new Vector3(0, 0, 0); canvas.SetActive(true); disableCol = false; } } }
void Update() { if (Active) { PainelY = FundoPainel.transform.position.y; if (PainelY >= py) { PainelY = FundoPainel.transform.position.y; PainelY -= velocidadePainel * Time.deltaTime; FundoPainel.transform.position = new Vector3(FundoPainel.transform.position.x, PainelY, FundoPainel.transform.position.z); //Movimentação do Painel } if (PainelY <= py) { BotOpc1.SetActive(true); BotOpc2.SetActive(true); BotOpc3.SetActive(true); Valor1.SetActive(true); Valor2.SetActive(true); Valor2.SetActive(true); Operador.SetActive(true); Score.SetActive(false); Spaw.SetActive(false); MoverObjeto.DestroyInst = true; if (Alternativa == 4) { DesativaDesafio = true; } if (ativaDesafio && Alternativa != 4) { if (DesativaDesafio) { opc = 1; DesativaDesafio = false; } Desafio(opc); } if (DesativaDesafio && Alternativa == 4) { GerenciadorDesafio.recom = true; ativaDesafio = false; DisableDesafio(); Alternativa = 0; opc = 1; } } } else if (!Active) { BotOpc1.SetActive(false); BotOpc2.SetActive(false); BotOpc3.SetActive(false); Valor1.SetActive(false); Valor2.SetActive(false); Valor2.SetActive(false); Operador.SetActive(false); Score.SetActive(true); Spaw.SetActive(true); FundoPainel.transform.position = new Vector3(transform.position.x, 15, transform.position.z); MoverObjeto.DestroyInst = false; } }