Gizmos.DrawIcon 绘制图标

static function DrawIcon (center : Vector3, name : string) : void


Draw an icon at world position in the scene view.


The icon has to be named name and is going to be planced at center. The icon's path can be found in the Assets/Gizmos folder or in the folder.


DrawIcon can be used to allow quick picking of important objects in your game.


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.
// Because we draw it inside OnDrawGizmos the icon is also pickable
// in the scene view.
//在物体的位置绘制一个灯泡图标,因为我们是在OnDrawGizmos 中绘制,图标在场景视图可以点选的
function OnDrawGizmos () {
	Gizmos.DrawIcon (transform.position, "Light Gizmo.tiff");
Page last updated: 2010-12-26