Class Volume
A generic Volume component holding a VolumeProfile.
Implements
Inherited Members
Namespace: UnityEngine.Rendering
Assembly: Unity.RenderPipelines.Core.Runtime.dll
Syntax
[CoreRPHelpURL("Volumes", "com.unity.render-pipelines.high-definition")]
[ExecuteAlways]
[AddComponentMenu("Miscellaneous/Volume")]
public class Volume : MonoBehaviour, IVolume
Fields
blendDistance
The outer distance to start blending from. A value of 0 means no blending and Unity applies the Volume overrides immediately upon entry.
Declaration
[Tooltip("Sets the outer distance to start blending from. A value of 0 means no blending and Unity applies the Volume overrides immediately upon entry.")]
public float blendDistance
Field Value
Type | Description |
---|---|
float |
priority
A value which determines which Volume is being used when Volumes have an equal amount of influence on the Scene. Volumes with a higher priority will override lower ones.
Declaration
[Tooltip("A value which determines which Volume is being used when Volumes have an equal amount of influence on the Scene. Volumes with a higher priority will override lower ones.")]
[Delayed]
public float priority
Field Value
Type | Description |
---|---|
float |
sharedProfile
The shared Profile that this Volume uses.
Modifying sharedProfile
changes every Volumes that uses this Profile and also changes
the Profile settings stored in the Project.
Declaration
public VolumeProfile sharedProfile
Field Value
Type | Description |
---|---|
VolumeProfile |
Remarks
You should not modify Profiles that sharedProfile
returns. If you want
to modify the Profile of a Volume, use profile instead.
See Also
weight
The total weight of this volume in the Scene. 0 means no effect and 1 means full effect.
Declaration
[Range(0, 1)]
[Tooltip("Sets the total weight of this Volume in the Scene. 0 means no effect and 1 means full effect.")]
public float weight
Field Value
Type | Description |
---|---|
float |
Properties
colliders
The colliders of the volume if isGlobal is false
Declaration
public List<Collider> colliders { get; }
Property Value
Type | Description |
---|---|
List<Collider> |
isGlobal
Specifies whether to apply the Volume to the entire Scene or not.
Declaration
[Tooltip("When enabled, the Volume is applied to the entire Scene.")]
public bool isGlobal { get; set; }
Property Value
Type | Description |
---|---|
bool |
profile
Gets the first instantiated VolumeProfile assigned to the Volume.
Modifying profile
changes the Profile for this Volume only. If another Volume
uses the same Profile, this clones the shared Profile and starts using it from now on.
Declaration
public VolumeProfile profile { get; set; }
Property Value
Type | Description |
---|---|
VolumeProfile |
Remarks
This property automatically instantiates the Profile and make it unique to this Volume so you can safely edit it via scripting at runtime without changing the original Asset in the Project. Note that if you pass your own Profile, you must destroy it when you finish using it.
See Also
Methods
HasInstantiatedProfile()
Checks if the Volume has an instantiated Profile or if it uses a shared Profile.
Declaration
public bool HasInstantiatedProfile()
Returns
Type | Description |
---|---|
bool |
|