Gizmos.DrawWireSphere 绘制线框球体

static function DrawWireSphere (center : Vector3, radius : float) : void

Description描述

Draws a wireframe sphere with center and radius.

使用center和radius参数,绘制一个线框球体。

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	public float explosionRadius = 5.0F;
	void OnDrawGizmosSelected() {
		Gizmos.color = Color.white;
		Gizmos.DrawWireSphere(transform.position, explosionRadius);
	}
}
var explosionRadius = 5.0;
function OnDrawGizmosSelected () {
	// Display the explosion radius when selected
	//当选择的时候显示一个白色球体线框
	Gizmos.color = Color.white;
	Gizmos.DrawWireSphere (transform.position, explosionRadius);
}
Page last updated: 2010-12-25