diff --git a/Assets/LDtkUnity/Editor/ScriptedImporter/LDtkImporterConsts.cs b/Assets/LDtkUnity/Editor/ScriptedImporter/LDtkImporterConsts.cs index 5a7826f33..8a180087d 100644 --- a/Assets/LDtkUnity/Editor/ScriptedImporter/LDtkImporterConsts.cs +++ b/Assets/LDtkUnity/Editor/ScriptedImporter/LDtkImporterConsts.cs @@ -12,17 +12,18 @@ internal static class LDtkImporterConsts public const string LEVEL_EXT = "ldtkl"; public const string TILESET_EXT = "ldtkt"; - //choosing a high import order so that any prefab changes respond correctly for the import process, whether prefabs are modified internally in unity or externally (eg. source control) + public const int DEFAULT_PPU = 16; + private const int SCRIPTED_IMPORTER_ORDER = 1000; //Some discoveries about it to make entity prefabs work as expected: https://forum.unity.com/threads/create-additional-prefab-assets-in-scriptedimporter-and-track-them.1158734/#post-7792380 - //Import order is not documented much, but prefab order is 500/501 https://forum.unity.com/threads/understanding-import-order-of-native-unity-asset-types.1187845/ //projects are imported first, so that separate levels can load the project's imported assets. levels will directly load the json for levels instead of loading the imported asset. - //Edit: making prefabs import before projects - public const int TILESET_ORDER = 94; - public const int PROJECT_ORDER = 95; - public const int LEVEL_ORDER = 99; //99 is the secret parallel import value + //Import order https://forum.unity.com/threads/understanding-import-order-of-native-unity-asset-types.1187845/#post-9171509 + //Important to reimport before prefabs (1500) + //99 is the secret parallel import value, but doesnt appear to work. maybe in a future update + public const int TILESET_ORDER = 1094 - SCRIPTED_IMPORTER_ORDER; + public const int PROJECT_ORDER = 1095 - SCRIPTED_IMPORTER_ORDER; + public const int LEVEL_ORDER = 1099 - SCRIPTED_IMPORTER_ORDER; - public const int DEFAULT_PPU = 16; } } \ No newline at end of file diff --git a/DocFX/documentation/Importer/topic_LevelImporter.md b/DocFX/documentation/Importer/topic_LevelImporter.md index 52197aea8..cc62be700 100644 --- a/DocFX/documentation/Importer/topic_LevelImporter.md +++ b/DocFX/documentation/Importer/topic_LevelImporter.md @@ -11,9 +11,8 @@ There are many benefits to using separate level files: - Helps enable modular level design. (ex. randomly-generated dungeon with levels for dungeon pieces) - Only modified level files will reimport instead of the project and all levels, resulting in quicker import speeds when applicable - Only the dependencies involved in a particular level will reimport the level instead of involving all possible dependencies (Entities, IntGrid tiles) -- Only the level assets in the scene are loaded into memory during runtime. -- Level files can be imported simultaneously in parallel, resulting in faster import times when reimporting multiple levels. Available in Unity 2021.2 or higher at `Project Settings > Editor > Asset Pipeline > Parallel Import` - +- Only the level assets in the scene are loaded into memory during runtime. + For speed reasons, using separate level files is preferable, especially for any larger scale game projects.