Restore the stable legacy Unity project
This commit is contained in:
parent
56a156ee87
commit
7006a6b0dd
2070 changed files with 180490 additions and 169303 deletions
|
|
@ -5,28 +5,37 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using static CultMath.math;
|
||||
using MessagePack;
|
||||
using Newtonsoft.Json;
|
||||
using Unity.Mathematics;
|
||||
using static Unity.Mathematics.math;
|
||||
|
||||
[Serializable]
|
||||
[Serializable, MessagePackObject, JsonObject]
|
||||
public class ExponentialCurve
|
||||
{
|
||||
[JsonProperty("exponent"), Key(0), Inspectable]
|
||||
public float Exponent;
|
||||
|
||||
|
||||
[JsonProperty("multiplier"), Key(1), Inspectable]
|
||||
public float Multiplier;
|
||||
|
||||
|
||||
[JsonProperty("constant"), Key(2), Inspectable]
|
||||
public float Constant;
|
||||
|
||||
|
||||
public float Evaluate(float value) => Multiplier * pow(value, Exponent) + Constant;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
[Serializable, MessagePackObject, JsonObject]
|
||||
public class ExponentialLerp
|
||||
{
|
||||
[JsonProperty("exponent"), Key(0), Inspectable]
|
||||
public float Exponent;
|
||||
|
||||
|
||||
[JsonProperty("max"), Key(1), Inspectable]
|
||||
public float Minimum;
|
||||
|
||||
|
||||
[JsonProperty("min"), Key(2), Inspectable]
|
||||
public float Maximum;
|
||||
|
||||
|
||||
public float Evaluate(float value) => Minimum + pow(saturate(value), Exponent) * (Maximum - Minimum);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue