An editor extension to have an object-creator GameObject, with buttons to instantiate different pickups at cross-hair object location in scene

If a level designer wishes to place each pickup carefully "by hand", we can still make this easier than having to drag copies of prefabs manually from the Projects panel. In this recipe, we provide a "cross-hairs" GameObject, with buttons in the Inspector allowing the game designer to create instances of three different kinds of prefab at precise locations by clicking the appropriate button when the center of the cross-hairs is at the desired location.

A Unity Editor extension is at the heart of this recipe and illustrates how such extensions can allow less technical members of a game development team to ...

Get Unity 5.x Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.