// Update is called once per frame void Update() { debuggg.text = "" + estado + " (" + state + ")"; //mcRef.loadLvl.allowSceneActivation = carga; if (estado == "logo") { elapsedTime += Time.deltaTime; if (elapsedTime > minTime) { if (Input.GetMouseButtonDown(0)) { elapsedTime = delayTime + 1.0f; } } if ((elapsedTime > delayTime) && state == 0) { //fader._wa_fadeOut (this); fRef.fadeOut(); state = 1; } if (!fRef.isFading && state == 1) { estado = "titulo"; grupoLogo.SetActive(false); fRef.fadeIn(); state = 0; } } if (estado == "titulo") { if (state == 0) { if (elapsedTimeTitle < 2.0f) { elapsedTimeTitle += Time.deltaTime; } else { ++state; } } if (state == 1) { heroGlow.glow(); tocaParaEmpezar.SetActive(true); loadingStringBank.rosetta = rosetta; loadingStringBank.reset(); loadingText.text = loadingStringBank.getNextString(); tocaParaEmpezar.GetComponent <TextMesh> ().text = loadingStringBank.getNextString(); //touchToStartText.text = loadingStringBank.getNextString (); // touchToStartText.transform.localScale = Vector3.zero; // touchToStartText.GetComponent<TouchToStart> ().reset (); // touchToStartText.GetComponent<Renderer> ().enabled = true; ++state; } ++count; if (count == 10) { //fRef = fadeRef.GetComponent<FaderScript> (); //fRef.setFadeValue (0.0f); //fRef.fadeIn (); } if (Input.GetMouseButtonDown(0) && !tocaParaEmpezar.GetComponent <TouchToStart>().wait) // if screen touched { fRef.fadeOut(); // start a fadeout beginTime = Time.time; mcRef.setVolume(0, 1.5f); } if ((beginTime > 0.0f) && (Time.time - beginTime) > 2.0) // wait for 2 seconds { vText.enabled = false; uiload.load(); //this.activityFinish (); estado = "cargando"; mcRef.LoadAsync(); contador = 2; } } if (estado == "cargando") { contador -= Time.deltaTime; if (contador <= 0) { this.activityFinish(); } } }