Class VolumeManager
A global manager that tracks all the Volumes in the currently loaded Scenes and does all the interpolation work.
Namespace: UnityEngine.Rendering
Syntax
public sealed class VolumeManager : object
Properties
baseComponentTypeArray
Declaration
public Type[] baseComponentTypeArray { get; }
Property Value
Type | Description |
---|---|
Type[] |
baseComponentTypes
The current list of all available types that derive from VolumeComponent.
Declaration
public IEnumerable<Type> baseComponentTypes { get; }
Property Value
Type | Description |
---|---|
IEnumerable<Type> |
instance
The current singleton instance of VolumeManager.
Declaration
public static VolumeManager instance { get; }
Property Value
Type | Description |
---|---|
VolumeManager |
stack
A reference to the main VolumeStack.
Declaration
public VolumeStack stack { get; set; }
Property Value
Type | Description |
---|---|
VolumeStack |
See Also
Methods
CheckBaseTypes()
Checks the state of the base type library. This is only used in the editor to handle entering and exiting of play mode and domain reload.
Declaration
public void CheckBaseTypes()
CheckStack(VolumeStack)
Checks the state of a given stack. This is only used in the editor to handle entering and exiting of play mode and domain reload.
Declaration
public void CheckStack(VolumeStack stack)
Parameters
Type | Name | Description |
---|---|---|
VolumeStack | stack | The stack to check. |
CreateStack()
Creates and returns a new VolumeStack to use when you need to store the result of the Volume blending pass in a separate stack.
Declaration
public VolumeStack CreateStack()
Returns
Type | Description |
---|---|
VolumeStack |
See Also
DestroyStack(VolumeStack)
Destroy a Volume Stack
Declaration
public void DestroyStack(VolumeStack stack)
Parameters
Type | Name | Description |
---|---|---|
VolumeStack | stack | Volume Stack that needs to be destroyed. |
GetVolumes(LayerMask)
Get all volumes on a given layer mask sorted by influence.
Declaration
public Volume[] GetVolumes(LayerMask layerMask)
Parameters
Type | Name | Description |
---|---|---|
LayerMask | layerMask | The LayerMask that Unity uses to filter Volumes that it should consider. |
Returns
Type | Description |
---|---|
Volume[] | An array of volume. |
IsComponentActiveInMask<T>(LayerMask)
Checks if a VolumeComponent is active in a given LayerMask.
Declaration
public bool IsComponentActiveInMask<T>(LayerMask layerMask)
where T : VolumeComponent
Parameters
Type | Name | Description |
---|---|---|
LayerMask | layerMask | The LayerMask to check against |
Returns
Type | Description |
---|---|
Boolean |
|
Type Parameters
Name | Description |
---|---|
T | A type derived from VolumeComponent |
Register(Volume, Int32)
Registers a new Volume in the manager. Unity does this automatically when a new Volume is enabled, or its layer changes, but you can use this function to force-register a Volume that is currently disabled.
Declaration
public void Register(Volume volume, int layer)
Parameters
Type | Name | Description |
---|---|---|
Volume | volume | The volume to register. |
Int32 | layer | The LayerMask that this volume is in. |
See Also
ResetMainStack()
Resets the main stack to be the default one. Call this function if you've assigned the main stack to something other than the default one.
Declaration
public void ResetMainStack()
Unregister(Volume, Int32)
Unregisters a Volume from the manager. Unity does this automatically when a Volume is disabled or goes out of scope, but you can use this function to force-unregister a Volume that you added manually while it was disabled.
Declaration
public void Unregister(Volume volume, int layer)
Parameters
Type | Name | Description |
---|---|---|
Volume | volume | The Volume to unregister. |
Int32 | layer | The LayerMask that this Volume is in. |
See Also
Update(Transform, LayerMask)
Updates the global state of the Volume manager. Unity usually calls this once per Camera in the Update loop before rendering happens.
Declaration
public void Update(Transform trigger, LayerMask layerMask)
Parameters
Type | Name | Description |
---|---|---|
Transform | trigger | A reference Transform to consider for positional Volume blending |
LayerMask | layerMask | The LayerMask that the Volume manager uses to filter Volumes that it should consider for blending. |
Update(VolumeStack, Transform, LayerMask)
Updates the Volume manager and stores the result in a custom VolumeStack.
Declaration
public void Update(VolumeStack stack, Transform trigger, LayerMask layerMask)
Parameters
Type | Name | Description |
---|---|---|
VolumeStack | stack | The stack to store the blending result into. |
Transform | trigger | A reference Transform to consider for positional Volume blending. |
LayerMask | layerMask | The LayerMask that Unity uses to filter Volumes that it should consider for blending. |