docs.unity3d.com
    Show / Hide Table of Contents

    Class UniformSampler

    Returns uniformly distributed random values within a designated range.

    Inheritance
    Object
    UniformSampler
    Namespace: UnityEngine.Perception.Randomization.Samplers
    Syntax
    public class UniformSampler : object, ISampler

    Constructors

    UniformSampler()

    Constructs a UniformSampler

    Declaration
    public UniformSampler()

    UniformSampler(Single, Single, Boolean, Single, Single)

    Constructs a new uniform distribution sampler

    Declaration
    public UniformSampler(float min, float max, bool shouldCheckValidRange = false, float minAllowed = null, float maxAllowed = null)
    Parameters
    Type Name Description
    Single min

    The smallest value contained within the range

    Single max

    The largest value contained within the range

    Boolean shouldCheckValidRange

    Whether the provided minAllowed and maxAllowed values should be used to validate the range provided with and

    Single minAllowed

    The smallest min value allowed for this range

    Single maxAllowed

    The largest max value allowed for this range

    Fields

    range

    A range bounding the values generated by this sampler

    Declaration
    public FloatRange range
    Field Value
    Type Description
    FloatRange

    Properties

    maxAllowed

    The largest value this sampler should output

    Declaration
    public float maxAllowed { get; set; }
    Property Value
    Type Description
    Single
    Implements
    ISampler.maxAllowed

    minAllowed

    The smallest value this sampler should output

    Declaration
    public float minAllowed { get; set; }
    Property Value
    Type Description
    Single
    Implements
    ISampler.minAllowed

    shouldCheckValidRange

    Whether the provided minAllowed and maxAllowed values should be used to validate this sampler.

    Declaration
    public bool shouldCheckValidRange { get; set; }
    Property Value
    Type Description
    Boolean
    Implements
    ISampler.shouldCheckValidRange

    Methods

    CheckAgainstValidRange()

    Declaration
    public void CheckAgainstValidRange()
    Implements
    ISampler.CheckAgainstValidRange()

    Sample()

    Generates one sample

    Declaration
    public float Sample()
    Returns
    Type Description
    Single

    The generated sample

    Implements
    ISampler.Sample()

    Validate()

    Validates that the sampler is configured properly

    Declaration
    public void Validate()
    Implements
    ISampler.Validate()
    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023