Search Unity

What is CreateTileFromPaletteAttribute and how do you use it?

Discussion in '2D' started by ReadyPlayGames, Sep 28, 2019.

  1. ReadyPlayGames

    ReadyPlayGames

    Joined:
    Jan 24, 2015
    Posts:
    49
    I can find no documentation on this and Internet searching has also been a failure.

    From the 2019.2 release notes:
    • 2D: Added the CreateTileFromPaletteAttribute to allow users to specify how and what Tiles are created when dragging Assets onto the Tile Palette window.
    • 2D: Exposed GridPaintingState APIs to allow users to programatically change Tile Palette Painting states
    Does anyone have an example? Thank you!
     
  2. MisterSkitz

    MisterSkitz

    Joined:
    Sep 2, 2015
    Posts:
    833
    If I'm not mistaking, I believe this is the new feature that allows one to paint prefabs into the scene. For example, if you want to make a forest with 20 different types of trees, you'd only need to add the prefabs into the palette. Then you can paint them into the scene rather than hand lay each one. I haven't seen any documentation on this either but Syko briefly mentioned it in one of his ramblings.. Oops meant reviews on YouTube. Looks pretty cool and I did update to 2019 after seeing this. Haven't tried to use it yet, however.
     
  3. ReadyPlayGames

    ReadyPlayGames

    Joined:
    Jan 24, 2015
    Posts:
    49
    Yeah, I've been trying to figure out how to actually use it and I'm a bit lost.
     
  4. MisterSkitz

    MisterSkitz

    Joined:
    Sep 2, 2015
    Posts:
    833
    From what I've seen, you add the prefabs into the tile palette. This would be beneficial to 3D designing. 2D design can already be painted on tiles. Make sure to start a 3D project and then try the palette.
     
  5. ReadyPlayGames

    ReadyPlayGames

    Joined:
    Jan 24, 2015
    Posts:
    49
    I mean in the scripting API sense I don't know how it can be used.
     
  6. MisterSkitz

    MisterSkitz

    Joined:
    Sep 2, 2015
    Posts:
    833
    I haven't seen anything about how the coding would work yet on that. I'm just assuming there will be something in the package manager for us to download. Then there may be a namespace to import (using UnityEngine.TilePaletteUIPaintThinggyMaBob;)

    From there, I assume it'll have a bunch of classes and constructors to access. What these are, I just don't know. Then again, I'm just assuming... :/