示例#1
0
        public static Texture2D CreateGradientTexture(Gradient gradient)
        {
            Texture2D texture2D = new Texture2D(256, 2, TextureFormat.ARGB32, false);

            texture2D.wrapMode  = TextureWrapMode.Clamp;
            texture2D.hideFlags = HideFlags.HideAndDontSave;
            GradientEditor.RefreshPreview(gradient, texture2D);
            return(texture2D);
        }
示例#2
0
 private void BuildTexture()
 {
     if (this.m_PreviewTex == null)
     {
         this.m_PreviewTex = GradientEditor.CreateGradientTexture(this.m_Gradient);
     }
     else
     {
         GradientEditor.RefreshPreview(this.m_Gradient, this.m_PreviewTex);
     }
     this.m_TextureDirty = false;
 }