Gizmos are used to give visual debugging or setup aids in the scene view. Gizmos是用于在场景视图可视化调试或辅助设置. All gizmo drawing has to be done in either OnDrawGizmos or OnDrawGizmosSelected functions of the script. 所有gizmo绘制需要在脚本的OnDrawGizmos或OnDrawGizmosSelec…
Gizmos 类 Gizmos用于场景中给出一个可视化的调试或辅助设置. 所有的Gizmos绘制都必须在脚本的OnDrawGizmos或OnDrawGizmosSelected函数中完成. OnDrawGizmos在每一帧都被调用.所有在OnDrawGizmos内部渲染的Gizmos都是可见的. OnDrawGizmosSelected尽在脚本所附加的物体被选中时调用. 类变量 ◆ static var color : Color // 描述:设置下次绘制的Gizmos的颜色.…
所有gizmo绘制需要在脚本的OnDrawGizmos或OnDrawGizmosSelected里函数完成. OnDrawGizmos在每帧调用.所有在OnDrawGizmos中渲染的gizmos都是可见的. OnDrawGizmosSelected仅在脚本附加的物体被选择时被调用. Gizmos.DrawLine 从obj1到obj2之间画一条绿色的线. using UnityEngine; using System.Collections; public class DrawLineText…
using UnityEngine; using System; public class HeGizmosCircle : MonoBehaviour { public Transform m_Transform; ; // 圆环的半径 public float m_Theta = 0.1f; // 值越低圆环越平滑 public Color m_Color = Color.green; // 线框颜色 void Start() { if (m_Transform == null) { thr…