TopDown Engine v4.5
Loading...
Searching...
No Matches
MoreMountains.Feedbacks.MMF_SpriteRenderer Class Reference

This feedback will let you change the color of a target sprite renderer over time, and flip it on X or Y. You can also use it to command one or many MMSpriteRendererShakers. More...

Inheritance diagram for MoreMountains.Feedbacks.MMF_SpriteRenderer:
MoreMountains.Feedbacks.MMF_Feedback

Public Types

enum  Modes {
  OverTime , Instant , ShakerEvent , ToDestinationColor ,
  ToDestinationColorAndBack
}
 the possible modes for this feedback More...
enum  InitialColorModes { InitialColorOnInit , InitialColorOnPlay }
 the different ways to grab initial color More...

Public Member Functions

override void OnDisable ()
 On disable,.

Public Attributes

SpriteRenderer BoundSpriteRenderer
 the SpriteRenderer to affect when playing the feedback
Modes Mode = Modes.OverTime
 whether the feedback should affect the sprite renderer instantly or over a period of time
float Duration = 0.2f
 how long the sprite renderer should change over time
bool StartsOff = false
 whether or not that sprite renderer should be turned off on start
bool ResetShakerValuesAfterShake = true
 whether or not to reset shaker values after shake
bool ResetTargetValuesAfterShake = true
 whether or not to reset the target's values after shake
bool OnlyBroadcastInRange = false
 whether or not to broadcast a range to only affect certain shakers
float EventRange = 100f
 the range of the event, in units
Transform EventOriginTransform
 the transform to use to broadcast the event as origin point
bool AllowAdditivePlays = false
 if this is true, calling that feedback will trigger it, even if it's in progress. If it's false, it'll prevent any new Play until the current one is over
InitialColorModes InitialColorMode = InitialColorModes.InitialColorOnPlay
 whether to grab the initial color to (potentially) go back to at init or when the feedback plays
bool ModifyColor = true
 whether or not to modify the color of the sprite renderer
Gradient ColorOverTime
 the colors to apply to the sprite renderer over time
Color InstantColor
 the color to move to in instant mode
Color ToDestinationColor = Color.red
 the color to move to in ToDestination mode
AnimationCurve ToDestinationColorCurve = new AnimationCurve(new Keyframe(0, 0f), new Keyframe(1, 1f))
 the color to move to in ToDestination mode
bool FlipX = false
 whether or not to flip the sprite on X
bool FlipY = false
 whether or not to flip the sprite on Y

Static Public Attributes

static bool FeedbackTypeAuthorized = true
 a static bool used to disable all feedbacks of this type at once

Protected Member Functions

override void AutomateTargetAcquisition ()
 A method meant to be implemented per feedback letting you specify what happens (usually setting a target)
override void CustomInitialization (MMF_Player owner)
 On init we turn the sprite renderer off if needed.
override void CustomPlayFeedback (Vector3 position, float feedbacksIntensity=1.0f)
 On Play we turn our sprite renderer on and start an over time coroutine if needed.
virtual IEnumerator SpriteRendererSequence ()
 This coroutine will modify the values on the SpriteRenderer.
virtual IEnumerator SpriteRendererToDestinationSequence (bool andBack)
 This coroutine will modify the values on the SpriteRenderer.
virtual void Flip ()
 Flips the sprite on X or Y based on the FlipX/FlipY settings.
virtual void SetSpriteRendererValues (float time)
 Sets the various values on the sprite renderer on a specified time (between 0 and 1)
override void CustomStopFeedback (Vector3 position, float feedbacksIntensity=1)
 Stops the transition on stop if needed.
virtual void Turn (bool status)
 Turns the sprite renderer on or off.
override void CustomRestoreInitialValues ()
 On restore, we restore our initial state.

Protected Attributes

Coroutine _coroutine
Color _initialColor
bool _initialFlipX
bool _initialFlipY

Properties

override float FeedbackDuration [get, set]
 sets the inspector color for this feedback
override bool HasChannel [get]
override bool HasRandomness [get]
override bool HasAutomatedTargetAcquisition [get]

Detailed Description

This feedback will let you change the color of a target sprite renderer over time, and flip it on X or Y. You can also use it to command one or many MMSpriteRendererShakers.

Member Enumeration Documentation

◆ InitialColorModes

the different ways to grab initial color

Enumerator
InitialColorOnInit 
InitialColorOnPlay 

◆ Modes

the possible modes for this feedback

Enumerator
OverTime 
Instant 
ShakerEvent 
ToDestinationColor 
ToDestinationColorAndBack 

Member Function Documentation

◆ AutomateTargetAcquisition()

override void MoreMountains.Feedbacks.MMF_SpriteRenderer.AutomateTargetAcquisition ( )
protectedvirtual

A method meant to be implemented per feedback letting you specify what happens (usually setting a target)

Reimplemented from MoreMountains.Feedbacks.MMF_Feedback.

◆ CustomInitialization()

override void MoreMountains.Feedbacks.MMF_SpriteRenderer.CustomInitialization ( MMF_Player owner)
protectedvirtual

On init we turn the sprite renderer off if needed.

Parameters
owner

Reimplemented from MoreMountains.Feedbacks.MMF_Feedback.

◆ CustomPlayFeedback()

override void MoreMountains.Feedbacks.MMF_SpriteRenderer.CustomPlayFeedback ( Vector3 position,
float feedbacksIntensity = 1::0f )
protected

On Play we turn our sprite renderer on and start an over time coroutine if needed.

Parameters
position
feedbacksIntensity

◆ CustomRestoreInitialValues()

override void MoreMountains.Feedbacks.MMF_SpriteRenderer.CustomRestoreInitialValues ( )
protectedvirtual

On restore, we restore our initial state.

Reimplemented from MoreMountains.Feedbacks.MMF_Feedback.

◆ CustomStopFeedback()

override void MoreMountains.Feedbacks.MMF_SpriteRenderer.CustomStopFeedback ( Vector3 position,
float feedbacksIntensity = 1 )
protectedvirtual

Stops the transition on stop if needed.

Parameters
position
feedbacksIntensity

Reimplemented from MoreMountains.Feedbacks.MMF_Feedback.

◆ Flip()

virtual void MoreMountains.Feedbacks.MMF_SpriteRenderer.Flip ( )
protectedvirtual

Flips the sprite on X or Y based on the FlipX/FlipY settings.

◆ OnDisable()

override void MoreMountains.Feedbacks.MMF_SpriteRenderer.OnDisable ( )
virtual

On disable,.

Reimplemented from MoreMountains.Feedbacks.MMF_Feedback.

◆ SetSpriteRendererValues()

virtual void MoreMountains.Feedbacks.MMF_SpriteRenderer.SetSpriteRendererValues ( float time)
protectedvirtual

Sets the various values on the sprite renderer on a specified time (between 0 and 1)

Parameters
time

◆ SpriteRendererSequence()

virtual IEnumerator MoreMountains.Feedbacks.MMF_SpriteRenderer.SpriteRendererSequence ( )
protectedvirtual

This coroutine will modify the values on the SpriteRenderer.

Returns

◆ SpriteRendererToDestinationSequence()

virtual IEnumerator MoreMountains.Feedbacks.MMF_SpriteRenderer.SpriteRendererToDestinationSequence ( bool andBack)
protectedvirtual

This coroutine will modify the values on the SpriteRenderer.

Returns

◆ Turn()

virtual void MoreMountains.Feedbacks.MMF_SpriteRenderer.Turn ( bool status)
protectedvirtual

Turns the sprite renderer on or off.

Parameters
status

Member Data Documentation

◆ _coroutine

Coroutine MoreMountains.Feedbacks.MMF_SpriteRenderer._coroutine
protected

◆ _initialColor

Color MoreMountains.Feedbacks.MMF_SpriteRenderer._initialColor
protected

◆ _initialFlipX

bool MoreMountains.Feedbacks.MMF_SpriteRenderer._initialFlipX
protected

◆ _initialFlipY

bool MoreMountains.Feedbacks.MMF_SpriteRenderer._initialFlipY
protected

◆ AllowAdditivePlays

bool MoreMountains.Feedbacks.MMF_SpriteRenderer.AllowAdditivePlays = false

if this is true, calling that feedback will trigger it, even if it's in progress. If it's false, it'll prevent any new Play until the current one is over

◆ BoundSpriteRenderer

SpriteRenderer MoreMountains.Feedbacks.MMF_SpriteRenderer.BoundSpriteRenderer

the SpriteRenderer to affect when playing the feedback

◆ ColorOverTime

Gradient MoreMountains.Feedbacks.MMF_SpriteRenderer.ColorOverTime

the colors to apply to the sprite renderer over time

◆ Duration

float MoreMountains.Feedbacks.MMF_SpriteRenderer.Duration = 0.2f

how long the sprite renderer should change over time

◆ EventOriginTransform

Transform MoreMountains.Feedbacks.MMF_SpriteRenderer.EventOriginTransform

the transform to use to broadcast the event as origin point

◆ EventRange

float MoreMountains.Feedbacks.MMF_SpriteRenderer.EventRange = 100f

the range of the event, in units

◆ FeedbackTypeAuthorized

bool MoreMountains.Feedbacks.MMF_SpriteRenderer.FeedbackTypeAuthorized = true
static

a static bool used to disable all feedbacks of this type at once

◆ FlipX

bool MoreMountains.Feedbacks.MMF_SpriteRenderer.FlipX = false

whether or not to flip the sprite on X

◆ FlipY

bool MoreMountains.Feedbacks.MMF_SpriteRenderer.FlipY = false

whether or not to flip the sprite on Y

◆ InitialColorMode

InitialColorModes MoreMountains.Feedbacks.MMF_SpriteRenderer.InitialColorMode = InitialColorModes.InitialColorOnPlay

whether to grab the initial color to (potentially) go back to at init or when the feedback plays

◆ InstantColor

Color MoreMountains.Feedbacks.MMF_SpriteRenderer.InstantColor

the color to move to in instant mode

◆ Mode

Modes MoreMountains.Feedbacks.MMF_SpriteRenderer.Mode = Modes.OverTime

whether the feedback should affect the sprite renderer instantly or over a period of time

◆ ModifyColor

bool MoreMountains.Feedbacks.MMF_SpriteRenderer.ModifyColor = true

whether or not to modify the color of the sprite renderer

◆ OnlyBroadcastInRange

bool MoreMountains.Feedbacks.MMF_SpriteRenderer.OnlyBroadcastInRange = false

whether or not to broadcast a range to only affect certain shakers

◆ ResetShakerValuesAfterShake

bool MoreMountains.Feedbacks.MMF_SpriteRenderer.ResetShakerValuesAfterShake = true

whether or not to reset shaker values after shake

◆ ResetTargetValuesAfterShake

bool MoreMountains.Feedbacks.MMF_SpriteRenderer.ResetTargetValuesAfterShake = true

whether or not to reset the target's values after shake

◆ StartsOff

bool MoreMountains.Feedbacks.MMF_SpriteRenderer.StartsOff = false

whether or not that sprite renderer should be turned off on start

◆ ToDestinationColor

Color MoreMountains.Feedbacks.MMF_SpriteRenderer.ToDestinationColor = Color.red

the color to move to in ToDestination mode

◆ ToDestinationColorCurve

AnimationCurve MoreMountains.Feedbacks.MMF_SpriteRenderer.ToDestinationColorCurve = new AnimationCurve(new Keyframe(0, 0f), new Keyframe(1, 1f))

the color to move to in ToDestination mode

Property Documentation

◆ FeedbackDuration

override float MoreMountains.Feedbacks.MMF_SpriteRenderer.FeedbackDuration
getset

sets the inspector color for this feedback

the duration of this feedback is the duration of the sprite renderer, or 0 if instant

◆ HasAutomatedTargetAcquisition

override bool MoreMountains.Feedbacks.MMF_SpriteRenderer.HasAutomatedTargetAcquisition
get

◆ HasChannel

override bool MoreMountains.Feedbacks.MMF_SpriteRenderer.HasChannel
get

◆ HasRandomness

override bool MoreMountains.Feedbacks.MMF_SpriteRenderer.HasRandomness
get

The documentation for this class was generated from the following file:
  • H:/Code/MoreMountains/topdownengine/Assets/TopDownEngine/ThirdParty/MoreMountains/MMFeedbacks/MMFeedbacks/Feedbacks/MMF_SpriteRenderer.cs