创建一个脚本 附加到一个游戏体上 using UnityEngine;using System.Collections; public class ProceduralTexture : MonoBehaviour{#region Public Variables //纹理的宽高 public int widthHeight = 512; //程序生成的纹理 public Texture2D generaterdTexture;#endregion #region Private Variabl