using Newtonsoft.Json; using UnityEngine; namespace NewHorizons.External.Modules.VariableSize { [JsonObject] public class VariableSizeModule { /// /// Scale this module over time /// public TimeValuePair[] curve; public AnimationCurve GetAnimationCurve(float size = 1f) { var curve = new AnimationCurve(); if (this.curve != null) foreach (var pair in this.curve) curve.AddKey(new Keyframe(pair.time, size * pair.value)); return curve; } [JsonObject] public class TimeValuePair { /// /// A specific point in time /// public float time; /// /// The value for this point in time /// public float value; } } }