TopDown Engine
v3.6
|
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 | TargetTypes { TargetTypes.Renderer, TargetTypes.Image, TargetTypes.RawImage, TargetTypes.Text } |
the possible types of targets More... | |
enum | PropertyTypes { PropertyTypes.Bool, PropertyTypes.Float, PropertyTypes.Int, PropertyTypes.Vector, PropertyTypes.Keyword, PropertyTypes.Color } |
the possible types of properties More... | |
enum | ControlModes { ControlModes.PingPong, ControlModes.Random, ControlModes.OneTime, ControlModes.AudioAnalyzer, ControlModes.ToDestination, ControlModes.Driven, ControlModes.Loop } |
the possible control modes More... | |
enum | ColorModes { ColorModes.TwoColors, ColorModes.ColorRamp } |
the possible color modes on which to interpolate colors More... | |
Public Member Functions | |
virtual bool | FindShaderProperty (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 | StoreSpriteRenderer () |
Stores the sprite renderer and a test for it More... | |
virtual void | StoreSpriteRendererTexture () |
Stores the SpriteRenderer's texture if found 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 shader controller More... | |
virtual void | ToDestination () |
Triggers a one time shake of the controller to a specified destination value More... | |
void | SetFromColor (Color newColor) |
Use this method to change the FromColor value More... | |
void | SetToColor (Color newColor) |
Use this method to change the ToColor value More... | |
virtual void | SetRemapOneTimeMin (float newValue) |
Use this method to change the OneTimeRemapMin value More... | |
virtual void | SetRemapOneTimeMax (float newValue) |
Use this method to change the OneTimeRemapMax value More... | |
virtual void | SetToDestinationValue (float newValue) |
Use this method to change the ToDestinationValue More... | |
virtual void | Stop () |
Interrupts any tween in progress, and disables itself More... | |
virtual void | RestoreInitialValues () |
Public Attributes | |
TargetTypes | TargetType = TargetTypes.Renderer |
the type of renderer to pilot More... | |
Renderer | TargetRenderer |
the renderer with the shader you want to control More... | |
int | TargetMaterialID = 0 |
the ID of the material in the Materials array on the target renderer (usually 0) More... | |
Image | TargetImage |
the Image with the shader you want to control More... | |
bool | UseMaterialForRendering = false |
if this is true, the 'materialForRendering' for this Image will be used, instead of the regular material More... | |
RawImage | TargetRawImage |
the RawImage with the shader you want to control More... | |
Text | TargetText |
the Text with the shader you want to control More... | |
bool | CacheMaterial = true |
if this is true, material will be cached on Start More... | |
bool | CreateMaterialInstance = false |
if this is true, an instance of the material will be created on start so that this controller only affects its target More... | |
string | TargetPropertyName |
the EXACT name of the property to affect More... | |
PropertyTypes | PropertyType = PropertyTypes.Float |
the type of the property to affect More... | |
bool | X |
whether or not to affect its x component More... | |
bool | Y |
whether or not to affect its y component More... | |
bool | Z |
whether or not to affect its z component More... | |
bool | W |
whether or not to affect its w component More... | |
ColorModes | ColorMode = ColorModes.TwoColors |
whether to move from a color to another, or to evalute colors on a ramp More... | |
Gradient | ColorRamp |
the ramp along which to lerp when in ramp color mode More... | |
Color | FromColor = Color.black |
the color to lerp from More... | |
Color | ToColor = Color.white |
the color to lerp to 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... | |
bool | UseMaterialPropertyBlocks = false |
if this is true, this component will use material property blocks instead of working on an instance of the material. More... | |
string | SpriteRendererTextureProperty = "_MainTex" |
if using material property blocks on a sprite renderer, you'll want to make sure the sprite texture gets passed to the block when updating it. For that, you need to specify your sprite's material's shader's texture property name. If you're not working with a sprite renderer, you can safely ignore this. More... | |
bool | SafeMode = false |
whether or not to perform extra safety checks (safer, more costly) More... | |
MMTweenType | Curve |
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 = 1f |
the duration of the pause between two ping (or pongs) (in seconds) More... | |
MMTweenType | LoopCurve |
the curve to apply to the tween More... | |
float | LoopStartValue = 0f |
the start value for the loop tween More... | |
float | LoopEndValue = 5f |
the end value for the loop tween More... | |
float | LoopDuration = 1f |
the duration of one loop More... | |
float | LoopPauseDuration = 1f |
the duration of the pause between two loops (in seconds) More... | |
float | DrivenLevel = 0f |
the value that will be applied to the controlled float in driven mode 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 | OneTimeButton |
a test button for the one time shake More... | |
bool | DisableAfterOneTime = false |
whether or not this controller should go back to sleep after a OneTime More... | |
bool | DisableGameObjectAfterOneTime = false |
whether or not this controller should go back to sleep after a OneTime More... | |
bool | GetInitialValueOnOneTime = false |
whether or not to initialize the initial value to the current value on a OneTime play More... | |
MMAudioAnalyzer | AudioAnalyzer |
the bound audio analyzer used to drive this controller More... | |
int | BeatID |
the ID of the selected beat on the analyzer More... | |
float | AudioAnalyzerMultiplier = 1f |
the multiplier to apply to the value out of the analyzer More... | |
float | AudioAnalyzerOffset = 0f |
the offset to apply to the value out of the analyzer More... | |
float | AudioAnalyzerLerp = 60f |
the speed at which to lerp the value More... | |
float | ToDestinationValue = 1f |
the value to go to when in ToDestination mode More... | |
float | ToDestinationDuration = 1f |
the duration of the ToDestination tween More... | |
AnimationCurve | ToDestinationCurve = new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.5f, 0.6f), new Keyframe(1f, 1f)) |
the curve to use to tween to the ToDestination value More... | |
bool | ToDestinationButton |
a test button for the one time shake More... | |
bool | DisableAfterToDestination = false |
whether or not this controller should go back to sleep after a OneTime More... | |
float | InitialValue |
the initial value of the controlled float More... | |
float | CurrentValue |
the current value of the controlled float More... | |
float | CurrentValueNormalized = 0f |
the current value of the controlled float, normalized More... | |
Color | InitialColor |
the current value of the controlled float More... | |
int | PropertyID |
the ID of the property More... | |
bool | PropertyFound = false |
whether or not the property got found More... | |
Material | TargetMaterial |
the target material More... | |
float | PingPong |
internal use only More... | |
float | LoopTime |
internal use only More... | |
Protected Member Functions | |
virtual void | Awake () |
On start we initialize our controller More... | |
virtual void | OnEnable () |
On enable, grabs the initial value More... | |
virtual bool | RendererIsNull () |
Returns true if the renderer is null, false otherwise More... | |
virtual void | SetStoredSpriteRendererTexture (MaterialPropertyBlock block) |
Sets the texture associated with the sprite renderer to the specified block 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 | OnDisable () |
virtual void | UpdateValue () |
Updates the value over time based on the selected options More... | |
virtual float | GetInitialValue () |
Grabs and stores the initial value More... | |
virtual void | SetValue (float newValue) |
Sets the value in the shader More... | |
Protected Attributes | |
float | _randomAmplitude |
float | _randomFrequency |
float | _randomShift |
float | _elapsedTime = 0f |
bool | _shaking = false |
float | _startedTimestamp = 0f |
float | _remappedTimeSinceStart = 0f |
Color | _currentColor |
Vector4 | _vectorValue |
float | _pingPongDirection = 1f |
float | _lastPingPongPauseAt = 0f |
float | _lastLoopPauseAt = 0f |
float | _initialValue = 0f |
Color | _fromColorStorage |
bool | _activeLastFrame = false |
MaterialPropertyBlock | _propertyBlock |
SpriteRenderer | _spriteRenderer |
Texture2D | _spriteRendererTexture |
bool | SpriteRendererIsNull |
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 |
|
strong |
|
protectedvirtual |
On start we initialize our controller
|
virtual |
Finds an attribute (property or field) on the target object
propertyName |
|
protected |
Returns the relevant delta time
|
protectedvirtual |
Grabs and stores the initial value
|
protected |
Returns the relevant time
|
virtual |
Grabs the target property and initializes stuff
|
protectedvirtual |
|
protectedvirtual |
On enable, grabs the initial value
|
virtual |
Triggers a one time shake of the shader controller
|
protectedvirtual |
Returns true if the renderer is null, false otherwise
|
virtual |
|
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 |
void MoreMountains.Tools.ShaderController.SetFromColor | ( | Color | newColor | ) |
Use this method to change the FromColor value
newColor |
|
virtual |
Use this method to change the OneTimeRemapMax value
newValue |
|
virtual |
Use this method to change the OneTimeRemapMin value
newValue |
|
protectedvirtual |
Sets the texture associated with the sprite renderer to the specified block
block |
void MoreMountains.Tools.ShaderController.SetToColor | ( | Color | newColor | ) |
Use this method to change the ToColor value
newColor |
|
virtual |
Use this method to change the ToDestinationValue
newValue |
|
protectedvirtual |
Sets the value in the shader
newValue |
|
virtual |
Interrupts any tween in progress, and disables itself
|
virtual |
Stores the sprite renderer and a test for it
|
virtual |
Stores the SpriteRenderer's texture if found
|
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
|
protectedvirtual |
Updates the value over time based on the selected options
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
bool MoreMountains.Tools.ShaderController.AddToInitialValue = false |
whether or not the updated value should be added to the initial one
Vector2 MoreMountains.Tools.ShaderController.Amplitude = new Vector2(0f,5f) |
the noise amplitude
MMAudioAnalyzer MoreMountains.Tools.ShaderController.AudioAnalyzer |
the bound audio analyzer used to drive this controller
float MoreMountains.Tools.ShaderController.AudioAnalyzerLerp = 60f |
the speed at which to lerp the value
float MoreMountains.Tools.ShaderController.AudioAnalyzerMultiplier = 1f |
the multiplier to apply to the value out of the analyzer
float MoreMountains.Tools.ShaderController.AudioAnalyzerOffset = 0f |
the offset to apply to the value out of the analyzer
int MoreMountains.Tools.ShaderController.BeatID |
the ID of the selected beat on the analyzer
bool MoreMountains.Tools.ShaderController.CacheMaterial = true |
if this is true, material will be cached on Start
ColorModes MoreMountains.Tools.ShaderController.ColorMode = ColorModes.TwoColors |
whether to move from a color to another, or to evalute colors on a ramp
Gradient MoreMountains.Tools.ShaderController.ColorRamp |
the ramp along which to lerp when in ramp color mode
ControlModes MoreMountains.Tools.ShaderController.ControlMode |
the control mode (ping pong or random)
bool MoreMountains.Tools.ShaderController.CreateMaterialInstance = false |
if this is true, an instance of the material will be created on start so that this controller only affects its target
float MoreMountains.Tools.ShaderController.CurrentValue |
the current value of the controlled float
float MoreMountains.Tools.ShaderController.CurrentValueNormalized = 0f |
the current value of the controlled float, normalized
MMTweenType MoreMountains.Tools.ShaderController.Curve |
the curve to apply to the tween
bool MoreMountains.Tools.ShaderController.DisableAfterOneTime = false |
whether or not this controller should go back to sleep after a OneTime
bool MoreMountains.Tools.ShaderController.DisableAfterToDestination = false |
whether or not this controller should go back to sleep after a OneTime
bool MoreMountains.Tools.ShaderController.DisableGameObjectAfterOneTime = false |
whether or not this controller should go back to sleep after a OneTime
float MoreMountains.Tools.ShaderController.DrivenLevel = 0f |
the value that will be applied to the controlled float in driven mode
float MoreMountains.Tools.ShaderController.Duration = 1f |
the duration of one ping (or pong)
Vector2 MoreMountains.Tools.ShaderController.Frequency = new Vector2(1f, 1f) |
the noise frequency
Color MoreMountains.Tools.ShaderController.FromColor = Color.black |
the color to lerp from
bool MoreMountains.Tools.ShaderController.GetInitialValueOnOneTime = false |
whether or not to initialize the initial value to the current value on a OneTime play
Color MoreMountains.Tools.ShaderController.InitialColor |
the current value of the controlled float
float MoreMountains.Tools.ShaderController.InitialValue |
the initial value of the controlled float
MMTweenType MoreMountains.Tools.ShaderController.LoopCurve |
the curve to apply to the tween
float MoreMountains.Tools.ShaderController.LoopDuration = 1f |
the duration of one loop
float MoreMountains.Tools.ShaderController.LoopEndValue = 5f |
the end value for the loop tween
float MoreMountains.Tools.ShaderController.LoopPauseDuration = 1f |
the duration of the pause between two loops (in seconds)
float MoreMountains.Tools.ShaderController.LoopStartValue = 0f |
the start value for the loop tween
float MoreMountains.Tools.ShaderController.LoopTime |
internal use only
float MoreMountains.Tools.ShaderController.MaxValue = 5f |
the maximum value for the ping pong
float MoreMountains.Tools.ShaderController.MinValue = 0f |
the minimum value for the ping pong
float MoreMountains.Tools.ShaderController.OneTimeAmplitude = 1f |
the amplitude of the One Time shake (this will be multiplied by the curve's height)
bool MoreMountains.Tools.ShaderController.OneTimeButton |
a test button for the one time shake
AnimationCurve MoreMountains.Tools.ShaderController.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.ShaderController.OneTimeDuration = 1f |
the duration of the One Time shake
float MoreMountains.Tools.ShaderController.OneTimeRemapMax = 1f |
the high value to remap the normalized curve value to
float MoreMountains.Tools.ShaderController.OneTimeRemapMin = 0f |
the low value to remap the normalized curve value to
float MoreMountains.Tools.ShaderController.PingPong |
internal use only
float MoreMountains.Tools.ShaderController.PingPongPauseDuration = 1f |
the duration of the pause between two ping (or pongs) (in seconds)
bool MoreMountains.Tools.ShaderController.PropertyFound = false |
whether or not the property got found
int MoreMountains.Tools.ShaderController.PropertyID |
the ID of the property
PropertyTypes MoreMountains.Tools.ShaderController.PropertyType = PropertyTypes.Float |
the type of the property to affect
float MoreMountains.Tools.ShaderController.RemapNoiseOne = 1f |
the value to which to remap the random's one bound
bool MoreMountains.Tools.ShaderController.RemapNoiseValues = false |
if this is true, will let you remap the noise value (without amplitude) to the bounds you've specified
float MoreMountains.Tools.ShaderController.RemapNoiseZero = 0f |
the value to which to remap the random's zero bound
bool MoreMountains.Tools.ShaderController.RevertToInitialValueAfterEnd = true |
whether or not you want to revert to the InitialValue after the control ends
bool MoreMountains.Tools.ShaderController.SafeMode = false |
whether or not to perform extra safety checks (safer, more costly)
Vector2 MoreMountains.Tools.ShaderController.Shift = new Vector2(0f, 1f) |
the noise shift
|
protected |
string MoreMountains.Tools.ShaderController.SpriteRendererTextureProperty = "_MainTex" |
if using material property blocks on a sprite renderer, you'll want to make sure the sprite texture gets passed to the block when updating it. For that, you need to specify your sprite's material's shader's texture property name. If you're not working with a sprite renderer, you can safely ignore this.
Image MoreMountains.Tools.ShaderController.TargetImage |
the Image with the shader you want to control
Material MoreMountains.Tools.ShaderController.TargetMaterial |
the target material
int MoreMountains.Tools.ShaderController.TargetMaterialID = 0 |
the ID of the material in the Materials array on the target renderer (usually 0)
string MoreMountains.Tools.ShaderController.TargetPropertyName |
the EXACT name of the property to affect
RawImage MoreMountains.Tools.ShaderController.TargetRawImage |
the RawImage with the shader you want to control
Renderer MoreMountains.Tools.ShaderController.TargetRenderer |
the renderer with the shader you want to control
Text MoreMountains.Tools.ShaderController.TargetText |
the Text with the shader you want to control
TargetTypes MoreMountains.Tools.ShaderController.TargetType = TargetTypes.Renderer |
the type of renderer to pilot
Color MoreMountains.Tools.ShaderController.ToColor = Color.white |
the color to lerp to
bool MoreMountains.Tools.ShaderController.ToDestinationButton |
a test button for the one time shake
AnimationCurve MoreMountains.Tools.ShaderController.ToDestinationCurve = new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.5f, 0.6f), new Keyframe(1f, 1f)) |
the curve to use to tween to the ToDestination value
float MoreMountains.Tools.ShaderController.ToDestinationDuration = 1f |
the duration of the ToDestination tween
float MoreMountains.Tools.ShaderController.ToDestinationValue = 1f |
the value to go to when in ToDestination mode
bool MoreMountains.Tools.ShaderController.UseMaterialForRendering = false |
if this is true, the 'materialForRendering' for this Image will be used, instead of the regular material
bool MoreMountains.Tools.ShaderController.UseMaterialPropertyBlocks = false |
if this is true, this component will use material property blocks instead of working on an instance of the material.
bool MoreMountains.Tools.ShaderController.UseUnscaledTime = true |
whether or not to use unscaled time
bool MoreMountains.Tools.ShaderController.W |
whether or not to affect its w component
bool MoreMountains.Tools.ShaderController.X |
whether or not to affect its x component
bool MoreMountains.Tools.ShaderController.Y |
whether or not to affect its y component
bool MoreMountains.Tools.ShaderController.Z |
whether or not to affect its z component