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); }
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; }