TopDown Engine
v4.1
|
A class used to control a float in any other class, over time To use it, simply drag a monobehaviour in its target field, pick a control mode (ping pong or random), and tweak the settings More...
Public Types | |
enum | ControlModes { ControlModes.PingPong, ControlModes.Random, ControlModes.OneTime, ControlModes.AudioAnalyzer, ControlModes.ToDestination, ControlModes.Driven } |
the possible control modes More... | |
enum | AudioAnalyzerModes { AudioAnalyzerModes.Beat, AudioAnalyzerModes.NormalizedBufferedBandLevels } |
Public Member Functions | |
virtual bool | FindAttribute (string propertyName) |
Finds an attribute (property or field) on the target object More... | |
virtual void | Initialization () |
Grabs the target property and initializes stuff More... | |
virtual void | SetDrivenLevelAbsolute (float level) |
Sets the level to the value passed in parameters More... | |
virtual void | SetDrivenLevelNormalized (float normalizedLevel, float remapZero, float remapOne) |
Sets the level to the remapped value passed in parameters More... | |
virtual void | OneTime () |
Triggers a one time shake of the float controller More... | |
virtual void | ToDestination () |
Triggers a one time shake of the controller to a specified destination value More... | |
virtual void | Stop () |
Interrupts any tween in progress, and disables itself More... | |
virtual void | FillDropDownList () |
Fills the inspector dropdown with all the possible choices More... | |
virtual void | RestoreInitialValues () |
On restore, we restore our initial state More... | |
Public Attributes | |
MonoBehaviour | TargetObject |
the mono on which the float you want to control is More... | |
ControlModes | ControlMode |
the control mode (ping pong or random) More... | |
bool | AddToInitialValue = false |
whether or not the updated value should be added to the initial one More... | |
bool | UseUnscaledTime = true |
whether or not to use unscaled time More... | |
bool | RevertToInitialValueAfterEnd = true |
whether or not you want to revert to the InitialValue after the control ends More... | |
float | DrivenLevel = 0f |
the value that will be applied to the controlled float in driven mode More... | |
MMTweenType | Curve = new MMTweenType(MMTween.MMTweenCurve.EaseInCubic) |
the curve to apply to the tween More... | |
float | MinValue = 0f |
the minimum value for the ping pong More... | |
float | MaxValue = 5f |
the maximum value for the ping pong More... | |
float | Duration = 1f |
the duration of one ping (or pong) More... | |
float | PingPongPauseDuration = 0f |
the duration (in seconds) between a ping and a pong More... | |
Vector2 | Amplitude = new Vector2(0f,5f) |
the noise amplitude More... | |
Vector2 | Frequency = new Vector2(1f, 1f) |
the noise frequency More... | |
Vector2 | Shift = new Vector2(0f, 1f) |
the noise shift More... | |
bool | RemapNoiseValues = false |
if this is true, will let you remap the noise value (without amplitude) to the bounds you've specified More... | |
float | RemapNoiseZero = 0f |
the value to which to remap the random's zero bound More... | |
float | RemapNoiseOne = 1f |
the value to which to remap the random's one bound More... | |
float | OneTimeDuration = 1f |
the duration of the One Time shake More... | |
float | OneTimeAmplitude = 1f |
the amplitude of the One Time shake (this will be multiplied by the curve's height) More... | |
float | OneTimeRemapMin = 0f |
the low value to remap the normalized curve value to More... | |
float | OneTimeRemapMax = 1f |
the high value to remap the normalized curve value to More... | |
AnimationCurve | OneTimeCurve = new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.5f, 1), new Keyframe(1, 0)) |
the curve to apply to the one time shake More... | |
bool | DisableAfterOneTime |
whether or not this controller should go to sleep after a one time shake More... | |
bool | DisableGameObjectAfterOneTime = false |
whether or not this controller should go back to sleep after a OneTime More... | |
bool | OneTimeButton |
a test button for the one time shake More... | |
float | ToDestinationDuration = 1f |
the duration of the tween to the destination value More... | |
float | ToDestinationValue = 1f |
the value to tween to More... | |
AnimationCurve | ToDestinationCurve = new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.5f, 0.6f), new Keyframe(1f, 1f)) |
the curve to use when tweening a value to destination More... | |
bool | DisableAfterToDestination |
whether or not this controller should go to sleep after a to destination shake More... | |
bool | ToDestinationButton |
a test button for the one time shake More... | |
MMAudioAnalyzer | AudioAnalyzer |
the audio analyzer to read the value on More... | |
AudioAnalyzerModes | AudioAnalyzerMode = AudioAnalyzerModes.Beat |
whether to look at a Beat or at the normalized buffered band levels More... | |
int | BeatID |
the ID of the beat to listen to More... | |
int | NormalizedLevelID = 0 |
when in NormalizedBufferedBandLevels More... | |
float | AudioAnalyzerMultiplier = 1f |
a multiplier to apply to the output beat value More... | |
float | InitialValue |
the initial value of the controlled float More... | |
float | CurrentValue |
the current value of the controlled float More... | |
float | CurrentValueNormalized |
the current value of the controlled float, normalized More... | |
float | PingPong |
internal use only More... | |
MonoAttribute | TargetAttribute |
internal use only More... | |
string[] | AttributeNames |
internal use only More... | |
string | PropertyName |
internal use only More... | |
int | ChoiceIndex |
internal use only More... | |
Static Public Attributes | |
const string | _undefinedString = "<Undefined Attribute>" |
Protected Member Functions | |
virtual void | Awake () |
On start we initialize our controller More... | |
virtual void | OnEnable () |
On enable, grabs the initial value More... | |
virtual float | GetInitialValue () |
Grabs the initial float value More... | |
float | GetDeltaTime () |
Returns the relevant delta time More... | |
float | GetTime () |
Returns the relevant time More... | |
virtual void | Update () |
On Update, we move our value based on the defined settings More... | |
virtual void | OnValidate () |
When the contents of the inspector change, and if the target changed, we grab all its properties and store them More... | |
virtual void | OnDisable () |
On disable we revert to the previous value if needed More... | |
Protected Attributes | |
List< string > | _attributesNamesTempList |
PropertyInfo[] | _propertyReferences |
FieldInfo[] | _fieldReferences |
bool | _attributeFound |
float | _randomAmplitude |
float | _randomFrequency |
float | _randomShift |
float | _elapsedTime = 0f |
bool | _shaking = false |
float | _shakeStartTimestamp = 0f |
float | _remappedTimeSinceStart = 0f |
float | _pingPongDirection = 1f |
float | _lastPingPongPauseAt = 0f |
float | _initialValue = 0f |
MonoBehaviour | _targetObjectLastFrame |
MonoAttribute | _targetAttributeLastFrame |
A class used to control a float in any other class, over time To use it, simply drag a monobehaviour in its target field, pick a control mode (ping pong or random), and tweak the settings
|
strong |
|
protectedvirtual |
On start we initialize our controller
|
virtual |
Fills the inspector dropdown with all the possible choices
|
virtual |
Finds an attribute (property or field) on the target object
propertyName |
|
protected |
Returns the relevant delta time
|
protectedvirtual |
Grabs the initial float value
|
protected |
Returns the relevant time
|
virtual |
Grabs the target property and initializes stuff
|
protectedvirtual |
On disable we revert to the previous value if needed
|
protectedvirtual |
On enable, grabs the initial value
|
virtual |
Triggers a one time shake of the float controller
|
protectedvirtual |
When the contents of the inspector change, and if the target changed, we grab all its properties and store them
|
virtual |
On restore, we restore our initial state
|
virtual |
Sets the level to the value passed in parameters
level |
|
virtual |
Sets the level to the remapped value passed in parameters
normalizedLevel | |
remapZero | |
remapOne |
|
virtual |
Interrupts any tween in progress, and disables itself
|
virtual |
Triggers a one time shake of the controller to a specified destination value
|
protectedvirtual |
On Update, we move our value based on the defined settings
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
static |
bool MoreMountains.Tools.FloatController.AddToInitialValue = false |
whether or not the updated value should be added to the initial one
Vector2 MoreMountains.Tools.FloatController.Amplitude = new Vector2(0f,5f) |
the noise amplitude
string [] MoreMountains.Tools.FloatController.AttributeNames |
internal use only
MMAudioAnalyzer MoreMountains.Tools.FloatController.AudioAnalyzer |
the audio analyzer to read the value on
AudioAnalyzerModes MoreMountains.Tools.FloatController.AudioAnalyzerMode = AudioAnalyzerModes.Beat |
whether to look at a Beat or at the normalized buffered band levels
float MoreMountains.Tools.FloatController.AudioAnalyzerMultiplier = 1f |
a multiplier to apply to the output beat value
int MoreMountains.Tools.FloatController.BeatID |
the ID of the beat to listen to
int MoreMountains.Tools.FloatController.ChoiceIndex |
internal use only
ControlModes MoreMountains.Tools.FloatController.ControlMode |
the control mode (ping pong or random)
float MoreMountains.Tools.FloatController.CurrentValue |
the current value of the controlled float
float MoreMountains.Tools.FloatController.CurrentValueNormalized |
the current value of the controlled float, normalized
MMTweenType MoreMountains.Tools.FloatController.Curve = new MMTweenType(MMTween.MMTweenCurve.EaseInCubic) |
the curve to apply to the tween
bool MoreMountains.Tools.FloatController.DisableAfterOneTime |
whether or not this controller should go to sleep after a one time shake
bool MoreMountains.Tools.FloatController.DisableAfterToDestination |
whether or not this controller should go to sleep after a to destination shake
bool MoreMountains.Tools.FloatController.DisableGameObjectAfterOneTime = false |
whether or not this controller should go back to sleep after a OneTime
float MoreMountains.Tools.FloatController.DrivenLevel = 0f |
the value that will be applied to the controlled float in driven mode
float MoreMountains.Tools.FloatController.Duration = 1f |
the duration of one ping (or pong)
Vector2 MoreMountains.Tools.FloatController.Frequency = new Vector2(1f, 1f) |
the noise frequency
float MoreMountains.Tools.FloatController.InitialValue |
the initial value of the controlled float
float MoreMountains.Tools.FloatController.MaxValue = 5f |
the maximum value for the ping pong
float MoreMountains.Tools.FloatController.MinValue = 0f |
the minimum value for the ping pong
int MoreMountains.Tools.FloatController.NormalizedLevelID = 0 |
when in NormalizedBufferedBandLevels
float MoreMountains.Tools.FloatController.OneTimeAmplitude = 1f |
the amplitude of the One Time shake (this will be multiplied by the curve's height)
bool MoreMountains.Tools.FloatController.OneTimeButton |
a test button for the one time shake
AnimationCurve MoreMountains.Tools.FloatController.OneTimeCurve = new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.5f, 1), new Keyframe(1, 0)) |
the curve to apply to the one time shake
float MoreMountains.Tools.FloatController.OneTimeDuration = 1f |
the duration of the One Time shake
float MoreMountains.Tools.FloatController.OneTimeRemapMax = 1f |
the high value to remap the normalized curve value to
float MoreMountains.Tools.FloatController.OneTimeRemapMin = 0f |
the low value to remap the normalized curve value to
float MoreMountains.Tools.FloatController.PingPong |
internal use only
float MoreMountains.Tools.FloatController.PingPongPauseDuration = 0f |
the duration (in seconds) between a ping and a pong
string MoreMountains.Tools.FloatController.PropertyName |
internal use only
float MoreMountains.Tools.FloatController.RemapNoiseOne = 1f |
the value to which to remap the random's one bound
bool MoreMountains.Tools.FloatController.RemapNoiseValues = false |
if this is true, will let you remap the noise value (without amplitude) to the bounds you've specified
float MoreMountains.Tools.FloatController.RemapNoiseZero = 0f |
the value to which to remap the random's zero bound
bool MoreMountains.Tools.FloatController.RevertToInitialValueAfterEnd = true |
whether or not you want to revert to the InitialValue after the control ends
Vector2 MoreMountains.Tools.FloatController.Shift = new Vector2(0f, 1f) |
the noise shift
MonoAttribute MoreMountains.Tools.FloatController.TargetAttribute |
internal use only
MonoBehaviour MoreMountains.Tools.FloatController.TargetObject |
the mono on which the float you want to control is
bool MoreMountains.Tools.FloatController.ToDestinationButton |
a test button for the one time shake
AnimationCurve MoreMountains.Tools.FloatController.ToDestinationCurve = new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.5f, 0.6f), new Keyframe(1f, 1f)) |
the curve to use when tweening a value to destination
float MoreMountains.Tools.FloatController.ToDestinationDuration = 1f |
the duration of the tween to the destination value
float MoreMountains.Tools.FloatController.ToDestinationValue = 1f |
the value to tween to
bool MoreMountains.Tools.FloatController.UseUnscaledTime = true |
whether or not to use unscaled time