IEnumerator updateText() { while (true) { depth = Mathf.Floor(heightManagerScript.getDepth()).ToString("n0"); depthText.text = depth + getUnit(); yield return(null); } }
IEnumerator lerpBackground() { while (true) { lerpPercent = (heightManagerScript.getDepth() + heightManagerScript.getStartingDepth() - startLerpY) / (endLerpY - startLerpY); //Debug.Log(endPositionY + " " + lerpPercent); backgroundPosition.y = Camera.main.transform.position.y + Mathf.Lerp(startPositionY, endPositionY, lerpPercent); backgroundPosition.z = this.transform.position.z; this.transform.position = backgroundPosition; yield return(null); } }