Adding icon to object - GreenBlackSky/the_steam_song GitHub Wiki

Icon can be used to represent object in the players inventory or NPC in dialogue window.

  1. Import the icon into the Icons folder.
  2. Convert the icon into a 2d sprite.
    1. Select it in the folder and in the Inspector, in the field "Type", choose '2D Sprite'.
    2. Save the project and in the pop-up window choose 'Allow'.
  3. Click on the object in the Hierarchy with the right button and choose -> Create -> UI -> Image.
    • A new canvas will be created, and the new Image will be its child. We don't actually need this canvas.
    • Move Image object upper in the Heirarchy to inherit the object itself.
    • Remove the canvas.
  4. Choose the image object in the Hierarchy, than open the Icons folder and drag'n'drop the icon sprite to the image field in the Inspector.
  5. Open the transform component of the image item. Set all the coordinates and rotations to 0, every scale to 1. Set the size to 50x50. Now object has icon, you are awesome!