docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class VolumeEffect

    A helper class used to generate post-processing effects for the VolumeRandomizer.

    Inheritance
    object
    VolumeEffect
    Implements
    IDisposable
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.Perception.Randomization
    Assembly: Unity.Perception.Runtime.dll
    Syntax
    [Serializable]
    [MovedFrom("UnityEngine.Perception.Internal")]
    public abstract class VolumeEffect : IDisposable
    Examples

    UnityEngine.Perception.Randomization.VolumeEffects.BloomEffect, UnityEngine.Perception.Randomization.VolumeEffects.DepthOfFieldEffect, UnityEngine.Perception.Randomization.VolumeEffects.LensDistortionEffect

    Fields

    targetVolume

    The volume whose post-processing effect this randomizer is targeting.

    Declaration
    [HideInInspector]
    public Volume targetVolume
    Field Value
    Type Description
    Volume

    Properties

    displayName

    The effect name displayed in the Inspector UI.

    Declaration
    public abstract string displayName { get; }
    Property Value
    Type Description
    string

    Methods

    DestroyProfile()

    Removes the existing Volume Profile of the targetVolume.

    Declaration
    protected void DestroyProfile()

    Dispose()

    At the end of the scenario, rollback any permanent changes to the scene.

    Declaration
    public abstract void Dispose()

    GetVolumeComponent<T>(ref T)

    Gets the Volume Component in the targetVolumeProfile. If the Volume Component does not exist, it will create one and return a reference to the newly created component.

    Declaration
    protected T GetVolumeComponent<T>(ref T volumeComponent) where T : VolumeComponent
    Parameters
    Type Name Description
    T volumeComponent

    A volume component such as Bloom, Depth of Field, etc.

    Returns
    Type Description
    T

    A volume component from the targetVolumeProfile

    Type Parameters
    Name Description
    T

    A class that inherits from VolumeComponent such as Bloom, DepthOfField

    RandomizeEffect()

    At each iteration, randomize the parameters for the post-processing effect controlled by this VolumeEffect.

    Declaration
    public abstract void RandomizeEffect()

    SetActive(bool)

    A placeholder function to enable or disable the Volume Effect.

    Declaration
    public abstract void SetActive(bool active)
    Parameters
    Type Name Description
    bool active

    Whether the volume randomization is enabled or disabled

    Remarks

    It is up to the child class to define what active or inactive means for the specific Volume Effect.

    SetupEffect()

    At the beginning of the Scenario, set up required information for the Volume Effect to function (such as adding the appropriate UnityEngine.Rendering.VolumeComponent to the targetVolumeProfile)

    Declaration
    public virtual void SetupEffect()

    Implements

    IDisposable
    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)