45 lines
1.0 KiB
C#
45 lines
1.0 KiB
C#
using System;
|
|
|
|
namespace UnityEngine.AzureSky
|
|
{
|
|
[Serializable]
|
|
public sealed class AzureProfileProperty
|
|
{
|
|
public AzureOutputType outputType;
|
|
|
|
public AzureOutputFloatType floatPropertyType;
|
|
|
|
public AzureOutputColorType colorPropertyType;
|
|
|
|
public float slider = 0.5f;
|
|
|
|
public Color colorField = Color.white;
|
|
|
|
public AnimationCurve timelineBasedCurve = AnimationCurve.Linear(0f, 0.5f, 24f, 0.5f);
|
|
|
|
public AnimationCurve rampCurve = AnimationCurve.Linear(0f, 0f, 1f, 1f);
|
|
|
|
public Gradient timelineBasedGradient = new Gradient();
|
|
|
|
public float GetFloatOutput(float timeOfDay)
|
|
{
|
|
return floatPropertyType switch
|
|
{
|
|
AzureOutputFloatType.Slider => slider,
|
|
AzureOutputFloatType.Curve => timelineBasedCurve.Evaluate(timeOfDay),
|
|
_ => 0f,
|
|
};
|
|
}
|
|
|
|
public Color GetColorOutput(float timeOfDay)
|
|
{
|
|
return colorPropertyType switch
|
|
{
|
|
AzureOutputColorType.ColorField => colorField,
|
|
AzureOutputColorType.Gradient => timelineBasedGradient.Evaluate(timeOfDay / 24f),
|
|
_ => colorField,
|
|
};
|
|
}
|
|
}
|
|
}
|