change: more alterations to movement, settingvalues, valuegroup, etc.
This commit is contained in:
24
Assets/Scripts/Player/SettingValue.cs
Normal file
24
Assets/Scripts/Player/SettingValue.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
|
||||
[Serializable]
|
||||
public struct SettingValue<T>{
|
||||
public T value;
|
||||
public float smoothing; // Smoothing changes how fast value is changed.
|
||||
public float easing; // Easing changes how fast smoothing is changed, when given a new value.
|
||||
|
||||
public float currentSmoothing; // Actively eased and accessed value
|
||||
public float currentValue; // Actively smoothed and accessed value
|
||||
|
||||
public T refVel; // For use with SmoothDamp
|
||||
|
||||
public SettingValue(T initValue, float defaultEasing = 2f, float defaultSmoothing = 1f){
|
||||
value = initValue;
|
||||
|
||||
easing = defaultEasing;
|
||||
value = default;
|
||||
smoothing = defaultSmoothing;
|
||||
currentSmoothing = 0;
|
||||
currentValue = 0;
|
||||
refVel = default;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user