浏览代码

Added code highlighting

/main
GitHub 4 年前
当前提交
0c53171c
共有 1 个文件被更改,包括 5 次插入5 次删除
  1. 10
      com.unity.perception/Documentation~/Tutorial/Phase2.md

10
com.unity.perception/Documentation~/Tutorial/Phase2.md


* **Action**: Remove the contents of the class and copy/paste the code below:
```
```C#
using System;
using UnityEngine;
using UnityEngine.Experimental.Perception.Randomization.Parameters;

* **Action**: Open `MyLightRandomizerTag.cs` and replace its contents with the code below:
```
```C#
using UnityEngine;
using UnityEngine.Experimental.Perception.Randomization.Randomizers;

* **Action**: Inside the code block that intensity was previously applied, add code for sampling color from the above Parameter and applying it:
```
```C#
foreach (var taggedObject in taggedObjects)
{
var light = taggedObject.GetComponent<Light>();

This makes the two lights illuminate the scene from opposing angles, each having a 30-degree angle with the background and foreground planes. Note that the position of Directional Lights in Unity does not affect how they illuminate the scene, so you do not need to use the same position as the screenshot above.
* **Action**: Open `MyLightRandomizerTag.cs` and modify it to match the code below:
```
```C#
using UnityEngine;
using UnityEngine.Experimental.Perception.Randomization.Randomizers;

* **Action**: Open `MyLightRandomizer.cs` and modify it as seen below:
```
```C#
using System;
using UnityEngine;
using UnityEngine.Experimental.Perception.Randomization.Parameters;

正在加载...
取消
保存