Created
November 11, 2012 01:41
-
-
Save kyleweiner/4053316 to your computer and use it in GitHub Desktop.
Unity: Draws an icon on a game object in Unity 3D's Scene View.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma strict | |
/*********************************************************************** | |
* Notes | |
***********************************************************************/ | |
/* | |
* Attach this script to an empty game object to give it an icon in the | |
* Scene View. The icon file, as set by the "name" variable, should reside | |
* in the project's "Assets/Gizmos" folder. See this page for more details: | |
* http://docs.unity3d.com/Documentation/ScriptReference/MonoBehaviour.OnDrawGizmos.html | |
*/ | |
var filename : String; // e.g. "Spawn Point Gizmo.tif" | |
var allowScaling : boolean = true; | |
function OnDrawGizmos() { | |
Gizmos.DrawIcon(transform.position, filename, allowScaling); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment