Game Development Reference
In-Depth Information
property to the
CommandBar
script so that you can add a
debug
inventory item, as fol-
lows:
public InventoryItem debugItem;
Then, add this item to the players inventory when the script starts, as follows:
void Awake()
{
#if UNITY_EDITOR
GameState.currentPlayer.AddinventoryItem(debugItem);
#endif
This way you will always see a weapon while you're testing, and it will only be added to
the editor, thanks to the
#if UNITY_EDITOR
precompiler directive.
For more details on the precompiler directives supported in Unity, see
ht-