Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
## [1.6.3-preview] - 2020-11-26
### Changed
- 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)
  • Loading branch information
Unity Technologies committed Nov 26, 2020
1 parent f107258 commit 44bd76f
Show file tree
Hide file tree
Showing 28 changed files with 395 additions and 140 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@ 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.3-preview] - 2020-11-26
### Changed
- 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)

## [1.6.2-preview] - 2020-09-25
### Changed
- [RuleTile/RuleOverrideTile/AdvancedRuleOverrideTile] Renamed Game Object to GameObject
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)
22 changes: 10 additions & 12 deletions Documentation~/AnimatedTile.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,25 @@
# Animated Tile

__Contribution by:__ [MahdiMahzuni](https://github.com/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. |
| __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 Shape generated by the Tile. |
| __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).
2 changes: 1 addition & 1 deletion Documentation~/Brushes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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 __Scriptables Brushes__ which can help save time when designing your Tilemap:
Here are some implementations of **Scriptable Brushes** which can help save time when designing your Tilemap:

- [GameObject Brush](GameObjectBrush.md)
- [Random Brush](RandomBrush.md)
Expand Down
2 changes: 1 addition & 1 deletion Documentation~/Contributors.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Thank you to all who have contributed to this repository!
- [janissimsons](https://github.com/janissimsons)
- [distantcam](https://github.com/distantcam)
- [Pepperized](https://github.com/Pepperized)
- [MahdiMahzuni](https://github.com/MahdiMahzuni)
- MahdiMahzuni
- [DreadBoy](https://github.com/DreadBoy)
- [DoctorShinobi](https://github.com/DoctorShinobi)
- [CraigGraff](https://github.com/CraigGraff)
Expand Down
6 changes: 3 additions & 3 deletions Documentation~/CustomRulesForRuleTile.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

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

This template script is for creating new custom [Rule Tiles](RuleTile.md) with different matching options that differ from the [default options](RuleTile.md#Usage) of ‘Don't Care’, ‘This and Not This’. 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__.

## Template features

- Inheritable RuleTile.
- Inheritable Rule Tile.
- Customizable properties.
- Expand or rewrite both neighbor Rules and the GUI display.
- 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.
Expand Down
10 changes: 5 additions & 5 deletions Documentation~/GameObjectBrush.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ When painting with the GameObject Brush, the Brush will instantiate GameObjects

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.
- 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.
4 changes: 2 additions & 2 deletions Documentation~/GridInformation.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Grid Information

This is 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

Expand All @@ -22,7 +22,7 @@ public bool SetPositionProperty(Vector3Int position, String name, Color position



To get information from the Grid Information 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 Down
8 changes: 4 additions & 4 deletions Documentation~/GroupBrush.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Group Brush

Use this Brush to pick Tiles which are grouped together by position. Set the __Gap__ value to identify which Tiles to a 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 Brushes that have the ability to choose and pick specific Tiles
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

| 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

Expand All @@ -17,4 +17,4 @@ Select the Group Brush, and use the [Picker Tool](https://docs.unity3d.com/Manua

## Implementation

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.
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.
10 changes: 5 additions & 5 deletions Documentation~/LineBrush.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@

__Contribution by :__ [CraigGraff](https://github.com/CraigGraff)

This Brush draws a line of Tiles onto a Tilemap. With this Brush selected, click once to set the starting point of the line and click again to set the ending point of the line. This Brush then draws a line of Tiles between the two points.
This Brush draws a line of Tiles onto a Tilemap. With this Brush selected, click once to set the starting point of the line and click again at another position to set the ending point of the line. This Brush then draws a line of Tiles between the two points.

Use this as an example to modify Brush painting behavior to make painting more efficient.
Use this as an example to create custom Brush behavior to make painting more efficient.

## Properties

| Property | Function |
| --------------------- | ------------------------------------------------------------ |
| __Line Start Active__ | Indicates whether the Line Brush has started drawing a line. |
| __Fill Gaps__ | Ensures that there are orthogonal connections of Tiles from the start of the line to the end. |
| __Fill Gaps__ | Ensures that there are orthogonal connections between all Tiles that connect the start and end of the line. |
| __Line Start__ | The current starting point of the line. |

## Usage
Select the Line Brush, then click once on the Tilemap to set the starting point of the line, then click a second time to set the ending point of the line. The Brush then draws the line of Tiles between the two set points. When the Line Brush is active, a blue outline will indicate the starting point of the line.
Select the Line Brush, then click once on a cell of the Tilemap to set the starting point of the line, then click on a second cell to set the ending point of the line. The Brush then draws the line of Tiles between the two set points. When the Line Brush is active, a blue outline will indicate the starting point of the line.

![Scene View with Line Brush](images/LineBrush.png)

Expand All @@ -25,4 +25,4 @@ To have Tiles which are orthogonally connected from start to end, enable the __F

## Implementation

The Line Brush inherits from the Grid Brush and overrides the Paint method to implement the line painting functionality.
The Line Brush inherits from the Grid Brush and overrides the `Paint` method to implement the line painting functionality.
14 changes: 7 additions & 7 deletions Documentation~/RandomBrush.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
# Random Brush

This Brush places random Tiles onto a Tilemap. Use this as an example to create Brushes which store specific data per Brush, and to make Brushes which randomize behavior.
This Brush places random Tiles onto a Tilemap by selecting from defined **Tile Sets** while painting onto the the Tilemap. Use this as an example to create custom Brushes which store specific data per Brush, and to make Brushes with randomized painting behavior.

## Properties

| Property | Function |
| ----------------------- | ------------------------------------------------------------ |
| __Pick Random Tiles__ | Enable this property to pick the Tiles from the current selection as a random Tile Set. |
| __Add To Random Tiles__ | Enable this property to add the picked Tile Sets to existing Tile Sets instead of replacing them. |
| __Tile Set Size__ | The size of each Tile Set. |
| __Tile Set Size__ | Set the size of the Tile Set that is painted by this Brush. |
| __Number of Tiles__ | The number of Tile Sets. |
| __Tile Set__ | The Tile Set to randomize from |
| __Tiles__ | The Tiles in the Tile Set. |

## Usage

To create Tile Sets, first define the size of the Tile Set you want to paint by setting a value on the Tile Set Size property. Then you can add Tile Sets manually with the Brush Editor or select them from an existing Tile Palette.
To create a **Tile Set**, first define the size of the Tile Set you want to paint by setting its size values in the **Tile Set Size** property. Then you can add Tile Sets manually with the Brush Editor or select them from an existing Tile Palette.

To select Tile Sets from an existing Tile Palette, enable the __Pick Random Tiles__ property and select the Tile Sets using the [Picker Tool](https://docs.unity3d.com/Manual/Tilemap-Painting.html#Picker). This will create a Tile Set, or multiple Sets if the picked size is larger than the Tile Set Size property. Enable the __Add To Random Tiles__ property to add a picked selection of Tiles onto new or existing Tile Sets instead of replacing them.
To select Tile Sets from an existing [Tile Palette](https://docs.unity3d.com/Manual/Tilemap-Palette.html), enable the __Pick Random Tiles__ property and select the Tile Sets using the [Picker Tool](https://docs.unity3d.com/Manual/Tilemap-Painting.html#Picker). This will create a Tile Set, or multiple Sets if the picked size is larger than the size set in the **Tile Set Size** property. Enable the __Add To Random Tiles__ property to add a picked selection of Tiles onto new or existing Tile Sets instead of replacing them.

![Brush Editor with Random Brush](images/RandomBrushTileSet.png)
![Brush Editor with Random Brush](images/RandomBrushTileSet.png)</br> In this example, 3 Tile Sets of 1x2 are created.

When painting with the Random Brush, the Random Brush will randomly pick from the available Tile Sets while filling Tiles.
When painting with the Random Brush, the Random Brush will randomly pick from the available Tile Sets while painting the Tiles.

![Scene View with Random Brush](images/RandomBrush.png)

## Implementation

The RandomBrush inherits from the GridBrush and implements the following overrides:
The Random Brush inherits from the Grid Brush and implements the following overrides:

- It overrides the Paint method to paint random selections of Tiles from chosen Tile Sets.
- It overrides the Pick method to be able to pick selections of Tiles for the random Tile Sets.
Loading

0 comments on commit 44bd76f

Please sign in to comment.