Unity编辑器 - 使用GL绘制控件
控件较为复杂时,可能造成界面卡顿,在EditorGUI中也可以灵活使用GL绘制来提升性能。
以绘制线段为例:
using UnityEngine;
using UnityEditor;
public class EditorGL {
private static Material _sLineMat;
static EditorGL() {
Shader shader = Shader.Find("Hidden/Internal-Colored");
_sLineMat = new Material(shader);
_sLineMat.hideFlags = Hide