Inventory Engine v4.2
Loading...
Searching...
No Matches
MoreMountains.Tools.MMFaderDirectional Class Reference

The Fader class can be put on an Image, and it'll intercept MMFadeEvents and turn itself on or off accordingly. More...

Inherits MoreMountains.Tools.MMMonoBehaviour, MoreMountains.Tools.MMEventListener< T >, MoreMountains.Tools.MMEventListener< T >, MoreMountains.Tools.MMEventListener< T >, and MoreMountains.Tools.MMEventListener< T >.

Public Types

enum  Directions { TopToBottom , LeftToRight , RightToLeft , BottomToTop }
 the possible directions this fader can move in More...

Public Member Functions

virtual void OnMMEvent (MMFadeEvent fadeEvent)
 When catching a fade event, we fade our image in or out.
virtual void OnMMEvent (MMFadeInEvent fadeEvent)
 When catching an MMFadeInEvent, we fade our image in.
virtual void OnMMEvent (MMFadeOutEvent fadeEvent)
 When catching an MMFadeOutEvent, we fade our image out.
virtual void OnMMEvent (MMFadeStopEvent fadeStopEvent)
 When catching an MMFadeStopEvent, we stop our fade.
Public Member Functions inherited from MoreMountains.Tools.MMEventListener< T >
void OnMMEvent (T eventType)

Public Attributes

int ID
 the ID for this fader (0 is default), set more IDs if you need more than one fader
Directions FadeInDirection = Directions.LeftToRight
 the direction this fader should move in when fading in
Directions FadeOutDirection = Directions.LeftToRight
 the direction this fader should move in when fading out
float DefaultDuration = 0.2f
 the default duration of the fade in/out
MMTweenType DefaultTween = new MMTweenType(MMTween.MMTweenCurve.LinearTween)
 the default curve to use for this fader
bool IgnoreTimescale = true
 whether or not the fade should happen in unscaled time
bool DisableOnInit = true
 whether or not to automatically disable this fader on init
float InitialDelay = 0f
 a delay (in seconds) to apply before playing this fade
bool ShouldBlockRaycasts = false
 whether or not the fader should block raycasts when visible
bool DebugToolbar

Protected Member Functions

virtual void ResetFader ()
 Test method triggered by an inspector button.
virtual void DefaultFade ()
 Test method triggered by an inspector button.
virtual void FadeIn1Second ()
 Test method triggered by an inspector button.
virtual void FadeOut1Second ()
 Test method triggered by an inspector button.
virtual void Start ()
 On Start, we initialize our fader.
virtual void Initialization ()
 On init, we grab our components, and disable/hide everything.
virtual void Update ()
 On Update, we update our alpha.
virtual void Fade ()
 Fades the canvasgroup towards its target alpha.
virtual void StopFading ()
 Stops the fading.
virtual IEnumerator StartFading (bool fadingIn, float duration, MMTweenType curve, int id, bool ignoreTimeScale, Vector3 worldPosition)
 Starts a fade.
virtual Vector2 BeforeEntryPosition ()
 Determines the position of the fader before entry.
virtual Vector2 ExitPosition ()
 Determines the exit position of the fader.
virtual void DisableFader ()
 Disables the fader.
virtual void EnableFader ()
 Enables the fader.
virtual void OnEnable ()
 On enable, we start listening to events.
virtual void OnDestroy ()
 On disable, we stop listening to events.

Protected Attributes

RectTransform _rectTransform
CanvasGroup _canvasGroup
float _currentDuration
MMTweenType _currentCurve
bool _fading = false
float _fadeStartedAt
Vector2 _initialPosition
Vector2 _fromPosition
Vector2 _toPosition
Vector2 _newPosition
bool _active
bool _initialized = false

Properties

virtual float Width [get]
 the width of the fader
virtual float Height [get]
 the height of the fader

Detailed Description

The Fader class can be put on an Image, and it'll intercept MMFadeEvents and turn itself on or off accordingly.

This specific fader will move from left to right, right to left, top to bottom or bottom to top

Member Enumeration Documentation

◆ Directions

the possible directions this fader can move in

Enumerator
TopToBottom 
LeftToRight 
RightToLeft 
BottomToTop 

Member Function Documentation

◆ BeforeEntryPosition()

virtual Vector2 MoreMountains.Tools.MMFaderDirectional.BeforeEntryPosition ( )
protectedvirtual

Determines the position of the fader before entry.

Returns

◆ DefaultFade()

virtual void MoreMountains.Tools.MMFaderDirectional.DefaultFade ( )
protectedvirtual

Test method triggered by an inspector button.

◆ DisableFader()

virtual void MoreMountains.Tools.MMFaderDirectional.DisableFader ( )
protectedvirtual

Disables the fader.

◆ EnableFader()

virtual void MoreMountains.Tools.MMFaderDirectional.EnableFader ( )
protectedvirtual

Enables the fader.

◆ ExitPosition()

virtual Vector2 MoreMountains.Tools.MMFaderDirectional.ExitPosition ( )
protectedvirtual

Determines the exit position of the fader.

Returns

◆ Fade()

virtual void MoreMountains.Tools.MMFaderDirectional.Fade ( )
protectedvirtual

Fades the canvasgroup towards its target alpha.

◆ FadeIn1Second()

virtual void MoreMountains.Tools.MMFaderDirectional.FadeIn1Second ( )
protectedvirtual

Test method triggered by an inspector button.

◆ FadeOut1Second()

virtual void MoreMountains.Tools.MMFaderDirectional.FadeOut1Second ( )
protectedvirtual

Test method triggered by an inspector button.

◆ Initialization()

virtual void MoreMountains.Tools.MMFaderDirectional.Initialization ( )
protectedvirtual

On init, we grab our components, and disable/hide everything.

◆ OnDestroy()

virtual void MoreMountains.Tools.MMFaderDirectional.OnDestroy ( )
protectedvirtual

On disable, we stop listening to events.

◆ OnEnable()

virtual void MoreMountains.Tools.MMFaderDirectional.OnEnable ( )
protectedvirtual

On enable, we start listening to events.

◆ OnMMEvent() [1/4]

virtual void MoreMountains.Tools.MMFaderDirectional.OnMMEvent ( MMFadeEvent fadeEvent)
virtual

When catching a fade event, we fade our image in or out.

Parameters
fadeEventFade event.

◆ OnMMEvent() [2/4]

virtual void MoreMountains.Tools.MMFaderDirectional.OnMMEvent ( MMFadeInEvent fadeEvent)
virtual

When catching an MMFadeInEvent, we fade our image in.

Parameters
fadeEventFade event.

◆ OnMMEvent() [3/4]

virtual void MoreMountains.Tools.MMFaderDirectional.OnMMEvent ( MMFadeOutEvent fadeEvent)
virtual

When catching an MMFadeOutEvent, we fade our image out.

Parameters
fadeEventFade event.

◆ OnMMEvent() [4/4]

virtual void MoreMountains.Tools.MMFaderDirectional.OnMMEvent ( MMFadeStopEvent fadeStopEvent)
virtual

When catching an MMFadeStopEvent, we stop our fade.

Parameters
fadeEventFade event.

◆ ResetFader()

virtual void MoreMountains.Tools.MMFaderDirectional.ResetFader ( )
protectedvirtual

Test method triggered by an inspector button.

◆ Start()

virtual void MoreMountains.Tools.MMFaderDirectional.Start ( )
protectedvirtual

On Start, we initialize our fader.

◆ StartFading()

virtual IEnumerator MoreMountains.Tools.MMFaderDirectional.StartFading ( bool fadingIn,
float duration,
MMTweenType curve,
int id,
bool ignoreTimeScale,
Vector3 worldPosition )
protectedvirtual

Starts a fade.

Parameters
fadingIn
duration
curve
id
ignoreTimeScale
worldPosition

◆ StopFading()

virtual void MoreMountains.Tools.MMFaderDirectional.StopFading ( )
protectedvirtual

Stops the fading.

◆ Update()

virtual void MoreMountains.Tools.MMFaderDirectional.Update ( )
protectedvirtual

On Update, we update our alpha.

Member Data Documentation

◆ _active

bool MoreMountains.Tools.MMFaderDirectional._active
protected

◆ _canvasGroup

CanvasGroup MoreMountains.Tools.MMFaderDirectional._canvasGroup
protected

◆ _currentCurve

MMTweenType MoreMountains.Tools.MMFaderDirectional._currentCurve
protected

◆ _currentDuration

float MoreMountains.Tools.MMFaderDirectional._currentDuration
protected

◆ _fadeStartedAt

float MoreMountains.Tools.MMFaderDirectional._fadeStartedAt
protected

◆ _fading

bool MoreMountains.Tools.MMFaderDirectional._fading = false
protected

◆ _fromPosition

Vector2 MoreMountains.Tools.MMFaderDirectional._fromPosition
protected

◆ _initialized

bool MoreMountains.Tools.MMFaderDirectional._initialized = false
protected

◆ _initialPosition

Vector2 MoreMountains.Tools.MMFaderDirectional._initialPosition
protected

◆ _newPosition

Vector2 MoreMountains.Tools.MMFaderDirectional._newPosition
protected

◆ _rectTransform

RectTransform MoreMountains.Tools.MMFaderDirectional._rectTransform
protected

◆ _toPosition

Vector2 MoreMountains.Tools.MMFaderDirectional._toPosition
protected

◆ DebugToolbar

bool MoreMountains.Tools.MMFaderDirectional.DebugToolbar

◆ DefaultDuration

float MoreMountains.Tools.MMFaderDirectional.DefaultDuration = 0.2f

the default duration of the fade in/out

◆ DefaultTween

MMTweenType MoreMountains.Tools.MMFaderDirectional.DefaultTween = new MMTweenType(MMTween.MMTweenCurve.LinearTween)

the default curve to use for this fader

◆ DisableOnInit

bool MoreMountains.Tools.MMFaderDirectional.DisableOnInit = true

whether or not to automatically disable this fader on init

◆ FadeInDirection

Directions MoreMountains.Tools.MMFaderDirectional.FadeInDirection = Directions.LeftToRight

the direction this fader should move in when fading in

◆ FadeOutDirection

Directions MoreMountains.Tools.MMFaderDirectional.FadeOutDirection = Directions.LeftToRight

the direction this fader should move in when fading out

◆ ID

int MoreMountains.Tools.MMFaderDirectional.ID

the ID for this fader (0 is default), set more IDs if you need more than one fader

◆ IgnoreTimescale

bool MoreMountains.Tools.MMFaderDirectional.IgnoreTimescale = true

whether or not the fade should happen in unscaled time

◆ InitialDelay

float MoreMountains.Tools.MMFaderDirectional.InitialDelay = 0f

a delay (in seconds) to apply before playing this fade

◆ ShouldBlockRaycasts

bool MoreMountains.Tools.MMFaderDirectional.ShouldBlockRaycasts = false

whether or not the fader should block raycasts when visible

Property Documentation

◆ Height

virtual float MoreMountains.Tools.MMFaderDirectional.Height
get

the height of the fader

◆ Width

virtual float MoreMountains.Tools.MMFaderDirectional.Width
get

the width of the fader


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