Feel  4.0.1
The best way to improve your game's feel and make it extra juicy
MoreMountains.Feedbacks.MMFlash Class Reference

Add this class to an image and it'll flash when getting a MMFlashEvent More...

Inheritance diagram for MoreMountains.Feedbacks.MMFlash:

Public Member Functions

virtual float GetTime ()
 
virtual float GetDeltaTime ()
 
virtual void DebugTest ()
 
virtual void OnMMFlashEvent (Color flashColor, float duration, float alpha, int flashID, MMChannelData channelData, TimescaleModes timescaleMode, bool stop=false)
 When getting a flash event, we turn our image on More...
 

Public Attributes

MMChannelModes ChannelMode = MMChannelModes.Int
 
int Channel = 0
 the channel to listen to - has to match the one on the feedback More...
 
MMChannel MMChannelDefinition = null
 
int FlashID = 0
 the ID of this MMFlash object. When triggering a MMFlashEvent you can specify an ID, and only MMFlash objects with this ID will answer the call and flash, allowing you to have more than one flash object in a scene More...
 
bool Interruptable = false
 if this is true, the MMFlash will stop before playing on every new event received More...
 
MMTweenType FlashInTween = new MMTweenType(MMTween.MMTweenCurve.LinearTween)
 the animation curve to use when flashing in More...
 
MMTweenType FlashOutTween = new MMTweenType(MMTween.MMTweenCurve.LinearTween)
 the animation curve to use when flashing out More...
 
MMFlashDebugSettings DebugSettings
 the set of test settings to use when pressing the DebugTest button More...
 
bool DebugTestButton
 a test button that calls the DebugTest method More...
 

Protected Member Functions

virtual void Start ()
 On start we grab our image component More...
 
virtual void Update ()
 On update we flash our image if needed More...
 
virtual void OnEnable ()
 On enable we start listening for events More...
 
virtual void OnDisable ()
 On disable we stop listening for events More...
 

Protected Attributes

Image _image
 
CanvasGroup _canvasGroup
 
bool _flashing = false
 
float _targetAlpha
 
Color _initialColor
 
float _delta
 
float _flashStartedTimestamp
 
int _direction = 1
 
float _duration
 
TimescaleModes _timescaleMode
 
MMTweenType _currentTween
 

Detailed Description

Add this class to an image and it'll flash when getting a MMFlashEvent

Member Function Documentation

◆ DebugTest()

virtual void MoreMountains.Feedbacks.MMFlash.DebugTest ( )
virtual

◆ GetDeltaTime()

virtual float MoreMountains.Feedbacks.MMFlash.GetDeltaTime ( )
virtual

◆ GetTime()

virtual float MoreMountains.Feedbacks.MMFlash.GetTime ( )
virtual

◆ OnDisable()

virtual void MoreMountains.Feedbacks.MMFlash.OnDisable ( )
protectedvirtual

On disable we stop listening for events

◆ OnEnable()

virtual void MoreMountains.Feedbacks.MMFlash.OnEnable ( )
protectedvirtual

On enable we start listening for events

◆ OnMMFlashEvent()

virtual void MoreMountains.Feedbacks.MMFlash.OnMMFlashEvent ( Color  flashColor,
float  duration,
float  alpha,
int  flashID,
MMChannelData  channelData,
TimescaleModes  timescaleMode,
bool  stop = false 
)
virtual

When getting a flash event, we turn our image on

◆ Start()

virtual void MoreMountains.Feedbacks.MMFlash.Start ( )
protectedvirtual

On start we grab our image component

◆ Update()

virtual void MoreMountains.Feedbacks.MMFlash.Update ( )
protectedvirtual

On update we flash our image if needed

Member Data Documentation

◆ _canvasGroup

CanvasGroup MoreMountains.Feedbacks.MMFlash._canvasGroup
protected

◆ _currentTween

MMTweenType MoreMountains.Feedbacks.MMFlash._currentTween
protected

◆ _delta

float MoreMountains.Feedbacks.MMFlash._delta
protected

◆ _direction

int MoreMountains.Feedbacks.MMFlash._direction = 1
protected

◆ _duration

float MoreMountains.Feedbacks.MMFlash._duration
protected

◆ _flashing

bool MoreMountains.Feedbacks.MMFlash._flashing = false
protected

◆ _flashStartedTimestamp

float MoreMountains.Feedbacks.MMFlash._flashStartedTimestamp
protected

◆ _image

Image MoreMountains.Feedbacks.MMFlash._image
protected

◆ _initialColor

Color MoreMountains.Feedbacks.MMFlash._initialColor
protected

◆ _targetAlpha

float MoreMountains.Feedbacks.MMFlash._targetAlpha
protected

◆ _timescaleMode

TimescaleModes MoreMountains.Feedbacks.MMFlash._timescaleMode
protected

◆ Channel

int MoreMountains.Feedbacks.MMFlash.Channel = 0

the channel to listen to - has to match the one on the feedback

◆ ChannelMode

MMChannelModes MoreMountains.Feedbacks.MMFlash.ChannelMode = MMChannelModes.Int

whether to listen on a channel defined by an int or by a MMChannel scriptable object. Ints are simple to setup but can get messy and make it harder to remember what int corresponds to what. MMChannel scriptable objects require you to create them in advance, but come with a readable name and are more scalable

◆ DebugSettings

MMFlashDebugSettings MoreMountains.Feedbacks.MMFlash.DebugSettings

the set of test settings to use when pressing the DebugTest button

◆ DebugTestButton

bool MoreMountains.Feedbacks.MMFlash.DebugTestButton

a test button that calls the DebugTest method

◆ FlashID

int MoreMountains.Feedbacks.MMFlash.FlashID = 0

the ID of this MMFlash object. When triggering a MMFlashEvent you can specify an ID, and only MMFlash objects with this ID will answer the call and flash, allowing you to have more than one flash object in a scene

◆ FlashInTween

MMTweenType MoreMountains.Feedbacks.MMFlash.FlashInTween = new MMTweenType(MMTween.MMTweenCurve.LinearTween)

the animation curve to use when flashing in

◆ FlashOutTween

MMTweenType MoreMountains.Feedbacks.MMFlash.FlashOutTween = new MMTweenType(MMTween.MMTweenCurve.LinearTween)

the animation curve to use when flashing out

◆ Interruptable

bool MoreMountains.Feedbacks.MMFlash.Interruptable = false

if this is true, the MMFlash will stop before playing on every new event received

◆ MMChannelDefinition

MMChannel MoreMountains.Feedbacks.MMFlash.MMChannelDefinition = null

the MMChannel definition asset to use to listen for events. The feedbacks targeting this shaker will have to reference that same MMChannel definition to receive events - to create a MMChannel, right click anywhere in your project (usually in a Data folder) and go MoreMountains > MMChannel, then name it with some unique name


The documentation for this class was generated from the following file: