public void ExposeData() { Scribe_Values.Look(ref value, "value"); Scribe_Values.Look(ref finished, "finished", true); Scribe_Values.Look(ref respectTimeScale, "respectTimeScale", true); Scribe_Values.Look(ref elapsedTime, "elapsedTime"); Scribe_Values.Look(ref initialValue, "initialValue"); Scribe_Values.Look(ref targetValue, "targetValue"); Scribe_Values.Look(ref duration, "duration"); Scribe_Values.Look(ref duration, "duration"); if (Scribe.mode == LoadSaveMode.Saving) { curveName = curve?.Method.Name; } Scribe_Values.Look(ref curveName, "curveName"); if (Scribe.mode == LoadSaveMode.LoadingVars) { if (!curveName.NullOrEmpty()) { var curveMethod = typeof(InterpolationCurves).GetMethod(curveName, HugsLibUtility.AllBindingFlags); if (curveMethod == null) { MapRerollController.Instance.Logger.Error("Failed to load interpolation curve: " + curveName); } else { curve = (InterpolationCurves.Curve)Delegate.CreateDelegate(typeof(InterpolationCurves.Curve), curveMethod, true); } } } }
public ValueInterpolator StartInterpolation(float finalValue, float interpolationDuration, CurveType curveType) { initialValue = value; elapsedTime = 0; targetValue = finalValue; duration = interpolationDuration; curve = InterpolationCurves.AllCurves[curveType]; finished = false; return(this); }
public ValueInterpolator StartInterpolation(float finalValue, float interpolationDuration, InterpolationCurves.Curve curveDelegate) { initialValue = value; elapsedTime = 0; targetValue = finalValue; duration = interpolationDuration; curve = curveDelegate; finished = false; return(this); }
private void OnZoomInterpolatorFinished(ValueInterpolator interpolator, float finalValue, float interpolationDuration, InterpolationCurves.Curve interpolationCurve) { zoomedIn = finalValue == 1; }
private void OnPageFlipFinished(ValueInterpolator interpolator, float finalValue, float interpolationDuration, InterpolationCurves.Curve interpolationCurve) { interpolator.value = finalValue; outgoingPage = -1; }