Exemplo n.º 1
0
    void Update()
    {
        transform.RotateAround(Vector3.zero, Vector3.right, Speed * Time.deltaTime);
        transform.LookAt(Vector3.zero);

        if (transform.rotation.x < 0)
        {
            RenderSettings.skybox = nightSkyBox;
            lightSource.intensity = 0f;
            water.ChangeReflection(true);
        }
        else
        {
            RenderSettings.skybox = daySkyBox;
            lightSource.intensity = 0.68f;
            water.ChangeReflection(false);
        }

        RenderSettings.skybox.SetFloat("_Rotation", Time.time * skyBoxSpeed);
    }