Search Unity

[PUBLISHED] TilePlus toolkit : Tiles with Instance Data, No-cost Asset

Discussion in 'Assets and Asset Store' started by vonchor, Oct 13, 2021.

  1. vonchor

    vonchor

    Joined:
    Jun 30, 2009
    Posts:
    249
    Please install in a 2D project that has the 2D Tilemap Editor package installed.

    current: September 2023 Version 2.0 - Unity 2022.2 (LTS) or newer required

    Asset Store page


    It’s simple: TilePlus Toolkit (TPT) lets you have Unity Tilemap tiles with instance data. And it’s a zero-cost asset as well. But what the heck is instance data anyway?

    Anyone wanting to add capabilities to tiles runs into gotchas: you can add fields to tile classes, but you can’t edit them in the Inspector. Even if you could, the changes wouldn’t be saved with the scene. Rather, the changes would affect the tile asset in the project folder which of course means that all painted tiles using that tile asset would also change.

    TPT tiles don’t have this problem. When you paint a tile, it becomes an object in the scene, disconnected from the asset. TPT is based on new Tile asset classes and a support library. There are no changes to the standard Tilemap system.

    The sample tiles included with TPT add much more flexible animation capabilities including starting and stopping animations or changing them at runtime, tiles with linked prefabs, tiles with trigger zones for spawning tiles or pooled prefabs, tiles with trigger zones that work with custom coding to load new sections of your tilemap, and more.

    Wait - what’s a Tile with a linked prefab? It’s a tile that you can have in the palette that when painted immediately spawns a prefab at the same position, but the tile’s own sprite is invisible once painted. If you move the tile the prefab will move to the same position with built-in easing. This makes it super easy to paint prefabs from the tile palette if that’s what you want to do.

    Using a plug-in system, these tiles and any you create have access to Unity event functions like Update, a coroutine-like analog for WaitForSeconds, and can have references to GameObjects, components, assets, etc. If you have DOTween you can tween tile transforms and colors. Tiles can have tags for easy grouping.

    Tying it all together is a support library called TpLib. Using TpLib you can search for tiles by tag, class, or interface, and all the information is pre-cached for efficiency. A flexible messaging and persistence system is also included, but you don’t have to use it. “And much more.”

    Edit-time functions include creating special Tilemap archives which can be loaded dynamically at runtime or used as Prefabs.

    Full source is included. Documentation includes User and Programmer guides, and an API reference in CHM and HTML formats. Five different example scenes illustrate how to use TPT, and they’re explained in the Programmer Guide.

    Please use the forum for questions so that everyone can share.
     
    Last edited: Sep 7, 2023
    gooby429 likes this.
  2. vonchor

    vonchor

    Joined:
    Jun 30, 2009
    Posts:
    249
    Version 1.1 is released. A few minor bug-fixes from the original packages submitted in August, API changes, etc.
     
  3. Michoko

    Michoko

    Joined:
    Apr 15, 2017
    Posts:
    24
    This is very interesting. You also did a brilliant job at documenting this asset! Thank you very much for your hard work, and for releasing this for free! :)
     
    Last edited: Nov 19, 2021
  4. vonchor

    vonchor

    Joined:
    Jun 30, 2009
    Posts:
    249
    You're welcome!
     
  5. vonchor

    vonchor

    Joined:
    Jun 30, 2009
    Posts:
    249
    Version 1.4 is live. Workflow improvements, new features and examples, and a few bug/edge case fixes.
     
    Michoko likes this.
  6. vonchor

    vonchor

    Joined:
    Jun 30, 2009
    Posts:
    249
    Version 1.41 is on the asset store. Performance improvements and minor bug fixes.
     
  7. Ziplock9000

    Ziplock9000

    Joined:
    Jan 26, 2016
    Posts:
    360
    Quick question. Will this allow me to have different data and values on each tile INSTANCE, not just tile TYPE?

    For example, when I place my barrel tile down, will it always have to have the same 'waterlevel' value like it does when you override the tile class or use the GO property on a tile?
     
  8. vonchor

    vonchor

    Joined:
    Jun 30, 2009
    Posts:
    249
    Yes. Once you paint a TilePlus tile it no longer has any connection to the asset in the Project. When you edit any fields in the tile the instance data is private to that tile and saved with the scene. It's all explained in the docs.

    That said, that package is a year old now and you're the first person to ask me a single question!

    BTW a major update is on the way in a month or so.
     
    Ziplock9000 likes this.
  9. vonchor

    vonchor

    Joined:
    Jun 30, 2009
    Posts:
    249
    AnnotatedPainterAsEditorImages.png AnnotatedPainterImages.png

    An update for this package is coming; probably in May 2023; here's a teaser.

    New Tilemap painting/editing tool : Tile+Painter
    Better animation control for TilePlus animated tiles
    New chunking subsystem with basic fill/remove chunks of tiles inside/outside ortho camera view.
    Improved TileFab performance with caching and precloning.
    Async-based timing eliminates the TpTiming plugin for deferred callbacks.
    Simplified DOTween plugin adapter eliminates the DOTween plugin.
    More demos, improved performance and memory use.
     
  10. vonchor

    vonchor

    Joined:
    Jun 30, 2009
    Posts:
    249
  11. vonchor

    vonchor

    Joined:
    Jun 30, 2009
    Posts:
    249
  12. vonchor

    vonchor

    Joined:
    Jun 30, 2009
    Posts:
    249
  13. vonchor

    vonchor

    Joined:
    Jun 30, 2009
    Posts:
    249
    Version 2.01 with some minor bug fixes is live on the asset store.