Demote Unity config MessagePack metadata
This commit is contained in:
parent
a9f10f5646
commit
64e596d92d
10 changed files with 84 additions and 106 deletions
|
|
@ -5,35 +5,34 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using MessagePack;
|
||||
using Unity.Mathematics;
|
||||
using static Unity.Mathematics.math;
|
||||
|
||||
[Serializable, MessagePackObject]
|
||||
[Serializable]
|
||||
public class ExponentialCurve
|
||||
{
|
||||
[Key(0), Inspectable]
|
||||
[Inspectable]
|
||||
public float Exponent;
|
||||
|
||||
[Key(1), Inspectable]
|
||||
[Inspectable]
|
||||
public float Multiplier;
|
||||
|
||||
[Key(2), Inspectable]
|
||||
[Inspectable]
|
||||
public float Constant;
|
||||
|
||||
public float Evaluate(float value) => Multiplier * pow(value, Exponent) + Constant;
|
||||
}
|
||||
|
||||
[Serializable, MessagePackObject]
|
||||
[Serializable]
|
||||
public class ExponentialLerp
|
||||
{
|
||||
[Key(0), Inspectable]
|
||||
[Inspectable]
|
||||
public float Exponent;
|
||||
|
||||
[Key(1), Inspectable]
|
||||
[Inspectable]
|
||||
public float Minimum;
|
||||
|
||||
[Key(2), Inspectable]
|
||||
[Inspectable]
|
||||
public float Maximum;
|
||||
|
||||
public float Evaluate(float value) => Minimum + pow(saturate(value), Exponent) * (Maximum - Minimum);
|
||||
|
|
|
|||
Loading…
Reference in a new issue