-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
102 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,12 @@ | ||
# IntGrids Section | ||
|
||
Assign [**IntGrid Tiles**](../Topics/topic_IntGridTile.md) for collision. | ||
Assign [**IntGrid Tiles**](../Topics/topic_IntGridTile.md) for collision. | ||
|
||
Create a new Int Grid Tile with the button at the top-right region of the inspector. | ||
![Section](../../images/img_Unity_Section_IntGrids.png) | ||
|
||
|
||
- All of the IntGrid layers and their values are displayed here for assigning. | ||
- The IntGrid Tiles are intended for collision first and foremost. | ||
However there are also options for simple rendering, or GameObjects in tile-space. | ||
|
||
- If a field is left empty, then a default tile would be used. | ||
- This tile is a square with no collision. | ||
- The IntGrid Tiles are primarily used for collision, however there are also options for simple rendering, or GameObjects in tile-space. | ||
|
||
- Choose whether to render IntGrid Tiles in the [**Main Section**](topic_Section_Main.md). | ||
- Choose whether to render IntGrid Tiles in the [**Main Section**](topic_Section_Main.md). | ||
- The fields also accept TileBase, so any kind of custom tile is allowed. However if you use IntGrid tiles, there's options for separating Tag/Layer/PhysicsMaterial. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# Setup Guide | ||
This will be a step-by-step guide for how to use the Unity importer for LDtk. | ||
Lower down in the page contains information regarding the project's importer inspector. | ||
|
||
|
||
The importer is structured where it separates the handling of tileset definitions into separate **[Tileset Files](topic_TilesetImporter.md)**. | ||
For that reason, this initial setup process is required so that tileset files are automatically generated after saving in LDtk. | ||
|
||
This guide entails three major steps: | ||
- Adding a LDtk project to the unity project | ||
- Installing an exporter app into the Library folder | ||
- Configuring the LDtk project to run a custom command on the exporter app | ||
|
||
### 1. Add to the Project | ||
Store the LDtk project file in the Unity project so that it can be imported. | ||
- The file format must be `.ldtk`. | ||
![Use Extension](../../images/img_ldtk_UseLDtkExtension.png) | ||
- If the LDtk project was outside the unity project originally, | ||
make sure that all images are also transferred, and maintain their relativity with the LDtk project. | ||
LDtk files require a direct relative connection to the image files. | ||
- You can test if the images were successfully moved by opening the LDtk project and seeing if the images were loaded successfully in LDtk. | ||
|
||
### 2. Install the Export App | ||
The export app will generate tileset files. | ||
- Select the LDtk project in Unity to show the importer inspector. | ||
- You will notice an error displayed at the top instructing to install the export app. | ||
![Install Button](../../images/img_Unity_InstallTilesetExporter.png) | ||
- Click the Install button. | ||
- After clicking, a new app is added to the Unity project's Library folder. | ||
- The code of the app available here: | ||
**[LDtkTilesetExporter on GitHub](https://github.com/Cammin/LDtkTilesetExporter)** | ||
|
||
### 3. Add a Custom Command | ||
Now that the app is installed, LDtk can execute a command to run this app. But we still need to add the command to LDtk. | ||
- Again, select the LDtk project in Unity to show the importer inspector. | ||
- You will notice an error displayed at the top instructing to configure the project with a custom command. | ||
![Fix Button](../../images/img_Unity_FixTilesetExporter.png) | ||
- From here, there are two ways to add the command to the project: automatically, or manually. | ||
- **Automatic:** | ||
Click the "Fix" button. | ||
A new dialogue will appear. | ||
Ensure all LDtk apps are closed, and click the "Auto-add command" button. | ||
A new dialogue will appear, asking to open the project and save. | ||
Open & save your LDtk project, and you're ready! | ||
- **Manual:** | ||
Click the "Copy" button. This copies the command to the clipboard. | ||
Open the LDtk project, and open the project settings. From there, find the "Custom Commands" area. | ||
Once there, create a new command, paste the command in the field, and change the timing to "Run after saving". | ||
Save your LDtk project, and you're ready! | ||
![Fix Button](../../images/img_ldtk_customCommands.png) | ||
- When saving with a custom command for the first time, LDtk will display a disclaimer. Select "I understand the risks, allow commands". | ||
- If you're in doubt, the code of the app is available **[here](https://github.com/Cammin/LDtkTilesetExporter)**. | ||
|
||
After you're ready, drag the project from the project window into the scene or the hierarchy. | ||
![Drag-N-Drop](../../images/gif_DragNDrop.gif) | ||
Tip: Double clicking the LDtk file in the project window will conveniently open the project in LDtk. | ||
|
||
# Collision | ||
There are two options to configure collision for the importer. | ||
|
||
### Tileset Files | ||
You can configure the physics shape of every individual Tileset tile. | ||
View more information [**here**](../Importer/topic_TilesetImporter.md#sprite-editor) | ||
|
||
### IntGrid Files | ||
You can create and add IntGrid Tiles into the importer and configure a collision shape for every IntGrid value, among other things. | ||
View more information [**here**](../Topics/topic_IntGridTile.md#collider-type) |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.