简易旋转SkyBox

静态的天空盒看起来不太真实,希望能够动起来看起来更加真实,当然并不是复杂的天气系统,动起来满足需求即可。

以下是实现代码

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class test : MonoBehaviour {
    private Material m;
    private float speed = 0;
    void Start () {
        m = RenderSettings.skybox;
    }
    void Update () {
        speed+=Time.deltaTime*.5f;
        speed %= 360;
        m.SetFloat("_Rotation",speed);
    }
}

猜你喜欢

转载自blog.csdn.net/blastblade/article/details/81069126
今日推荐