MonoBehaviour.OnDrawGizmos 当绘制Gizmos

function OnDrawGizmos () : void


Implement this OnDrawGizmos if you want to draw gizmos that are also pickable and always drawn.


This allows you to quickly pick important objects in your scene.


Note that OnDrawGizmos will use a mouse position that is relative to the Scene View.

注意: OnDrawGizmos使用相对鼠标坐标。

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	void OnDrawGizmos() {
		Gizmos.DrawIcon(transform.position, "Light Gizmo.tiff");
// Draws the Light bulb icon at position of the object.
function OnDrawGizmos () {
	Gizmos.DrawIcon (transform.position, " Light Gizmo.tiff");
Page last updated: 2011-1-2