Wiki

Clone wiki

X-UniTMX / Properties

Properties Guide

Here is a small guide on how to use X-UniTMX Properties.

Setting up the properties types can be read by X-UNITMX.

The plugin can automatically read three types of objects: Collider, Trigger and NoCollider.

We can setup the three Object Types inside Tiled. To do this we need to add them in Preferences configuration window, inside Object Types tab. See the image 1 for more details.

Image 1

Image 1 - Object Types setup with respective colors

Inside of X-UNITMX project there is a file ObjectTypesForTiled.xml, which can be imported by hitting Import… button.

After adding the Object Types, we can mark objects in the map with them, as shown in Image 2.

Image 2

Image 2 - Example of object marked as Trigger.

Back

Custom properties can inserted into objects in each object’s layers.

Descriptions of the properties for instantiate prefabs:

  • 0-prefab - the name of the prefab that will be instantiated.
  • 0-prefab add collider - set true or false to add in this prefab the collider layout draw in Tiled. Value example: true.
  • 0-prefab equals position collider - set true or false to transfer the position of this collider for the prefab. Value example: true
  • 0-prefab path - path inside of Resources folder project in Unity3D where the prefab file is. If it’s missing this property, by default X-UNITMX will search in the root folder of Resources. Value example: GameMaps/
  • 0-prefab z depth - Z position of the created prefab. It helps in creation of 3D games or 2.5D games. Value example: 10
  • 0-prefab send message 1 - send a broadcast message for the instantiated prefab. Useful to call a script's method for setup something. Value example: SetNextMap|MainMenu.
  • 0-prefab send message 2 - send another broadcast message for the instantiated prefab.
  • ....
  • 1-prefab - the name of the another prefab that will be instantiated.
  • ...

Starting with v2, prefab properties won't need the number prefix, but only one set of prefab properties will be read per object

Other general properties:

  • layer - set this collider/prefab physics layer, using the layer ID.
  • layer name - set this collider/prefab physics layer, using the layer name.
  • tag - set this collider/prefab GameObject's Tag.
  • sorting layer name - set this collider/prefab renderer's Sorting Layer by name, if any.
  • sorting order - set this collider/prefab renderer's Sorting Order, if any.
  • create mesh3d - can be set with true/false values. Useful for debugging Triggers and Colliders.
  • set material color - can set the color for the material of the collider/prefab renderer, if any. Useful for Triggers and Colliders. Value example: 200,128,39,128 (where 200 = Red, 128=Blue, 39=Green and 128=Alpha)
  • add component1 - add a script component to this collider.
  • add component2 - add another script component to this collider.
  • ....
  • send message1 - broadcast a message to each component attached to this collider object in Unity3D.
  • send message2 - broadcast another message to each compoent attached to this collider.
  • ....

Back

Updated