示例#1
0
    public static IEnumerator Zoom(float amount)
    {
        if (zooming || amount == 0)
        {
            yield break;
        }
        zooming = true;

        for (int i = 0; i < zoomSteps; i++)
        {
            float skewValue = (amount > 0) ? Frani.GetInBetween(0, 2, zoomSteps, i) : Frani.GetInBetween(-2, 0, zoomSteps, i);
            Camera.main.orthographicSize += amount * zoomMultiplier + skewValue;
            yield return(null);
        }

        zooming = false;
        yield break;
    }
示例#2
0
    public static IEnumerator RotateCounterClockwise()
    {
        if (rotating)
        {
            yield break;
        }
        rotating = true;

        for (int angles = 0; angles < 44 / rotationSpeed; angles++)
        {
            Camera.main.transform.eulerAngles = new Vector3(30, Camera.main.transform.eulerAngles.y - rotationSpeed - Frani.GetInBetween(-3, 3, 44 / rotationSpeed, angles), 0);
            yield return(null);
        }

        Camera.main.transform.eulerAngles = new Vector3(30, Camera.main.transform.eulerAngles.y - 1, 0);
        rotating = false;
        yield break;
    }