diff --git a/CHANGELOG.md b/CHANGELOG.md index a6b40f5..4211512 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,11 @@ All notable changes to this package will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) +## [3.1.1] - 2023-05-01 +### Fixed +- [GameObjectBrush] Set HideFlags of instantiated GameObject to HideFlags.None when painting +- [GridInformation] Fix serialization of GridInformationKey/Value + ## [3.1.0] - 2023-01-16 ### Added - [AnimatedTileEditor] -Add field to change TileAnimationFlags (For 2022.2.x) diff --git a/Editor/Brushes/GameObjectBrush/GameObjectBrush.cs b/Editor/Brushes/GameObjectBrush/GameObjectBrush.cs index 1153716..f6967da 100644 --- a/Editor/Brushes/GameObjectBrush/GameObjectBrush.cs +++ b/Editor/Brushes/GameObjectBrush/GameObjectBrush.cs @@ -592,10 +592,10 @@ private static void SetSceneCell(GridLayout grid, Transform parent, Vector3Int p renderer.enabled = true; } } - + instance.hideFlags = HideFlags.None; Undo.RegisterCreatedObjectUndo(instance, "Paint GameObject"); + var anchorRatio = GetAnchorRatio(grid, anchor); - instance.transform.position = grid.LocalToWorld(grid.CellToLocalInterpolated(position) + grid.CellToLocalInterpolated(anchorRatio)); instance.transform.localRotation = orientation; instance.transform.localScale = scale; diff --git a/Runtime/GridInformation/GridInformation.cs b/Runtime/GridInformation/GridInformation.cs index 091ccf0..d6f6373 100644 --- a/Runtime/GridInformation/GridInformation.cs +++ b/Runtime/GridInformation/GridInformation.cs @@ -23,12 +23,14 @@ internal enum GridInformationType [AddComponentMenu("Tilemap/Grid Information")] public class GridInformation : MonoBehaviour, ISerializationCallbackReceiver { + [Serializable] internal struct GridInformationValue { public GridInformationType type; public object data; } + [Serializable] internal struct GridInformationKey : IEquatable { public Vector3Int position; diff --git a/package.json b/package.json index 8551aac..93fbd23 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "com.unity.2d.tilemap.extras", "displayName": "2D Tilemap Extras", - "version": "3.1.0", + "version": "3.1.1", "unity": "2022.1", "description": "2D Tilemap Extras is a package that contains extra scripts for use with 2D Tilemap features in Unity. These include custom Tiles and Brushes for the Tilemap feature.\n\nThe following are included in the package:\nBrushes: GameObject Brush, Group Brush, Line Brush, Random Brush\nTiles: Animated Tile, Rule Tile, Rule Override Tile\nOther: Grid Information, Custom Rules for Rule Tile", "keywords": [ @@ -15,7 +15,7 @@ "com.unity.modules.jsonserialize": "1.0.0" }, "relatedPackages": { - "com.unity.2d.tilemap.extras.tests": "3.1.0" + "com.unity.2d.tilemap.extras.tests": "3.1.1" }, "samples": [ { @@ -35,15 +35,15 @@ } ], "_upm": { - "changelog": "### Added\n- [AnimatedTileEditor] -Add field to change TileAnimationFlags (For 2022.2.x)\n- [RuleTile] -Add RotatedMirror rule which checks neighbors using both the mirror and rotation Rule in addition to the standard rotation Rule\n\n### Fixed\n- [GameObjectBrush] Fix placement of GameObjects for Hexagon Layouts with Anchor\n- [GameObjectBrush] Align rotation and flip to 2D View in Editor\n- [RandomBrush] Use default color and transform when painting over with RandomBrush\n\n### Changed\n- [AnimatedTileEditor] Moved to Unity.2d.Tilemap.Extras.Editor" + "changelog": "### Fixed\n- [GameObjectBrush] Set HideFlags of instantiated GameObject to HideFlags.None when painting\n- [GridInformation] Fix serialization of GridInformationKey/Value" }, "upmCi": { - "footprint": "1d074ca74a2d695bf3e7e50a2942e2693d5f794c" + "footprint": "03522ca9708043c345659653d3ab7f8062666ddd" }, "documentationUrl": "https://docs.unity3d.com/Packages/com.unity.2d.tilemap.extras@3.1/manual/index.html", "repository": { "url": "https://github.com/Unity-Technologies/2d-extras.git", "type": "git", - "revision": "0619ff5c155088e4a8530c994129cd798bcfd97f" + "revision": "04abca0a975bb264c1f7530288b4ddfa2f4c45ea" } }