Adding custom Gizmo icons to GameObjects

Sometimes you might want to add your own Gizmo icon to your objects. I will tell you how to do it.

First you should have an folder in your Assets folder called Gizmos.
Add your Icon to that folder.
I made this Icon. to represent a gameobject that will spawn in a player at the gameobjects location.

Add the following code to your script in the gameobject.

void OnDrawGizmos()
{
    // Draws the player icon at position of the object.
    // Because we draw it inside OnDrawGizmos the icon is also pickable
    // in the scene view.
    Gizmos.DrawIcon(transform.position, "player-icon.png", true);
}