新建一个脚本,这个物体得挂在有摄像机组件的物体上才能生效 OnPostRender() 这个函数才会被自动调用(类似生命周期自动调用) 然后就可以代码画线了,原理是openGL的画线 using UnityEngine; using System.Collections; using System.Collections.Generic; /// <summary> /// GL画图 /// </summary> public class GLDraw : UnityNormalS…
using UnityEngine; using System.Collections; public class TGLLine : MonoBehaviour { private static Material mat; void Start () { CreateLineMaterial(); } void Update () { } //画线框用的mat public static Material CreateLineMaterial(){ mat = new Material("Sh…