//结束绘制圆形之前,得到Polygon var pos = gPolyObj.Position; var bufferR = gPolyObj.Radius; var cVerticesArray = [-122.415025, 37.76059, 10, ]; var point = sgworld.Creator.GeometryCreator.CreatePointGeometry(cVerticesArray); point.X = pos.X; point.Y = pos.Y; po
Unity编辑器 - 使用GL绘制控件 控件较为复杂时,可能造成界面卡顿,在EditorGUI中也可以灵活使用GL绘制来提升性能. 以绘制线段为例: using UnityEngine; using UnityEditor; public class EditorGL { private static Material _sLineMat; static EditorGL() { Shader shader = Shader.Find("Hidden/Internal-Colored"
using UnityEngine; using System.Collections; using System; public class LearnGrazio : MonoBehaviour { public Transform m_Transform; public float m_Radius = 1; // 圆环的半径 public float m_Theta = 0.1f; // 值越低圆环越平滑 public Color m_Color = Color.green; // 线框