using System;
using UnityEngine.Scripting.APIUpdating;
namespace UnityEngine.Perception.Randomization.Parameters
{
///
/// Numeric parameters use samplers to generate randomized structs
///
/// The sample type of the parameter
[Serializable]
[MovedFrom("UnityEngine.Experimental.Perception.Randomization.Parameters")]
public abstract class NumericParameter : Parameter where T : struct
{
///
/// The sample type of parameter
///
public sealed override Type sampleType => typeof(T);
///
/// Generates one parameter sample
///
/// The generated sample
public abstract T Sample();
///
/// Generates a generic sample
///
/// The generated sample
public override object GenericSample()
{
return Sample();
}
///
/// Validate the settings of this parameter
///
public override void Validate()
{
base.Validate();
foreach (var sampler in samplers)
sampler.Validate();
}
}
}