Search Unity

Tile Map Editor vs game tile sprites

Discussion in '2D Experimental Preview' started by Bmandk, Apr 29, 2019.

  1. Bmandk

    Bmandk

    Joined:
    Aug 18, 2012
    Posts:
    62
    I'd like to be able to create tiles that have specific sprites when in the editor, but then change into another tile when I'm in the game. Currently, I tried using Awake() and StartUp() methods to achieve this with a Scriptable Tile, but it seems they're both still called in the editor. Is there already a way to do this?
     
  2. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    303
    You could use the StartUp() method in the Tile and do a check on whether the !Application.IsEditor and Application.IsPlaying to modify the Sprite of the Tiles by calling Tilemap.RefreshTile?

    This should allow you to differentiate the Sprites between Edit mode, Play mode in Editor and Play mode in the built player.