private static void InitStaticTools(LDtkDataProject project) { LDtkProviderTile.Init(); LDtkProviderTilesetSprite.Init(); LDtkProviderEnum.Init(); LDtkProviderUid.CacheUidData(project); LDtkProviderErrorIdentifiers.Init(); }
private static void DisposeStaticTools() { LDtkProviderTile.Dispose(); LDtkProviderTilesetSprite.Dispose(); LDtkProviderEnum.Dispose(); LDtkProviderUid.Dispose(); LDtkProviderErrorIdentifiers.Dispose(); }
private static Sprite GetTileFromTileset(Sprite tileset, Vector2Int sourceCathodeRayPos, int pixelsPerUnit) { Debug.Assert(pixelsPerUnit != 0); sourceCathodeRayPos = LDtkToolOriginCoordConverter.ConvertPixel(sourceCathodeRayPos, tileset.texture.height, pixelsPerUnit); Vector2Int tileSize = Vector2Int.one * pixelsPerUnit; Rect rect = new Rect(sourceCathodeRayPos, tileSize); return(LDtkProviderTilesetSprite.GetSpriteFromTilesetAndRect(tileset, rect, pixelsPerUnit)); }