TopDown Engine v4.5
Loading...
Searching...
No Matches
MoreMountains.FeedbacksForThirdParty.MMF_UIToolkitColorBase Class Reference

A base feedback to set a color on a target UI Document. More...

Inheritance diagram for MoreMountains.FeedbacksForThirdParty.MMF_UIToolkitColorBase:
MoreMountains.FeedbacksForThirdParty.MMF_UIToolkit MoreMountains.Feedbacks.MMF_Feedback MoreMountains.FeedbacksForThirdParty.MMF_UIToolkitBackgroundColor MoreMountains.FeedbacksForThirdParty.MMF_UIToolkitBorderColor MoreMountains.FeedbacksForThirdParty.MMF_UIToolkitImageTint MoreMountains.FeedbacksForThirdParty.MMF_UIToolkitTextColor

Public Types

enum  Modes { OverTime , Instant }
 the possible modes for this feedback More...
Public Types inherited from MoreMountains.FeedbacksForThirdParty.MMF_UIToolkit
enum  QueryModes { Name , Class }

Public Attributes

Modes Mode = Modes.OverTime
 whether the feedback should affect the Image instantly or over a period of time
float Duration = 0.2f
 how long the Image should change over time
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
bool ModifyColor = true
 whether or not to modify the color of the image
Gradient ColorOverTime
 the colors to apply to the Image over time
Color InstantColor
 the color to move to in instant mode
bool ApplyInitialColorToGradientStart = false
 if this is true, the initial color will be applied to the gradient start
bool ApplyInitialColorToGradientEnd = false
 if this is true, the initial color will be applied to the gradient end
bool ApplyInitialColorsOnPlay = true
 if this is true, the initial color will be applied to the gradient start and end on play
Public Attributes inherited from MoreMountains.FeedbacksForThirdParty.MMF_UIToolkit
UIDocument TargetDocument
 the UI document on which to make modifications
QueryModes QueryMode = QueryModes.Name
 the way to perform the query, either via element name or via class
string Query = "ButtonA"
 the query to perform (replace this with your own element name or class)
bool MarkDirty = false
 whether to mark the UI document dirty after the operation. Set this to true when making a change that requires a repaint such as when using generateVisualContent to render a mesh and the mesh data has now changed.

Protected Member Functions

override void CustomInitialization (MMF_Player owner)
 On init we turn the Image off if needed.
virtual void HandleApplyInitialColors ()
virtual void ApplyColor (Color newColor)
virtual Color GetInitialColor ()
override void CustomPlayFeedback (Vector3 position, float feedbacksIntensity=1.0f)
 On Play we turn our Image on and start an over time coroutine if needed.
virtual IEnumerator ImageSequence ()
 This coroutine will modify the values on the Image.
virtual void SetImageValues (float time)
 Sets the various values on the sprite renderer on a specified time (between 0 and 1)
override void CustomStopFeedback (Vector3 position, float feedbacksIntensity=1)
 Turns the sprite renderer off on stop.
override void CustomRestoreInitialValues ()
 On restore, we restore our initial state.
Protected Member Functions inherited from MoreMountains.FeedbacksForThirdParty.MMF_UIToolkit
override void AutomateTargetAcquisition ()
 A method meant to be implemented per feedback letting you specify what happens (usually setting a target)
override void CustomPlayFeedback (Vector3 position, float feedbacksIntensity=1)
virtual void PerformQuery ()
 Performs the query and sets _visualElements with the result.
virtual void HandleMarkDirty (VisualElement element)

Protected Attributes

Coroutine _coroutine
Color _initialColor
Color _initialInstantColor
Protected Attributes inherited from MoreMountains.FeedbacksForThirdParty.MMF_UIToolkit
List< VisualElement > _visualElements = new List<VisualElement>()

Properties

override float FeedbackDuration [get, set]
 the duration of this feedback is whatever value's been defined for it
override bool HasChannel [get]
Properties inherited from MoreMountains.FeedbacksForThirdParty.MMF_UIToolkit
override bool HasAutomatedTargetAcquisition [get]
 sets the inspector color for this feedback

Additional Inherited Members

Static Public Attributes inherited from MoreMountains.FeedbacksForThirdParty.MMF_UIToolkit
static bool FeedbackTypeAuthorized = true
 a static bool used to disable all feedbacks of this type at once

Detailed Description

A base feedback to set a color on a target UI Document.

Member Enumeration Documentation

◆ Modes

the possible modes for this feedback

Enumerator
OverTime 
Instant 

Member Function Documentation

◆ ApplyColor()

◆ CustomInitialization()

override void MoreMountains.FeedbacksForThirdParty.MMF_UIToolkitColorBase.CustomInitialization ( MMF_Player owner)
protectedvirtual

On init we turn the Image off if needed.

Parameters
owner

Reimplemented from MoreMountains.FeedbacksForThirdParty.MMF_UIToolkit.

◆ CustomPlayFeedback()

override void MoreMountains.FeedbacksForThirdParty.MMF_UIToolkitColorBase.CustomPlayFeedback ( Vector3 position,
float feedbacksIntensity = 1::0f )
protected

On Play we turn our Image on and start an over time coroutine if needed.

Parameters
position
feedbacksIntensity

◆ CustomRestoreInitialValues()

override void MoreMountains.FeedbacksForThirdParty.MMF_UIToolkitColorBase.CustomRestoreInitialValues ( )
protectedvirtual

On restore, we restore our initial state.

Reimplemented from MoreMountains.Feedbacks.MMF_Feedback.

◆ CustomStopFeedback()

override void MoreMountains.FeedbacksForThirdParty.MMF_UIToolkitColorBase.CustomStopFeedback ( Vector3 position,
float feedbacksIntensity = 1 )
protectedvirtual

Turns the sprite renderer off on stop.

Parameters
position
feedbacksIntensity

Reimplemented from MoreMountains.Feedbacks.MMF_Feedback.

◆ GetInitialColor()

◆ HandleApplyInitialColors()

virtual void MoreMountains.FeedbacksForThirdParty.MMF_UIToolkitColorBase.HandleApplyInitialColors ( )
protectedvirtual

◆ ImageSequence()

virtual IEnumerator MoreMountains.FeedbacksForThirdParty.MMF_UIToolkitColorBase.ImageSequence ( )
protectedvirtual

This coroutine will modify the values on the Image.

Returns

◆ SetImageValues()

virtual void MoreMountains.FeedbacksForThirdParty.MMF_UIToolkitColorBase.SetImageValues ( float time)
protectedvirtual

Sets the various values on the sprite renderer on a specified time (between 0 and 1)

Parameters
time

Member Data Documentation

◆ _coroutine

Coroutine MoreMountains.FeedbacksForThirdParty.MMF_UIToolkitColorBase._coroutine
protected

◆ _initialColor

Color MoreMountains.FeedbacksForThirdParty.MMF_UIToolkitColorBase._initialColor
protected

◆ _initialInstantColor

Color MoreMountains.FeedbacksForThirdParty.MMF_UIToolkitColorBase._initialInstantColor
protected

◆ AllowAdditivePlays

bool MoreMountains.FeedbacksForThirdParty.MMF_UIToolkitColorBase.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

◆ ApplyInitialColorsOnPlay

bool MoreMountains.FeedbacksForThirdParty.MMF_UIToolkitColorBase.ApplyInitialColorsOnPlay = true

if this is true, the initial color will be applied to the gradient start and end on play

◆ ApplyInitialColorToGradientEnd

bool MoreMountains.FeedbacksForThirdParty.MMF_UIToolkitColorBase.ApplyInitialColorToGradientEnd = false

if this is true, the initial color will be applied to the gradient end

◆ ApplyInitialColorToGradientStart

bool MoreMountains.FeedbacksForThirdParty.MMF_UIToolkitColorBase.ApplyInitialColorToGradientStart = false

if this is true, the initial color will be applied to the gradient start

◆ ColorOverTime

Gradient MoreMountains.FeedbacksForThirdParty.MMF_UIToolkitColorBase.ColorOverTime
Initial value:
=
new Gradient()
{
colorKeys = new GradientColorKey[]
{
new GradientColorKey(Color.white, 0f),
new GradientColorKey(Color.red, 0.5f),
new GradientColorKey(Color.white, 1f)
},
alphaKeys = new GradientAlphaKey[]
{
new GradientAlphaKey(1f, 0f),
new GradientAlphaKey(1f, 0.5f),
new GradientAlphaKey(1f, 1f)
}
}

the colors to apply to the Image over time

◆ Duration

float MoreMountains.FeedbacksForThirdParty.MMF_UIToolkitColorBase.Duration = 0.2f

how long the Image should change over time

◆ InstantColor

Color MoreMountains.FeedbacksForThirdParty.MMF_UIToolkitColorBase.InstantColor

the color to move to in instant mode

◆ Mode

Modes MoreMountains.FeedbacksForThirdParty.MMF_UIToolkitColorBase.Mode = Modes.OverTime

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

◆ ModifyColor

bool MoreMountains.FeedbacksForThirdParty.MMF_UIToolkitColorBase.ModifyColor = true

whether or not to modify the color of the image

Property Documentation

◆ FeedbackDuration

override float MoreMountains.FeedbacksForThirdParty.MMF_UIToolkitColorBase.FeedbackDuration
getset

the duration of this feedback is whatever value's been defined for it

◆ HasChannel

override bool MoreMountains.FeedbacksForThirdParty.MMF_UIToolkitColorBase.HasChannel
get

The documentation for this class was generated from the following file:
  • H:/Code/MoreMountains/topdownengine/Assets/TopDownEngine/ThirdParty/MoreMountains/MMFeedbacks/MMFeedbacksForThirdParty/UIToolkit/Base/MMF_UIToolkitColorBase.cs