Unity 动态循环设置材质球的图片
生活随笔
收集整理的這篇文章主要介紹了
Unity 动态循环设置材质球的图片
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
動態循環設置材質球的圖片:
public Texture[] textures;private Renderer renderer;// Use this for initializationvoid Start () {renderer = GetComponent<Renderer>();StartCoroutine(DynamicSetTexture(10f));}// Update is called once per framevoid Update () {}private IEnumerator DynamicSetTexture(float time){for(int i=0;i<textures.Length;){renderer.material.mainTexture = textures[i];yield return new WaitForSeconds(time);i++;if (i == textures.Length) i = 0;}}總結
以上是生活随笔為你收集整理的Unity 动态循环设置材质球的图片的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Python多线程篇一,theandin
- 下一篇: 下载并安装Borland C ++ Co