Exemplo n.º 1
0
 IEnumerator updateText()
 {
     while (true)
     {
         depth          = Mathf.Floor(heightManagerScript.getDepth()).ToString("n0");
         depthText.text = depth + getUnit();
         yield return(null);
     }
 }
Exemplo n.º 2
0
    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);
        }
    }