用GL类屏幕画线,类似于dota的选择区域
void OnPostRender() {
if (!mat) {
Debug.LogError("Please Assign a material on the inspector");
return;
}
GL.PushMatrix(); //保存当前Matirx
mat.SetPass(0); //刷新当前材质
GL.LoadPixelMatrix();//设置pixelMatrix
GL.Color(Color.yellow);
GL.Begin(GL.LINES);
GL.Vertex3(0, 0, 0);
GL.Vertex3(Screen.width, Screen.height, 0);
GL.End();
GL.PopMatrix();//读取之前的Matrix
}
具体的你可以百度这个类看看
温馨提示:内容为网友见解,仅供参考