void OnGUI()
{
EGL.LabelField("Generated texture", EditorStyles.boldLabel);
EGL.LabelField("Show channels:");
EGL.BeginHorizontal();
_c[3] = GUILayout.Toggle(_c[3], "A");
EG.BeginDisabledGroup(_c[3]);
_c[0] = GUILayout.Toggle(_c[0], "R");
_c[1] = GUILayout.Toggle(_c[1], "G");
_c[2] = GUILayout.Toggle(_c[2], "B");
EG.EndDisabledGroup();
EGL.EndHorizontal();
EGL.LabelField("Zoom");
zoom = EGL.Slider(zoom, 0.2f, 3f);
EGL.LabelField("Slice");
slice = EGL.Slider(slice, 0f, 1f);
Rect r_tex = EGL.BeginVertical(GUILayout.ExpandHeight(true));
r_tex.height = r_tex.width = Mathf.Min(r_tex.height, r_tex.width);
if (texture)
{
previewMaterial.SetFloat("_Zoom", zoom);
previewMaterial.SetFloat("_Slice", slice);
previewMaterial.SetVector("_Channels", ChannelVector());
EG.DrawPreviewTexture(r_tex, texture, previewMaterial);
}
EGL.EndVertical();
}