Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
## [1.6.0-preview.1] - 2021-02-19
- [HexagonalRuleTile] Fix issue with mirror rule
- [RuleTile] Add min and max animation speedup
- [RuleOverrideTile] Fix import issue when upgrading from a previous version of RuleOverrideTile
- [RuleTileEditor] Add new rule below selected rule in RuleTileEditor
- [RuleTileEditor] Add dropdown to duplicate Rule

## [1.5.1-preview] - 2020-09-25
### Changed
- Update samples
- Update documentation
- Add contribution notice in README.md
- Update Third Party Notices.md
- [PrefabBush] Add pick
- [PrefabBush] Add tooltip for "Erase Any Objects" field
- [PrefabBrush][GameObjectBrush] Account for Anchor when using GetObjectsInCell in PrefabBrush and GameObjectBrush
- [CustomRuleTileScript] Allow Custom Rule Tile template script to be created regardless of where template script is installed (from a package or in the project)
- [RuleTile/RuleOverrideTile/AdvancedRuleOverrideTile] Renamed Game Object to GameObject
- [RuleTile] Fix menu order for RuleOverrideTile
- [RuleOverrideTile] Fix menu order for RuleOverrideTile
- [AdvancedRuleOverrideTile] Fix Rule toggle for AdvancedRuleOverrideTile
- [GameObjectBrush] Use correct position when ClearSceneCell
- [GameObjectBrush] Update cells when size changes
- [GameObjectBrush] Clear cell for Prefabs
- [LineBrush] Clear previews from base.OnPaintSceneGUI
- [GameObjectBrush] Add Paint on Scene view to GameObjectBrush
- [PrefabBush] Add BoxFill to PrefabBrush
- [PrefabBush] Add Rotation to PrefabBrush
- [PrefabBrush] Fix box erase
- Consolidated menu items
  • Loading branch information
Unity Technologies committed Feb 19, 2021
1 parent 82c1d36 commit 6cb45d1
Show file tree
Hide file tree
Showing 122 changed files with 4,196 additions and 846 deletions.
39 changes: 38 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,52 @@ 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/)

## [1.6.0-preview.1] - 2021-02-19
- [HexagonalRuleTile] Fix issue with mirror rule
- [RuleTile] Add min and max animation speedup
- [RuleOverrideTile] Fix import issue when upgrading from a previous version of RuleOverrideTile
- [RuleTileEditor] Add new rule below selected rule in RuleTileEditor
- [RuleTileEditor] Add dropdown to duplicate Rule

## [1.5.1-preview] - 2020-09-25
### Changed
- Update samples
- Update documentation
- Add contribution notice in README.md
- Update Third Party Notices.md
- [PrefabBush] Add pick
- [PrefabBush] Add tooltip for "Erase Any Objects" field
- [PrefabBrush][GameObjectBrush] Account for Anchor when using GetObjectsInCell in PrefabBrush and GameObjectBrush
- [CustomRuleTileScript] Allow Custom Rule Tile template script to be created regardless of where template script is installed (from a package or in the project)
- [RuleTile/RuleOverrideTile/AdvancedRuleOverrideTile] Renamed Game Object to GameObject
- [RuleTile] Fix menu order for RuleOverrideTile
- [RuleOverrideTile] Fix menu order for RuleOverrideTile
- [AdvancedRuleOverrideTile] Fix Rule toggle for AdvancedRuleOverrideTile
- [GameObjectBrush] Use correct position when ClearSceneCell
- [GameObjectBrush] Update cells when size changes
- [GameObjectBrush] Clear cell for Prefabs
- [LineBrush] Clear previews from base.OnPaintSceneGUI
- [GameObjectBrush] Add Paint on Scene view to GameObjectBrush
- [PrefabBush] Add BoxFill to PrefabBrush
- [PrefabBush] Add Rotation to PrefabBrush
- [PrefabBrush] Fix box erase
- Consolidated menu items

## [1.5.0-preview] - 2020-02-14
### Added
- Added CONTRIBUTING.md
- Updated LICENSE.md

### Added
- [PrefabRandomBrush] Split functionality of PrefabBrush to PrefabBrush and PrefabRandomBrush
- [PrefabBrush/PrefabRandomBrush] Add Erase Any Objects toggle to choose between erasing any Objects or Objects in the Brush

### Changed
- Consolidated menu items

### Fixed
- [WeightedRandomTile] Fixed WeightedRandomTile messing up Random.seed!


## [1.4.0] - 2020-01-07
### Added
- [RuleTile / HexagonalRuleTile / IsometricRuleTile / RuleOverrideTile] Added Asset Preview for TilingRules
Expand Down
25 changes: 25 additions & 0 deletions Documentation~/AdvancedRuleOverrideTile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Advanced Rule Override Tile

__Contributions by:__ [johnsoncodehk](https://github.com/johnsoncodehk), [Autofire](https://github.com/Autofire)

__Advanced Rule Override Tiles__ are Tiles which can override a subset of Rules for a given [Rule Tile](RuleTile.md) while maintaining most of the other set Rules of the Rule Tile. This allows you to create Tiles that provide specialized behavior in specific scenarios.

## Properties

| Property | Function |
| ----------------- | ------------------------------------------------------------ |
| __Tile__ | The Rule Tile to override. |

Depending on the Rule Tile that is overridden, there may be further properties which you can override here. Any public property in the Rule Tile that does not have a `RuleTile.DontOverride` attribute will be shown here and can be overridden.

## Usage

First select the Rule Tile to be overridden in the __Tile__ property. The Rule Override Tile editor then displays the different rules in the selected Rule Tile which you can override.

Select the Rule which you want to override by toggling the Rule. This will allow you to modify the output of the Rule, such as the Sprite, the GameObject or the Collider Type. The outputs are the same as the original [Rule Tile](RuleTile.md) and are detailed there. The matching Rule itself cannot be changed here and is displayed here to help identify it.

![Advanced Rule Override Tile Editor](images/AdvancedRuleOverrideTileEditor.png)

Paint with the Advanced Rule Override Tile using the [Tile Palette](https://docs.unity3d.com/Manual/Tilemap-Painting.html) tools.

![Scene View with Advanced Rule Override Tile](images/AdvancedRuleOverrideTile.png)
25 changes: 12 additions & 13 deletions Documentation~/AnimatedTile.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
# Animated Tile

###### *Contribution by: MahdiMahzuni*
__Contribution by:__ MahdiMahzuni

Animated Tiles are tiles which run through and display a list of sprites in sequence.
An Animated Tile runs through and displays a list of Sprites in sequence to create a frame-by-frame animation.

![](images/AnimatedTileEditor.png)<br/>Animated Tile editor window

### Properties

| Property | Function |
| ------------------------------ | ------------------------------------------------------------ |
| __Number of Animated Sprites__ | Number of Animated Sprites in the Animated Tile. |
| __Sprite__ | The Sprite set for the Animated Tile. This will be played in sequence. |
| __Minimum Speed__ | The minimum possible speed at which the Animation of the Tile will be played. A speed value will be randomly chosen between the minimum and maximum speed. |
| __Maximum Speed__ | The maximum possible speed at which the Animation of the Tile will be played. A speed value will be randomly chosen between the minimum and maximum speed. |
| __Start Time__ | The starting time of this Animated Tile. This allows you to start the Animation from a particular Sprite in the list of Animated Sprites. |
| __Collider Type__ | The Collider Shape generated by the Tile. |
| __Sprite list__ | The list displaying the current order of Sprites for this Animated Tile’s animation which plays in sequence. Set a Sprite by selecting the **Select** button at the bottom right of the Sprite preview, then choosing the Sprite from the dialog box. Select and hold the **=** next to each Sprite to reorder their place in the animation sequence. |
| __Minimum Speed__ | The minimum possible speed at which the Animation of the Tile is played. A speed value will be randomly chosen between the minimum and maximum speed. |
| __Maximum Speed__ | The maximum possible speed at which the Animation of the Tile is played. A speed value will be randomly chosen between the minimum and maximum speed. |
| __Start Time__ | The starting time of this Animated Tile. This allows you to start the Animation from a particular time. |
| __Start Frame__ | The starting frame of this Animated Tile. This allows you to start the Animation from a particular Sprite in the list of Animated Sprites. |
| __Collider Type__ | The [Collider](https://docs.unity3d.com/Manual/Collider2D.html) shape generated by the Tile. |

### Usage

Set up the Animated Tile with the Animated Sprites through the Animated Tile Editor.

![Animated Tile Editor](images/AnimatedTileEditor.png)

Paint the Animated Tile using the Tile Palette tools.
Create the Animated Tile by selecting and ordering the Sprites that makes up its animation sequence in the Animated Tile editor, then paint the Animated Tile with the [Tile Palette tools](https://docs.unity3d.com/Manual/Tilemap-Painting.html).

![Game View with Group Brush](images/AnimatedTile.png)
![](images/AnimatedTile.png)<br/>Game view, painted with the [Group Brush](GroupBrush.md).
20 changes: 4 additions & 16 deletions Documentation~/Brushes.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,13 @@
# Scriptable Brushes

You can script Brushes to paint items based on the position and conditions of the cell it targets on the Grid Layout. Brush paint behavior can be further modified by the selected editing Tool, such as __Erase__ or __Floodfill__.

Here are some implementations of **Scriptable Brushes** which can help save time when designing your Tilemap:

Scriptable Brushes are Grid Brushes which can paint items based on the position and conditions of the targeted position on the GridLayout. The paint behavior can be modified by the current editing Tool selected, such as Erase or Floodfill.



Here are some implementations of Scriptables Brushes which can help save time in designing your Tilemap:



- [Game Object Brush](GameObjectBrush.md)
- [GameObject Brush](GameObjectBrush.md)
- [Random Brush](RandomBrush.md)
- [Tint Brush](TintBrush.md)
- [Tint Brush (Smooth)](TintBrushSmooth.md)
- [Prefab Brush](PrefabBrush.md)
- [Coordinate Brush](CoordinateBrush.md)
- [Line Brush](LineBrush.md)
- [Group Brush](GroupBrush.md)



The manual page for Scriptable Brushes can be found [here](https://docs.unity3d.com/Manual/Tilemap-ScriptableBrushes.html).
Refer to the [Scriptable Brushes](https://docs.unity3d.com/Manual/Tilemap-ScriptableBrushes.html) documentation for more information.

38 changes: 22 additions & 16 deletions Documentation~/Contributors.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,28 @@

Thank you to all who have contributed to this repository!

- johnsoncodehk
- nicovain
- superkerokero
- pmurph0305
- janissimsons
- distantcam
- Pepperized
- [johnsoncodehk](https://github.com/johnsoncodehk)
- [nicovain](https://github.com/nicovain)
- [superkerokero](https://github.com/superkerokero)
- [pmurph0305](https://github.com/pmurph0305)
- [janissimsons](https://github.com/janissimsons)
- [distantcam](https://github.com/distantcam)
- [Pepperized](https://github.com/Pepperized)
- MahdiMahzuni
- DreadBoy
- DoctorShinobi
- CraigGraff
- Autofire
- AVChemodanov
- ream88
- Quickz
- capnslipp
- TrentSterling
- [DreadBoy](https://github.com/DreadBoy)
- [DoctorShinobi](https://github.com/DoctorShinobi)
- [CraigGraff](https://github.com/CraigGraff)
- [Autofire](https://github.com/Autofire)
- [AVChemodanov](https://github.com/AVChemodanov)
- [ream88](https://github.com/ream88)
- [Quickz](https://github.com/Quickz)
- [capnslipp](https://github.com/capnslipp)
- [TrentSterling](https://github.com/TrentSterling)
- [vladderb](https://github.com/vladderb)
- [trobol](https://github.com/trobol)
- [HyagoOliveira](https://github.com/HyagoOliveira)
- [RyotaMurohoshi](https://github.com/RyotaMurohoshi)
- [ManickYoj](https://github.com/ManickYoj)
- [n4n0lix](https://githubb.com/n4n0lix)

If anybody has been missed, please do let us know!
7 changes: 4 additions & 3 deletions Documentation~/CoordinateBrush.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Coordinate Brush

###### *Contributions by: nicovain, pmurph0305*
__Contributions by :__ [nicovain](https://github.com/nicovain), [pmurph0305](https://github.com/pmurph0305)

This Brush displays the cell coordinates it is targeting in the SceneView. Use this as an example to create brushes which have extra visualization features when painting onto a Tilemap.
This Brush displays the coordinates of the it is currently targeting in the Scene view. Use this Brush as an example for creating custom Brushes that display extra visual features, such as cell coordinates or other information, while painting a Tilemap with the Brush.

![](images/CoordinateBrush.png)<br/>When painting with the Coordinate Brush in the Scene view, the position of the currently highlighted cell is displayed.

![Scene View with Coordinate Brush](images/CoordinateBrush.png)
30 changes: 15 additions & 15 deletions Documentation~/CustomRulesForRuleTile.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
# Custom Rules for Rule Tile

###### *Contribution by: johnsoncodehk*
__Contribution by:__ [johnsoncodehk](https://github.com/johnsoncodehk)

This helps to create new custom Rule Tile with new matching options, instead of the default options: Don't Care, This and Not This for the default Rule Tile. Using this will create clickable options for each Rule in your custom Rule Tile.
Use this template script to create new custom [Rule Tiles](RuleTile.md) with matching options that differ from the Rule Tile’s [default options](RuleTile.md#Usage) (namely **This** and **Not This**). This creates selectable options for each Rule in your custom __Rule Tile__.

### Features
## Template features

- Inheritable RuleTile
- Customizable attributes
- Can expand or rewrite neighbor rules and GUI display
- Can be used by RuleOverrideTile
- Template script (Menu: Assets/Create/Custom Rule Tile Script)
- Neighbor rules tooltip
- Backward compatible
- Inheritable Rule Tile.
- Customizable properties.
- Expand or rewrite both neighbor Rules and the GUI display of the Rules.
- Usable with by [RuleOverrideTile](RuleOverrideTile.md)
- Create from a template script.
- Neighbor Rules tooltips.
- Backward compatible.

### Usage
## Creating a custom Rule Tile script

From the Assets menu, select Create/Custom Rule Tile Script. This will prompt you to create a new file with a name. After creating the file, you can edit it to add new matching options and the algorithm for testing matches.
Create a Custom Rule Tile script by going to __Assets > Create > Custom Rule Tile Script__. Name the newly created file when prompted. After creating the file, you can edit it to add new matching options and custom algorithms for testing matches.

### Examples

- Custom Attributes:
- Custom properties:

```csharp
public class MyTile : RuleTile {
Expand All @@ -29,7 +29,7 @@ public class MyTile : RuleTile {
}
```

- Custom Rules:
- Custom rules:

```csharp
public class MyTile : RuleTile<MyTile.Neighbor> {
Expand All @@ -47,7 +47,7 @@ public class MyTile : RuleTile<MyTile.Neighbor> {
}
```

- Expansion Rules
- Expansion rules

```csharp
public class MyTile : RuleTile<MyTile.Neighbor> {
Expand Down
18 changes: 12 additions & 6 deletions Documentation~/GameObjectBrush.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
# GameObject Brush

This Brush instances, places and manipulates GameObjects onto the scene. Use this as an example to create brushes which targets objects other than tiles for manipulation.
This Brush instances, places and manipulates GameObjects onto the Scene. Use this Brush as an example for creating custom Brushes which can target and manipulate other GameObjects beside Tiles.

### Usage
## Usage

To pick GameObjects, change to the Pick tool and pick GameObjects from the Scene. Note that the GameObjects must be a child of the active Grid.
First select the GameObject Brush from the Brush drop-down menu. With the Brush selected, then select the [Picker Tool](https://docs.unity3d.com/Manual/Tilemap-Painting.html#Picker) from the [Tile Palette](https://docs.unity3d.com/Manual/Tilemap-Painting.html) toolbar. Use the [Select Tool](https://docs.unity3d.com/Manual/Tilemap-Painting.html#Select) to select GameObjects from the Scene that you want the GameObject Brush to paint with. Note that these GameObjects must be a child of the active Grid to be selectable with this Brush.

When painting with the GameObject Brush, the GameObject Brush will instantiate GameObjects picked onto the Scene.
When painting with the GameObject Brush, the Brush will instantiate GameObjects picked onto the Scene.

![Scene View with GameObject Brush](images/GameObjectBrush.png)

### Implementation
## Implementation

The GameObjectBrush inherits from the GridBrush. It overrides the Paint method to paint a GameObject. It overrides the Erase method to be able to erase the GameObjects from the Scene. It overrides the BoxFill method to paint a GameObject in each cell defined by the Box tool. It overrides the Move methods to be able to move GameObjects in the Scene. It overrides the Flip methods to be able to flip GameObjects in the picked selection.
The GameObjectBrush inherits from the GridBrush and overrides several methods when implemented. The following methods are overridden:

- It overrides the `Paint` method to paint a GameObject.
- It overrides the `Erase` method to erase the GameObjects from the Scene.
- It overrides the `BoxFill` method to paint a GameObject in each cell defined by the [Box Tool](https://docs.unity3d.com/Manual/Tilemap-Painting.html#Rec).
- It overrides the `Move` methods to move GameObjects in the Scene.
- It overrides the `Flip` methods to flip GameObjects in the picked selection.
18 changes: 5 additions & 13 deletions Documentation~/GridInformation.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
# Grid Information

A simple Component that stores and provides information based on Grid positions and keywords.
This is a simple component that stores and provides information based on Grid positions and keywords.

## Usage


### Usage

Add this Component to a GameObject with a GridLayout Component.



To store information on to the GridInformation Component, use the following APIs:
Add this Component to a GameObject with a Grid component. To store information on to the Grid Information component, use the following APIs:

```C#
public bool SetPositionProperty(Vector3Int position, String name, int positionProperty)
Expand All @@ -28,7 +22,7 @@ public bool SetPositionProperty(Vector3Int position, String name, Color position



To get information from the GridInformation Component, use the following APIs:
To retrieve information from the Grid Information component, use the following APIs:

```C#
public T GetPositionProperty<T>(Vector3Int position, String name, T defaultValue) where T : UnityEngine.Object
Expand All @@ -44,6 +38,4 @@ public double GetPositionProperty(Vector3Int position, String name, double defau
public Color GetPositionProperty(Vector3Int position, String name, Color defaultValue)
```



You can use this in combination with Scriptable Tiles to get the right Tile Data when laying out your Tilemap.
You can use this in combination with [Scriptable Tiles](https://docs.unity3d.com/Manual/Tilemap-ScriptableTiles.html) to get the right [TileData](https://docs.unity3d.com/Manual/Tilemap-ScriptableTiles-TileData.html) when creating the layout of your Tilemap.
16 changes: 8 additions & 8 deletions Documentation~/GroupBrush.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# Group Brush

This Brush helps to pick Tiles which are grouped together by position. Gaps can be set to identify if Tiles belong to a Group. Limits can be set to ensure that an over-sized Group will not be picked. Use this as an example to create brushes that have the ability to choose and pick whichever Tiles it is interested in.
This Brush picks Tiles which are grouped together according to their position and its set properties. Set the __Gap__ value to identify which Tiles belong to the group, and set the __Limit__ value to ensure that the picked group remains within the desired size. Use this Brush as an example to create your own Brushes that can choose and pick specific Tiles

### Properties
## Properties

| Property | Function |
| --------- | ------------------------------------------------------------ |
| __Gap__ | The gap in cell count before stopping to consider a Tile in a Group |
| __Limit__ | The count in cells beyond the initial position before stopping to consider a Tile in a Group |
| __Gap__ | This value represents the minimum number of cells that must be in between picked Tiles. Only Tiles that are at least this many cells apart are picked by the Brush and placed in the group. Set this value to 0 to pick up all Tiles that are directly adjacent to each other in the group. |
| __Limit__ | This value represents the maximum number of cells around the initial picked position. Only Tiles within this range of cells are picked by the Brush and placed in the group. |

### Usage
## Usage

To select a group of Tiles, select the Pick Tool and pick a position on the Tilemap. The GroupBrush will select a group of Tiles based on its properties and create a Group.
Select the Group Brush, and use the [Picker Tool](https://docs.unity3d.com/Manual/Tilemap-Painting.html#Picker) and pick a position on the Tilemap. The Group Brush selects a group of Tiles based on its set properties and creates a Group.

![Scene View with Group Brush](images/GroupBrush.png)

### Implementation
## Implementation

The GroupBrush inherits from the GridBrush. It overrides the Pick method to pick a group of Tiles based on their position.
The Group Brush inherits from the Grid Brush. It overrides the `Pick` method when picking a group of Tiles based on their position and its set properties.
Loading

0 comments on commit 6cb45d1

Please sign in to comment.