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