TopDown Engine v4.5
Loading...
Searching...
No Matches
MoreMountains.Feedbacks.MMF_SpriteRendererAlpha 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_SpriteRendererAlpha:
MoreMountains.Feedbacks.MMF_Feedback

Public Types

enum  Modes { OverTime , Instant , ToDestinationAlpha , ToDestinationAlphaAndBack }
 the possible modes for this feedback More...
enum  InitialAlphaModes { InitialAlphaOnInit , InitialAlphaOnPlay }
 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 SetActiveOnPlay = true
 whether or not to set active and enable the target sprite renderer on play
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
InitialAlphaModes InitialAlphaMode = InitialAlphaModes.InitialAlphaOnPlay
 whether to grab the initial color to (potentially) go back to at init or when the feedback plays
AnimationCurve AlphaOverTime = new AnimationCurve(new Keyframe(0, 0f), new Keyframe(1, 1f))
 the alpha to apply to the sprite renderer over time
float InstantAlpha
 the alpha to move to in instant mode
float ToDestinationAlpha = 0.5f
 the alpha to move to in ToDestinationAlpha mode
AnimationCurve ToDestinationAlphaCurve = new AnimationCurve(new Keyframe(0, 0f), new Keyframe(1, 1f))
 the curve on which to tween in ToDestinationAlpha modes

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 (float intensity, Vector3 position)
 This coroutine will modify the values on the SpriteRenderer.
virtual IEnumerator SpriteRendererToDestinationSequence (bool andBack, float intensity, Vector3 position)
 This coroutine will modify the values on the SpriteRenderer.
virtual void SetSpriteRendererValues (float time, float intensity, Vector3 position)
 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.
virtual void SetAlpha (float newAlpha, float feedbacksIntensity, Vector3 position)

Protected Attributes

Coroutine _coroutine
float _initialAlpha

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

◆ InitialAlphaModes

the different ways to grab initial color

Enumerator
InitialAlphaOnInit 
InitialAlphaOnPlay 

◆ Modes

the possible modes for this feedback

Enumerator
OverTime 
Instant 
ToDestinationAlpha 
ToDestinationAlphaAndBack 

Member Function Documentation

◆ AutomateTargetAcquisition()

override void MoreMountains.Feedbacks.MMF_SpriteRendererAlpha.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_SpriteRendererAlpha.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_SpriteRendererAlpha.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_SpriteRendererAlpha.CustomRestoreInitialValues ( )
protectedvirtual

On restore, we restore our initial state.

Reimplemented from MoreMountains.Feedbacks.MMF_Feedback.

◆ CustomStopFeedback()

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

Stops the transition on stop if needed.

Parameters
position
feedbacksIntensity

Reimplemented from MoreMountains.Feedbacks.MMF_Feedback.

◆ OnDisable()

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

On disable,.

Reimplemented from MoreMountains.Feedbacks.MMF_Feedback.

◆ SetAlpha()

virtual void MoreMountains.Feedbacks.MMF_SpriteRendererAlpha.SetAlpha ( float newAlpha,
float feedbacksIntensity,
Vector3 position )
protectedvirtual

◆ SetSpriteRendererValues()

virtual void MoreMountains.Feedbacks.MMF_SpriteRendererAlpha.SetSpriteRendererValues ( float time,
float intensity,
Vector3 position )
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_SpriteRendererAlpha.SpriteRendererSequence ( float intensity,
Vector3 position )
protectedvirtual

This coroutine will modify the values on the SpriteRenderer.

Returns

◆ SpriteRendererToDestinationSequence()

virtual IEnumerator MoreMountains.Feedbacks.MMF_SpriteRendererAlpha.SpriteRendererToDestinationSequence ( bool andBack,
float intensity,
Vector3 position )
protectedvirtual

This coroutine will modify the values on the SpriteRenderer.

Returns

◆ Turn()

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

Turns the sprite renderer on or off.

Parameters
status

Member Data Documentation

◆ _coroutine

Coroutine MoreMountains.Feedbacks.MMF_SpriteRendererAlpha._coroutine
protected

◆ _initialAlpha

float MoreMountains.Feedbacks.MMF_SpriteRendererAlpha._initialAlpha
protected

◆ AllowAdditivePlays

bool MoreMountains.Feedbacks.MMF_SpriteRendererAlpha.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

◆ AlphaOverTime

AnimationCurve MoreMountains.Feedbacks.MMF_SpriteRendererAlpha.AlphaOverTime = new AnimationCurve(new Keyframe(0, 0f), new Keyframe(1, 1f))

the alpha to apply to the sprite renderer over time

◆ BoundSpriteRenderer

SpriteRenderer MoreMountains.Feedbacks.MMF_SpriteRendererAlpha.BoundSpriteRenderer

the SpriteRenderer to affect when playing the feedback

◆ Duration

float MoreMountains.Feedbacks.MMF_SpriteRendererAlpha.Duration = 0.2f

how long the sprite renderer should change over time

◆ FeedbackTypeAuthorized

bool MoreMountains.Feedbacks.MMF_SpriteRendererAlpha.FeedbackTypeAuthorized = true
static

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

◆ InitialAlphaMode

InitialAlphaModes MoreMountains.Feedbacks.MMF_SpriteRendererAlpha.InitialAlphaMode = InitialAlphaModes.InitialAlphaOnPlay

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

◆ InstantAlpha

float MoreMountains.Feedbacks.MMF_SpriteRendererAlpha.InstantAlpha

the alpha to move to in instant mode

◆ Mode

Modes MoreMountains.Feedbacks.MMF_SpriteRendererAlpha.Mode = Modes.OverTime

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

◆ SetActiveOnPlay

bool MoreMountains.Feedbacks.MMF_SpriteRendererAlpha.SetActiveOnPlay = true

whether or not to set active and enable the target sprite renderer on play

◆ StartsOff

bool MoreMountains.Feedbacks.MMF_SpriteRendererAlpha.StartsOff = false

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

◆ ToDestinationAlpha

float MoreMountains.Feedbacks.MMF_SpriteRendererAlpha.ToDestinationAlpha = 0.5f

the alpha to move to in ToDestinationAlpha mode

◆ ToDestinationAlphaCurve

AnimationCurve MoreMountains.Feedbacks.MMF_SpriteRendererAlpha.ToDestinationAlphaCurve = new AnimationCurve(new Keyframe(0, 0f), new Keyframe(1, 1f))

the curve on which to tween in ToDestinationAlpha modes

Property Documentation

◆ FeedbackDuration

override float MoreMountains.Feedbacks.MMF_SpriteRendererAlpha.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_SpriteRendererAlpha.HasAutomatedTargetAcquisition
get

◆ HasChannel

override bool MoreMountains.Feedbacks.MMF_SpriteRendererAlpha.HasChannel
get

◆ HasRandomness

override bool MoreMountains.Feedbacks.MMF_SpriteRendererAlpha.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_SpriteRendererAlpha.cs