diff --git a/CHANGELOG.md b/CHANGELOG.md index 1eb7ff8..c50f667 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/) +## [4.0.1] - 2023-04-26 +### Fixed +- [GameObjectBrush] Set HideFlags of instantiated GameObject to HideFlags.None when painting +- [GridInformation] Fix serialization of GridInformationKey/Value + ## [4.0.0] - 2023-03-07 ### Added - [RuleTile] Add RotatedMirror rule which checks neighbors using both the mirror and rotation Rule in addition to the standard rotation Rule diff --git a/Editor/Brushes/GameObjectBrush/GameObjectBrush.cs b/Editor/Brushes/GameObjectBrush/GameObjectBrush.cs index 48335dc..e96b1ee 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 7f93431..b60fc44 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "com.unity.2d.tilemap.extras", "displayName": "2D Tilemap Extras", - "version": "4.0.0", + "version": "4.0.1", "unity": "2023.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": "4.0.0" + "com.unity.2d.tilemap.extras.tests": "4.0.1" }, "samples": [ { @@ -35,15 +35,15 @@ } ], "_upm": { - "changelog": "### Added\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] Validate size of GameObjectBrush when it changes" + "changelog": "### Fixed\n- [GameObjectBrush] Set HideFlags of instantiated GameObject to HideFlags.None when painting\n- [GridInformation] Fix serialization of GridInformationKey/Value" }, "upmCi": { - "footprint": "9700ea727395a7b9e99c30cc1b6d3ab7f7007532" + "footprint": "e48f8942babb511d4a959a658cbe96fcbc536dfc" }, "documentationUrl": "https://docs.unity3d.com/Packages/com.unity.2d.tilemap.extras@4.0/manual/index.html", "repository": { "url": "https://github.com/Unity-Technologies/2d-extras.git", "type": "git", - "revision": "9961725b5671e3bdfad54e45abc175e446f2131e" + "revision": "5c1725c663304c56eb3b1612a8dae90f4a0b9fa5" } }