Skip to content

Commit f754346

Browse files
authored
[PPV2] Documentation fixes (#8112)
* DOCG-4786 Fix code sample * DOCG-4713 Fix table formatting
1 parent 4d96d97 commit f754346

File tree

1 file changed

+20
-15
lines changed

1 file changed

+20
-15
lines changed

com.unity.postprocessing/Documentation~/Manipulating-the-Stack.md

+20-15
Original file line numberDiff line numberDiff line change
@@ -7,37 +7,41 @@ This guide explains how to modify a post-processing script to create time-based
77
Use the `QuickVolume` method to quickly spawn new volumes in the scene, to create time-based events or temporary states:
88

99
```csharp
10-
[
1110
public PostProcessVolume QuickVolume(int layer, float priority, params PostProcessEffectSettings[] settings)
12-
]
1311
```
1412
The following example demonstrates how to use a script to create a pulsating vignette effect:
1513

1614
```csharp
17-
[
1815
using UnityEngine;
1916
using UnityEngine.Rendering.PostProcessing;
17+
2018
public class VignettePulse : MonoBehaviour
2119
{
22-
PostProcessVolume m_Volume;
23-
Vignette m_Vignette
24-
void Start()
20+
PostProcessVolume m_Volume;
21+
Vignette m_Vignette;
22+
23+
void Start()
2524
{
2625
// Create an instance of a vignette
27-
m_Vignette = ScriptableObject.CreateInstance<Vignette>();
28-
m_Vignette.enabled.Override(true);
29-
m_Vignette.intensity.Override(1f);
26+
m_Vignette = ScriptableObject.CreateInstance<Vignette>();
27+
m_Vignette.enabled.Override(true);
28+
m_Vignette.intensity.Override(1f);
29+
3030
// Use the QuickVolume method to create a volume with a priority of 100, and assign the vignette to this volume
31-
m_Volume = PostProcessManager.instance.QuickVolume(gameObject.layer, 100f, m_Vignette);
32-
void Update()
31+
m_Volume = PostProcessManager.instance.QuickVolume(gameObject.layer, 100f, m_Vignette);
32+
}
33+
34+
void Update()
3335
{
3436
// Change vignette intensity using a sinus curve
35-
m_Vignette.intensity.value = Mathf.Sin(Time.realtimeSinceStartup);
37+
m_Vignette.intensity.value = Mathf.Sin(Time.realtimeSinceStartup);
3638
}
37-
void OnDestroy()
39+
40+
void OnDestroy()
3841
{
39-
RuntimeUtilities.DestroyVolume(m_Volume, true, true);
42+
RuntimeUtilities.DestroyVolume(m_Volume, true, true);
4043
}
44+
4145
}
4246
```
4347

@@ -92,9 +96,10 @@ The above examples demonstrate how to create new effects and Volumes at runtime,
9296
- You must manually destroy the profile when you don't need it anymore
9397

9498
The `PostProcessProfile` class contains the following utility methods to help you manage assigned effects:
99+
95100
| Utility method | **Description** |
96101
| ------------------------------------------------------------ | ------------------------------------------------------------ |
97-
| [`T AddSettings()`](...api/UnityEngine.Rendering.PostProcessing.PostProcessProfile.html#UnityEngine_Rendering_PostProcessing_PostProcessProfile_AddSettings__1) | Creates, adds and returns a new effect of type `T` to the profile. It throws an exception if it already exist |
102+
| [`T AddSettings()`](api/UnityEngine.Rendering.PostProcessing.PostProcessProfile.html#UnityEngine_Rendering_PostProcessing_PostProcessProfile_AddSettings__1) | Creates, adds and returns a new effect of type `T` to the profile. It throws an exception if it already exist |
98103
| [`PostProcessEffectSettings AddSettings(PostProcessEffectSettings effect)`](api/UnityEngine.Rendering.PostProcessing.PostProcessProfile.html#UnityEngine_Rendering_PostProcessing_PostProcessProfile_AddSettings_UnityEngine_Rendering_PostProcessing_PostProcessEffectSettings_) | Adds and returns an effect that you created to the profile. |
99104
| [`void RemoveSettings()`](api/UnityEngine.Rendering.PostProcessing.PostProcessProfile.html#UnityEngine_Rendering_PostProcessing_PostProcessProfile_RemoveSettings__1) | Removes an effect from the profile. It throws an exception if it doesn't exist. |
100105
| [`bool TryGetSettings(out T outSetting)`](...api/UnityEngine.Rendering.PostProcessing.PostProcessProfile.html#UnityEngine_Rendering_PostProcessing_PostProcessProfile_TryGetSettings__1___0__) | Gets an effect from the profile, returns `true` if it found a profile, or `false` if it did not find a profile. |

0 commit comments

Comments
 (0)