Feel  3.16
The best way to improve your game's feel and make it extra juicy
MoreMountains.Tools.MMFaderRound Class Reference

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

Inheritance diagram for MoreMountains.Tools.MMFaderRound:
MoreMountains.Tools.MMEventListener< MMFadeEvent > MoreMountains.Tools.MMEventListener< MMFadeInEvent > MoreMountains.Tools.MMEventListener< MMFadeOutEvent > MoreMountains.Tools.MMEventListener< MMFadeStopEvent >

Public Types

enum  CameraModes { CameraModes.Main, CameraModes.Override }
 

Public Member Functions

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

Public Attributes

CameraModes CameraMode = CameraModes.Main
 
Camera TargetCamera
 the camera to pick the position from (usually the "regular" game camera) More...
 
RectTransform FaderBackground
 the background to fade More...
 
RectTransform FaderMask
 the mask used to draw a hole in the background that will get faded / scaled More...
 
int ID
 the ID for this fader (0 is default), set more IDs if you need more than one fader More...
 
Vector2 MaskScale
 the mask's scale at minimum and maximum opening More...
 
float DefaultDuration = 0.2f
 the default duration of the fade in/out More...
 
MMTweenType DefaultTween = new MMTweenType(MMTween.MMTweenCurve.LinearTween)
 the default curve to use for this fader More...
 
bool IgnoreTimescale = true
 whether or not the fade should happen in unscaled time More...
 
bool ShouldBlockRaycasts = false
 whether or not the fader should block raycasts when visible More...
 
Transform DebugWorldPositionTarget
 
bool FadeIn1SecondButton
 
bool FadeOut1SecondButton
 
bool DefaultFadeButton
 
bool ResetFaderButton
 

Protected Member Functions

virtual void ResetFader ()
 Test method triggered by an inspector button More...
 
virtual void DefaultFade ()
 Test method triggered by an inspector button More...
 
virtual void FadeIn1Second ()
 Test method triggered by an inspector button More...
 
virtual void FadeOut1Second ()
 Test method triggered by an inspector button More...
 
virtual void Awake ()
 On Start, we initialize our fader More...
 
virtual void Initialization ()
 On init, we grab our components, and disable/hide everything More...
 
virtual void Update ()
 On Update, we update our alpha More...
 
virtual void Fade ()
 Fades the canvasgroup towards its target alpha More...
 
virtual void StopFading ()
 Stops the fading. More...
 
virtual void DisableFader ()
 Disables the fader. More...
 
virtual void EnableFader ()
 Enables the fader. More...
 
virtual void StartFading (float initialAlpha, float endAlpha, float duration, MMTweenType curve, int id, bool ignoreTimeScale, Vector3 worldPosition)
 
virtual void OnEnable ()
 On enable, we start listening to events More...
 
virtual void OnDisable ()
 On disable, we stop listening to events More...
 

Protected Attributes

CanvasGroup _canvasGroup
 
float _initialScale
 
float _currentTargetScale
 
float _currentDuration
 
MMTweenType _currentCurve
 
bool _fading = false
 
float _fadeStartedAt
 

Detailed Description

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

Member Enumeration Documentation

◆ CameraModes

Enumerator
Main 
Override 

Member Function Documentation

◆ Awake()

virtual void MoreMountains.Tools.MMFaderRound.Awake ( )
protectedvirtual

On Start, we initialize our fader

◆ DefaultFade()

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

Test method triggered by an inspector button

◆ DisableFader()

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

Disables the fader.

◆ EnableFader()

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

Enables the fader.

◆ Fade()

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

Fades the canvasgroup towards its target alpha

◆ FadeIn1Second()

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

Test method triggered by an inspector button

◆ FadeOut1Second()

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

Test method triggered by an inspector button

◆ Initialization()

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

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

◆ OnDisable()

virtual void MoreMountains.Tools.MMFaderRound.OnDisable ( )
protectedvirtual

On disable, we stop listening to events

◆ OnEnable()

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

On enable, we start listening to events

◆ OnMMEvent() [1/4]

virtual void MoreMountains.Tools.MMFaderRound.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.MMFaderRound.OnMMEvent ( MMFadeInEvent  fadeEvent)
virtual

When catching an MMFadeInEvent, we fade our image in

Parameters
fadeEventFade event.

◆ OnMMEvent() [3/4]

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

When catching an MMFadeOutEvent, we fade our image out

Parameters
fadeEventFade event.

◆ OnMMEvent() [4/4]

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

When catching an MMFadeStopEvent, we stop our fade

Parameters
fadeEventFade event.

◆ ResetFader()

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

Test method triggered by an inspector button

◆ StartFading()

virtual void MoreMountains.Tools.MMFaderRound.StartFading ( float  initialAlpha,
float  endAlpha,
float  duration,
MMTweenType  curve,
int  id,
bool  ignoreTimeScale,
Vector3  worldPosition 
)
protectedvirtual

◆ StopFading()

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

Stops the fading.

◆ Update()

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

On Update, we update our alpha

Member Data Documentation

◆ _canvasGroup

CanvasGroup MoreMountains.Tools.MMFaderRound._canvasGroup
protected

◆ _currentCurve

MMTweenType MoreMountains.Tools.MMFaderRound._currentCurve
protected

◆ _currentDuration

float MoreMountains.Tools.MMFaderRound._currentDuration
protected

◆ _currentTargetScale

float MoreMountains.Tools.MMFaderRound._currentTargetScale
protected

◆ _fadeStartedAt

float MoreMountains.Tools.MMFaderRound._fadeStartedAt
protected

◆ _fading

bool MoreMountains.Tools.MMFaderRound._fading = false
protected

◆ _initialScale

float MoreMountains.Tools.MMFaderRound._initialScale
protected

◆ CameraMode

CameraModes MoreMountains.Tools.MMFaderRound.CameraMode = CameraModes.Main

◆ DebugWorldPositionTarget

Transform MoreMountains.Tools.MMFaderRound.DebugWorldPositionTarget

◆ DefaultDuration

float MoreMountains.Tools.MMFaderRound.DefaultDuration = 0.2f

the default duration of the fade in/out

◆ DefaultFadeButton

bool MoreMountains.Tools.MMFaderRound.DefaultFadeButton

◆ DefaultTween

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

the default curve to use for this fader

◆ FadeIn1SecondButton

bool MoreMountains.Tools.MMFaderRound.FadeIn1SecondButton

◆ FadeOut1SecondButton

bool MoreMountains.Tools.MMFaderRound.FadeOut1SecondButton

◆ FaderBackground

RectTransform MoreMountains.Tools.MMFaderRound.FaderBackground

the background to fade

◆ FaderMask

RectTransform MoreMountains.Tools.MMFaderRound.FaderMask

the mask used to draw a hole in the background that will get faded / scaled

◆ ID

int MoreMountains.Tools.MMFaderRound.ID

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

◆ IgnoreTimescale

bool MoreMountains.Tools.MMFaderRound.IgnoreTimescale = true

whether or not the fade should happen in unscaled time

◆ MaskScale

Vector2 MoreMountains.Tools.MMFaderRound.MaskScale

the mask's scale at minimum and maximum opening

◆ ResetFaderButton

bool MoreMountains.Tools.MMFaderRound.ResetFaderButton

◆ ShouldBlockRaycasts

bool MoreMountains.Tools.MMFaderRound.ShouldBlockRaycasts = false

whether or not the fader should block raycasts when visible

◆ TargetCamera

Camera MoreMountains.Tools.MMFaderRound.TargetCamera

the camera to pick the position from (usually the "regular" game camera)


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