// Update is called once per frame void Update() { cT = FindObjectOfType <ComunicacaoTeste>(); if (cT.valores == "Nathan") { flag = true; } if (cT.valores == "xau") { Debug.Log("XAU"); flag = false; } if (position.x > 6f && flag == true) { aS.Play(); } if (flag == true && (position.x > 5.1f)) { position.x += -Natvel * Time.deltaTime; transform.position = position; } else if (position.x >= 4.3f && position.x <= 5.1f) { position.x = 5f; } if (flag == false) { position.x += Natvel * Time.deltaTime; transform.position = position; //position.x = 8.2f; position.x = 8.2f; } }
// Update is called once per frame void Update() { cT = FindObjectOfType <ComunicacaoTeste>(); speed = cT.valor / 50; Offset = new Vector2(0, Time.time * speed); GetComponent <Renderer>().material.mainTextureOffset = Offset; }
// Update is called once per frame void Update() { cT = FindObjectOfType <ComunicacaoTeste>(); if (cT != null) { Debug.Log(cT.valor.ToString()); } carspeed = 10f * (cT.valor + 1) / 177 + 1; transform.Translate(new Vector3(0, -1, 0) * carspeed * Time.deltaTime); }