void 大胆的大雁 (){
if (mhtdxs < 0.0001f)
{
mhtdxs = 0.0001f;
}
// 设置矩阵
Gizmos.matrix =GetComponent<Transform>().localToWorldMatrix;
// 设置颜色
Color defaultColor = Gizmos.color;
Gizmos.color = m_Color;
// 绘制圆环
float theta = 0;
for (theta = 0; theta < 2 * Mathf.PI; theta += mhtdxs){
float x = activeRange * Mathf.Cos(theta);
float z = activeRange * Mathf.Sin(theta);
Vector3 endPoint = new Vector3(x, 0, z);
if (theta == 0){
firstPoint = endPoint;
}
else{
Gizmos.DrawLine(beginPoint, endPoint);
}
beginPoint = endPoint;
}
// 绘制最后一条线段
Gizmos.DrawLine(firstPoint, beginPoint);
// 恢复默认颜色
Gizmos.color = defaultColor;
// 恢复默认矩阵
Gizmos.matrix = defaultMatrix;
}