Gizmos.DrawCube 绘制立方体

static function DrawCube (center : Vector3, size : Vector3) : void

Description描述

Draw a solid box with center and size.

使用center和size参数,绘制一个实心立方体。

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	void OnDrawGizmosSelected() {
		Gizmos.color = new Color(1, 0, 0, 0.5F);
		Gizmos.DrawCube(transform.position, new Vector3(1, 1, 1));
	}
}
function OnDrawGizmosSelected () {
	// Draw a semitransparent blue cube at the transforms position
	//绘制一个半透明蓝色立方体,在变换的位置
	Gizmos.color = Color (1,0,0,.5);
	Gizmos.DrawCube (transform.position, Vector3 (1,1,1));
}
Page last updated: 2010-12-25