// Update is called once per frame void Update() { rb.position.x.Equals(xfixed); PlayerWater = lgm.getWaterValue(); int n = PlayerWater * 4 / 100; //if (n == 7) n = 6; //Debug.Log(n); i.sprite = Playerlist[n]; }
/** * Update is called once per frame */ void Update() { if (ligm.getWaterValue() >= 50 && ligm.getWaterValue() < 75) { gameOver = false; //Application.LoadLevel("LargeIntestineEndStoryboard"); LIbps.end(); } if (ligm.getWaterValue() < 50) { gameOver = true; gameOverStatus = 0; Time.timeScale = 0; } if (ligm.getWaterValue() >= 75) { gameOver = true; gameOverStatus = 1; Time.timeScale = 0; } }
// Update is called once per frame void Update() { water = lgm.getWaterValue() * 1f; //Debug.Log(water); float step = speed * Time.deltaTime; float offset = -11f / 5; xnewP = xposition + (100 - water) * (offset); //if (xnewP < -130) xnewP = -110; Vector2 newposition = new Vector2(xnewP, yposition); if (transform.position.x > -100) { transform.position = Vector2.MoveTowards(transform.position, newposition, step); } //Debug.Log(newposition); //Debug.Log(xposition); }
// Update is called once per frame void Update() { Watervalue = lgm.getWaterValue() * 4 / 100 * 20; transform.position = new Vector2(currentPosition.x + 40f - Watervalue, currentPosition.y); }