You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Change PrefabBrushes Erase behaviour with small doc change. (#200)
* fix PrefabBrush's name with naming rule
* update Paint and Eease behaviour for Prefab Brushes
* update doc comment
* update README.md
* changed method name
* added m_EraseAnyObjects to erase not related any game objects
see below conversation
#200 (comment)
* added #pragma warning disable 0649
/// This Brush instances and places a randomly selected Prefabs onto the targeted location and parents the instanced object to the paint target. Use this as an example to quickly place an assorted type of GameObjects onto structured locations.
7
8
/// </summary>
8
-
[CreateAssetMenu(fileName="Prefab Random brush",menuName="2D Extras/Brushes/Prefab Random brush",order=359)]
9
+
[CreateAssetMenu(fileName="New Prefab Random Brush",menuName="2D Extras/Brushes/Prefab Random Brush",order=359)]
9
10
[CustomGridBrush(false,true,false,"Prefab Random Brush")]
10
11
publicclassPrefabRandomBrush:BasePrefabBrush
11
12
{
12
13
privateconstfloatk_PerlinOffset=100000f;
14
+
15
+
#pragma warning disable 0649
13
16
/// <summary>
14
17
/// The selection of Prefabs to paint from
15
18
/// </summary>
16
-
publicGameObject[]m_Prefabs;
19
+
[SerializeField]GameObject[]m_Prefabs;
20
+
17
21
/// <summary>
18
22
/// Factor for distribution of choice of Prefabs to paint
19
23
/// </summary>
20
-
publicfloatm_PerlinScale=0.5f;
24
+
[SerializeField]floatm_PerlinScale=0.5f;
25
+
#pragma warning restore 0649
26
+
21
27
/// <summary>
22
-
/// Paints Prefabs into a given position within the selected layers.
23
-
/// The PrefabBrush overrides this to provide Prefab painting functionality.
28
+
/// If true, erases any GameObjects that are in a given position within the selected layers with Erasing.
29
+
/// Otherwise, erases only GameObjects that are created from owned Prefab in a given position within the selected layers with Erasing.
30
+
/// </summary>
31
+
boolm_EraseAnyObjects;
32
+
33
+
/// <summary>
34
+
/// Paints GameObject from containg Prefabs with randomly into a given position within the selected layers.
35
+
/// The PrefabRandomBrush overrides this to provide Prefab painting functionality.
24
36
/// </summary>
25
37
/// <param name="grid">Grid used for layout.</param>
26
38
/// <param name="brushTarget">Target of the paint operation. By default the currently selected GameObject.</param>
27
39
/// <param name="position">The coordinates of the cell to paint data to.</param>
Copy file name to clipboardExpand all lines: README.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,7 +46,8 @@ Please use the `2017` branch or the `2017` tag for earlier versions of Unity (fr
46
46
-**Coordinate**: 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.
47
47
-**Line**: This Brush helps draw lines of Tiles onto a Tilemap. The first click of the mouse sets the starting point of the line and the second click sets the ending point of the line and draws the lines of Tiles. Use this as an example to modify brush painting behaviour to making painting quicker with less actions.
48
48
-**Random**: This Brush helps to place 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 behaviour.
49
-
-**Prefab**: This Brush instances and places a randomly selected Prefabs onto the targeted location and parents the instanced object to the paint target. Use this as an example to quickly place an assorted type of GameObjects onto structured locations.
49
+
-**Prefab**: This Brush instances and places the containing Prefab onto the targeted location and parents the instanced object to the paint target. Use this as an example to quickly place an assorted type of GameObjects onto structured locations.
50
+
-**PrefabRandom**: This Brush instances and places a randomly selected Prefabs onto the targeted location and parents the instanced object to the paint target. Use this as an example to quickly place an assorted type of GameObjects onto structured locations.
50
51
-**GameObject**: 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.
51
52
-**TintBrush**: Brush to edit Tilemap per-cell tint colors.
52
53
-**TintBrushSmooth**: Advanced tint brush for interpolated tint color per-cell. Requires the use of custom shader (see TintedTilemap.shader) and helper component TileTextureGenerator.
0 commit comments