Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Editor vs game tile sprites

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

  1. Bmandk

    Bmandk

    Joined:
    Aug 18, 2012
    Posts:
    70
    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:
    1,068
    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.