Skip to content

Commit bdcf957

Browse files
authored
some polish
1 parent a08bd26 commit bdcf957

File tree

1 file changed

+11
-10
lines changed
  • com.unity.perception/Documentation~/FAQ

1 file changed

+11
-10
lines changed

com.unity.perception/Documentation~/FAQ/FAQ.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ This page covers a variety of topics, including common questions and issues that
88
<details>
99
<summary><strong>Q: How can I disable or enable labeling on an object at runtime?</strong></summary>
1010
<br>
11+
1112
You can turn labeling on and off on a GameObject by switching the enabled state of its `Labeling` component. For example:
1213

1314
```C#
@@ -22,15 +23,15 @@ This page covers a variety of topics, including common questions and issues that
2223
<details>
2324
<summary><strong>Q: How can I remove or add new labels to objects at runtime?</strong></summary><br>
2425

25-
This can be achieved through modifying the `labels` list of the `Labeling` component. The key is to call `RefreshLabeling` on the component after making any changes to the labels. Example:
26+
This can be achieved through modifying the `labels` list of the `Labeling` component. The key is to call `RefreshLabeling()` on the component after making any changes to the labels. Example:
2627

2728
```C#
2829
var labeling = gameObject.GetComponent<Labeling>();
2930
labeling.labels.Clear();
3031
labeling.labels.Add("new-label");
3132
labeling.RefreshLabeling();
3233
```
33-
Keep in mind that any new label added with this method should already be present in the `LabelConfig` attached to the `Labeler` that is supposed to label this object.
34+
Keep in mind that any new label added with this method should already be present in the Label Config attached to the Labeler that is supposed to label this object.
3435

3536
---
3637
</details>
@@ -47,10 +48,10 @@ Keep in mind that any new label added with this method should already be present
4748
Alternatively, in cases where parts of the surface of the object need to be labeled (e.g. decals on objects), you can add labeled invisible surfaces on top of these sections. These invisible surfaces need to have a fully transparent material. To create an invisible material:
4849

4950
* Create a new material (***Assets -> Create -> Material***) and name it `TransparentMaterial`
50-
* Set the `Surface Type` for the material to `Transparent`, and set the alpha channel of the `Base Map` color to 0.
51-
* For HDRP: In addition to the above, disable `Preserve specular lighting`
51+
* Set the **Surface Type** for the material to **Transparent**, and set the alpha channel of the **Base Map** color to 0.
52+
* For HDRP: In addition to the above, disable **Preserve specular lighting**
5253

53-
An example labeled output for an object with separate labels on inner objects is shown below:
54+
An example labeled output for an object with separate labels on inner objects and decals is shown below:
5455

5556
<p align="center">
5657
<img src="images/inner_labels.gif" width="600"/>
@@ -74,7 +75,7 @@ This is due to a common graphics problem called *z-fighting*. This occurs when t
7475
<summary><strong>Q: How can I have multiple sets of prefabs in a foreground placement Randomizer, and on every Iteration select one from each set?</strong>
7576
</summary><br>
7677

77-
This question is an example of more complex functionality that can be achieved by applying slight modifications to the provided sample Randomizers, or by creating completely custom ones using the powerful Parameters provided in the package.
78+
This question is an example of more complex functionality that can be achieved by applying slight modifications to the provided sample Randomizers, or by creating completely custom ones by extending the `Randomizer` class.
7879

7980
Here, we have a variety of options toward achieving the described outcome. One simple method could be to add several more `GameObjectParameter` fields inside of the provided sample `ForegroundObjectPlacementRandomizer`. Each of these Parameters could hold one of our object lists. Then, on each iteration, we would fetch one prefab from each of the lists using the `Sample()` function of each Parameter.
8081

@@ -93,7 +94,7 @@ This is due to a common graphics problem called *z-fighting*. This occurs when t
9394
}
9495
```
9596

96-
We can now create a cluster asset using the ***Assets -> Create -> Test -> PrefabCluster** menu option and populate its list of prefabs. Each cluster contains one `GameObjectParameter`, which will hold the list of prefabs and provide us with a `Sample()` function.
97+
We can now create a cluster asset using the ***Assets -> Create -> Test -> PrefabCluster*** menu option and populate its list of prefabs. Each cluster contains one `GameObjectParameter`, which will hold the list of prefabs and provide us with a `Sample()` function.
9798

9899
To be able to edit these clusters with the same editor UI available for Randomizers, you will also need to add an empty custom editor for the `PrefabCluster` class that extends our bespoke `ParameterUIElementsEditor` class:
99100

@@ -105,15 +106,15 @@ This is due to a common graphics problem called *z-fighting*. This occurs when t
105106
public class PrefabClusterEditor : ParameterUIElementsEditor { }
106107
```
107108

108-
Note that any editor scripts must be placed inside a folder named "Editor" within your project. "Editor" is a special folder name in Unity that prevents editor code from compiling into a player during the build process. For example, the file path for the `PrefabClusterEditor` script above could be ".../Assets/Scripts/Editor/PrefabClusterEditor".
109+
Note that any editor scripts must be placed inside a folder named "Editor" within your project. "Editor" is a special folder name in Unity that prevents editor code from compiling into a player during the build process. For example, the file path for the `PrefabClusterEditor` script above could be `.../Assets/Scripts/Editor/PrefabClusterEditor`.
109110

110111
The ***Inspector*** view of a prefab cluster asset looks like below:
111112

112113
<p align="center">
113114
<img src="images/prefab_cluster.png" width="400"/>
114115
</p>
115116

116-
Now all that is left is to use our prefab clusters inside a Randomizer. here is some sample code:
117+
Now all that is left is to use our prefab clusters inside a Randomizer. Here is some sample code:
117118

118119
```C#
119120
using System;
@@ -582,4 +583,4 @@ The physics engine needs to catch up with the position and rotation of your obje
582583
One useful resource for humanoid characters and animations is [Mixamo](https://www.mixamo.com/#/?page=1&type=Motion%2CMotionPack).
583584

584585
---
585-
</details>
586+
</details>

0 commit comments

Comments
 (0)