Feel
4.3
The best way to improve your game's feel and make it extra juicy
|
The Fader class can be put on an Image, and it'll intercept MMFadeEvents and turn itself on or off accordingly. More...
Public Types | |
enum | ForcedInitStates { ForcedInitStates.None, ForcedInitStates.Active, ForcedInitStates.Inactive } |
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 | Fade (float targetAlpha, float duration, MMTweenType curve, bool ignoreTimeScale) |
Use this method to fade towards the specified target alpha More... | |
virtual void | FadeIn (float duration, MMTweenType curve, bool ignoreTimeScale=true) |
Use this method to cause a fade in over the specified duration and curve More... | |
virtual void | FadeOut (float duration, MMTweenType curve, bool ignoreTimeScale=true) |
Use this method to cause a fade out over the specified duration and curve 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 | |
int | ID |
the ID for this fader (0 is default), set more IDs if you need more than one fader More... | |
float | InactiveAlpha = 0f |
the opacity the fader should be at when inactive More... | |
float | ActiveAlpha = 1f |
the opacity the fader should be at when active More... | |
ForcedInitStates | ForcedInitState = ForcedInitStates.Inactive |
determines whether a state should be forced on init 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 | CanFadeToCurrentAlpha = true |
whether or not this fader can cause a fade if the requested final alpha is the same as the current one More... | |
bool | ShouldBlockRaycasts = false |
whether or not the fader should block raycasts when visible More... | |
bool | DebugToolbar |
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, bool ignoreTimeScale) |
Starts fading this fader from the specified initial alpha to the target More... | |
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 | _initialAlpha |
float | _currentTargetAlpha |
float | _currentDuration |
MMTweenType | _currentCurve |
bool | _fading = false |
float | _fadeStartedAt |
bool | _frameCountOne |
The Fader class can be put on an Image, and it'll intercept MMFadeEvents and turn itself on or off accordingly.
|
strong |
|
protectedvirtual |
On Start, we initialize our fader
|
protectedvirtual |
Test method triggered by an inspector button
|
protectedvirtual |
Disables the fader.
|
protectedvirtual |
Enables the fader.
|
protectedvirtual |
Fades the canvasgroup towards its target alpha
|
virtual |
Use this method to fade towards the specified target alpha
targetAlpha | |
duration | |
curve | |
ignoreTimeScale |
|
virtual |
Use this method to cause a fade in over the specified duration and curve
duration | |
curve | |
ignoreTimeScale |
|
protectedvirtual |
Test method triggered by an inspector button
|
virtual |
Use this method to cause a fade out over the specified duration and curve
duration | |
curve | |
ignoreTimeScale |
|
protectedvirtual |
Test method triggered by an inspector button
|
protectedvirtual |
On init, we grab our components, and disable/hide everything
|
protectedvirtual |
On disable, we stop listening to events
|
protectedvirtual |
On enable, we start listening to events
|
virtual |
When catching a fade event, we fade our image in or out
fadeEvent | Fade event. |
|
virtual |
When catching an MMFadeInEvent, we fade our image in
fadeEvent | Fade event. |
|
virtual |
When catching an MMFadeOutEvent, we fade our image out
fadeEvent | Fade event. |
|
virtual |
When catching an MMFadeStopEvent, we stop our fade
fadeEvent | Fade event. |
|
protectedvirtual |
Test method triggered by an inspector button
|
protectedvirtual |
Starts fading this fader from the specified initial alpha to the target
initialAlpha | |
endAlpha | |
duration | |
curve | |
id | |
ignoreTimeScale |
|
protectedvirtual |
Stops the fading.
|
protectedvirtual |
On Update, we update our alpha
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
float MoreMountains.Tools.MMFader.ActiveAlpha = 1f |
the opacity the fader should be at when active
bool MoreMountains.Tools.MMFader.CanFadeToCurrentAlpha = true |
whether or not this fader can cause a fade if the requested final alpha is the same as the current one
bool MoreMountains.Tools.MMFader.DebugToolbar |
float MoreMountains.Tools.MMFader.DefaultDuration = 0.2f |
the default duration of the fade in/out
MMTweenType MoreMountains.Tools.MMFader.DefaultTween = new MMTweenType(MMTween.MMTweenCurve.LinearTween) |
the default curve to use for this fader
ForcedInitStates MoreMountains.Tools.MMFader.ForcedInitState = ForcedInitStates.Inactive |
determines whether a state should be forced on init
int MoreMountains.Tools.MMFader.ID |
the ID for this fader (0 is default), set more IDs if you need more than one fader
bool MoreMountains.Tools.MMFader.IgnoreTimescale = true |
whether or not the fade should happen in unscaled time
float MoreMountains.Tools.MMFader.InactiveAlpha = 0f |
the opacity the fader should be at when inactive
bool MoreMountains.Tools.MMFader.ShouldBlockRaycasts = false |
whether or not the fader should block raycasts when visible