TopDown Engine v4.3
MoreMountains.Feedbacks.MMSpringColorComponent< T > Class Template Reference

A spring component used to pilot color values on a target More...

Inheritance diagram for MoreMountains.Feedbacks.MMSpringColorComponent< T >:
MoreMountains.Feedbacks.MMSpringComponentBase MoreMountains.Tools.MMEventListener< MMSpringColorEvent > MoreMountains.Tools.MMMonoBehaviour

Public Member Functions

virtual void MoveTo (Color newColor)
 
virtual void MoveToAdditive (Color newValue)
 
virtual void MoveToSubtractive (Color newValue)
 
virtual void MoveToRandom ()
 
virtual void MoveToInstant (Vector4 newValue)
 
virtual void MoveToRandom (Color min, Color max)
 
virtual void Bump (Color bumpColor)
 
virtual void BumpRandom ()
 
virtual void BumpRandom (Color min, Color max)
 
override void Stop ()
 Stops all value movement on this spring More...
 
override void RestoreInitialValue ()
 Restores this spring's initial value More...
 
override void ResetInitialValue ()
 Sets the current value of this spring as its new initial value, overriding the previous one More...
 
override void Finish ()
 Moves this spring to its destination and disables it More...
 
void OnMMEvent (MMSpringColorEvent springEvent)
 
- Public Member Functions inherited from MoreMountains.Feedbacks.MMSpringComponentBase
virtual void SetVelocityLowThreshold (float threshold)
 Sets the threshold under which the spring will consider its velocity as too low and will self disable More...
 
- Public Member Functions inherited from MoreMountains.Tools.MMEventListener< MMSpringColorEvent >
void OnMMEvent (T eventType)
 

Public Attributes

Target
 
TimeScaleModes TimeScaleMode = TimeScaleModes.Scaled
 whether this spring should run on scaled time (and be impacted by time scale changes) or unscaled time (and not be impacted by time scale changes) More...
 
MMChannelModes ChannelMode = MMChannelModes.Int
 
int Channel = 0
 the channel to listen to - has to match the one on the feedback More...
 
MMChannel MMChannelDefinition = null
 
MMSpringColor ColorSpring = new MMSpringColor()
 the spring definition driving all sub spring components for this color spring More...
 
float BumpMultiplier = 20f
 the multiplier to apply when bumping this color spring (increase this if you're not getting enough of the bump color on bump) More...
 
Color MoveToRandomColorMin = MMColors.LawnGreen
 the min color from which to pick a random color in MoveToRandom mode More...
 
Color MoveToRandomColorMax = MMColors.MediumSeaGreen
 the max color from which to pick a random color in MoveToRandom mode More...
 
Color BumpRandomColorMin = MMColors.HotPink
 the min color from which to pick a random color in BumpRandom mode More...
 
Color BumpRandomColorMax = MMColors.Plum
 the max color from which to pick a random color in BumpRandom mode More...
 
Color TestMoveToColor = MMColors.Aquamarine
 the value to move this spring to when interacting with any of the MoveTo debug buttons in its inspector More...
 
bool MoveToToolbar
 
Color TestBumpColor = MMColors.Orange
 the amount by which to bump this spring when interacting with the Bump debug button in its inspector More...
 
bool BumpToToolbar
 
bool OtherControlsToToolbar
 
- Public Attributes inherited from MoreMountains.Feedbacks.MMSpringComponentBase
UnityEvent OnEquilibriumReached
 

Protected Member Functions

override void UpdateSpringValue ()
 Updates the spring's target value More...
 
override void Initialization ()
 Performs initialization for this spring More...
 
override void GrabCurrentValue ()
 Grabs the current value on the spring's target More...
 
virtual void ApplyValue (Color newColor)
 
override void Awake ()
 On awake we self disable More...
 
void OnDestroy ()
 
override void TestMoveTo ()
 
override void TestMoveToAdditive ()
 
override void TestMoveToSubtractive ()
 
override void TestMoveToRandom ()
 
override void TestMoveToInstant ()
 
override void TestBump ()
 
override void TestBumpRandom ()
 
- Protected Member Functions inherited from MoreMountains.Feedbacks.MMSpringComponentBase
virtual void Update ()
 On update we update our spring value and self disable if needed More...
 
virtual void Activate ()
 Activates this component More...
 
virtual void SelfDisable ()
 Disables this component More...
 

Protected Attributes

bool _bumping = false
 
Color _newBumpColor
 
Color _bumpTargetColor
 
Color _initialBumpColor
 
Coroutine _coroutine
 
- Protected Attributes inherited from MoreMountains.Feedbacks.MMSpringComponentBase
float _velocityLowThreshold = 0.001f
 

Properties

override bool LowVelocity [get]
 
float DeltaTime [get]
 
virtual Color TargetColor [getset]
 
- Properties inherited from MoreMountains.Feedbacks.MMSpringComponentBase
virtual bool LowVelocity [get]
 whether or not this spring has reached a low enough velocity to self disable More...
 

Additional Inherited Members

- Public Types inherited from MoreMountains.Feedbacks.MMSpringComponentBase
enum  TimeScaleModes { Unscaled , Scaled }
 the different possible timescale modes for the spring More...
 

Detailed Description

A spring component used to pilot color values on a target

Type Constraints
T :Component 

Member Function Documentation

◆ ApplyValue()

virtual void MoreMountains.Feedbacks.MMSpringColorComponent< T >.ApplyValue ( Color  newColor)
protectedvirtual

◆ Awake()

override void MoreMountains.Feedbacks.MMSpringColorComponent< T >.Awake ( )
protectedvirtual

On awake we self disable

Reimplemented from MoreMountains.Feedbacks.MMSpringComponentBase.

◆ Bump()

virtual void MoreMountains.Feedbacks.MMSpringColorComponent< T >.Bump ( Color  bumpColor)
virtual

◆ BumpRandom() [1/2]

virtual void MoreMountains.Feedbacks.MMSpringColorComponent< T >.BumpRandom ( )
virtual

◆ BumpRandom() [2/2]

virtual void MoreMountains.Feedbacks.MMSpringColorComponent< T >.BumpRandom ( Color  min,
Color  max 
)
virtual

◆ Finish()

override void MoreMountains.Feedbacks.MMSpringColorComponent< T >.Finish ( )
virtual

Moves this spring to its destination and disables it

Reimplemented from MoreMountains.Feedbacks.MMSpringComponentBase.

◆ GrabCurrentValue()

override void MoreMountains.Feedbacks.MMSpringColorComponent< T >.GrabCurrentValue ( )
protectedvirtual

Grabs the current value on the spring's target

Reimplemented from MoreMountains.Feedbacks.MMSpringComponentBase.

◆ Initialization()

override void MoreMountains.Feedbacks.MMSpringColorComponent< T >.Initialization ( )
protectedvirtual

Performs initialization for this spring

Reimplemented from MoreMountains.Feedbacks.MMSpringComponentBase.

◆ MoveTo()

virtual void MoreMountains.Feedbacks.MMSpringColorComponent< T >.MoveTo ( Color  newColor)
virtual

◆ MoveToAdditive()

virtual void MoreMountains.Feedbacks.MMSpringColorComponent< T >.MoveToAdditive ( Color  newValue)
virtual

◆ MoveToInstant()

virtual void MoreMountains.Feedbacks.MMSpringColorComponent< T >.MoveToInstant ( Vector4  newValue)
virtual

◆ MoveToRandom() [1/2]

virtual void MoreMountains.Feedbacks.MMSpringColorComponent< T >.MoveToRandom ( )
virtual

◆ MoveToRandom() [2/2]

virtual void MoreMountains.Feedbacks.MMSpringColorComponent< T >.MoveToRandom ( Color  min,
Color  max 
)
virtual

◆ MoveToSubtractive()

virtual void MoreMountains.Feedbacks.MMSpringColorComponent< T >.MoveToSubtractive ( Color  newValue)
virtual

◆ OnDestroy()

void MoreMountains.Feedbacks.MMSpringColorComponent< T >.OnDestroy ( )
protected

◆ OnMMEvent()

◆ ResetInitialValue()

override void MoreMountains.Feedbacks.MMSpringColorComponent< T >.ResetInitialValue ( )
virtual

Sets the current value of this spring as its new initial value, overriding the previous one

Reimplemented from MoreMountains.Feedbacks.MMSpringComponentBase.

◆ RestoreInitialValue()

override void MoreMountains.Feedbacks.MMSpringColorComponent< T >.RestoreInitialValue ( )
virtual

Restores this spring's initial value

Reimplemented from MoreMountains.Feedbacks.MMSpringComponentBase.

◆ Stop()

override void MoreMountains.Feedbacks.MMSpringColorComponent< T >.Stop ( )
virtual

Stops all value movement on this spring

Reimplemented from MoreMountains.Feedbacks.MMSpringComponentBase.

◆ TestBump()

override void MoreMountains.Feedbacks.MMSpringColorComponent< T >.TestBump ( )
protectedvirtual

◆ TestBumpRandom()

override void MoreMountains.Feedbacks.MMSpringColorComponent< T >.TestBumpRandom ( )
protectedvirtual

◆ TestMoveTo()

override void MoreMountains.Feedbacks.MMSpringColorComponent< T >.TestMoveTo ( )
protectedvirtual

◆ TestMoveToAdditive()

override void MoreMountains.Feedbacks.MMSpringColorComponent< T >.TestMoveToAdditive ( )
protectedvirtual

◆ TestMoveToInstant()

override void MoreMountains.Feedbacks.MMSpringColorComponent< T >.TestMoveToInstant ( )
protectedvirtual

◆ TestMoveToRandom()

override void MoreMountains.Feedbacks.MMSpringColorComponent< T >.TestMoveToRandom ( )
protectedvirtual

◆ TestMoveToSubtractive()

override void MoreMountains.Feedbacks.MMSpringColorComponent< T >.TestMoveToSubtractive ( )
protectedvirtual

◆ UpdateSpringValue()

override void MoreMountains.Feedbacks.MMSpringColorComponent< T >.UpdateSpringValue ( )
protectedvirtual

Updates the spring's target value

Reimplemented from MoreMountains.Feedbacks.MMSpringComponentBase.

Member Data Documentation

◆ _bumping

bool MoreMountains.Feedbacks.MMSpringColorComponent< T >._bumping = false
protected

◆ _bumpTargetColor

Color MoreMountains.Feedbacks.MMSpringColorComponent< T >._bumpTargetColor
protected

◆ _coroutine

Coroutine MoreMountains.Feedbacks.MMSpringColorComponent< T >._coroutine
protected

◆ _initialBumpColor

Color MoreMountains.Feedbacks.MMSpringColorComponent< T >._initialBumpColor
protected

◆ _newBumpColor

Color MoreMountains.Feedbacks.MMSpringColorComponent< T >._newBumpColor
protected

◆ BumpMultiplier

float MoreMountains.Feedbacks.MMSpringColorComponent< T >.BumpMultiplier = 20f

the multiplier to apply when bumping this color spring (increase this if you're not getting enough of the bump color on bump)

◆ BumpRandomColorMax

Color MoreMountains.Feedbacks.MMSpringColorComponent< T >.BumpRandomColorMax = MMColors.Plum

the max color from which to pick a random color in BumpRandom mode

◆ BumpRandomColorMin

Color MoreMountains.Feedbacks.MMSpringColorComponent< T >.BumpRandomColorMin = MMColors.HotPink

the min color from which to pick a random color in BumpRandom mode

◆ BumpToToolbar

◆ Channel

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

◆ ChannelMode

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

◆ ColorSpring

the spring definition driving all sub spring components for this color spring

◆ MMChannelDefinition

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

◆ MoveToRandomColorMax

Color MoreMountains.Feedbacks.MMSpringColorComponent< T >.MoveToRandomColorMax = MMColors.MediumSeaGreen

the max color from which to pick a random color in MoveToRandom mode

◆ MoveToRandomColorMin

Color MoreMountains.Feedbacks.MMSpringColorComponent< T >.MoveToRandomColorMin = MMColors.LawnGreen

the min color from which to pick a random color in MoveToRandom mode

◆ MoveToToolbar

◆ OtherControlsToToolbar

bool MoreMountains.Feedbacks.MMSpringColorComponent< T >.OtherControlsToToolbar

◆ Target

◆ TestBumpColor

Color MoreMountains.Feedbacks.MMSpringColorComponent< T >.TestBumpColor = MMColors.Orange

the amount by which to bump this spring when interacting with the Bump debug button in its inspector

◆ TestMoveToColor

Color MoreMountains.Feedbacks.MMSpringColorComponent< T >.TestMoveToColor = MMColors.Aquamarine

the value to move this spring to when interacting with any of the MoveTo debug buttons in its inspector

◆ TimeScaleMode

whether this spring should run on scaled time (and be impacted by time scale changes) or unscaled time (and not be impacted by time scale changes)

Property Documentation

◆ DeltaTime

◆ LowVelocity

override bool MoreMountains.Feedbacks.MMSpringColorComponent< T >.LowVelocity
get

◆ TargetColor

virtual Color MoreMountains.Feedbacks.MMSpringColorComponent< T >.TargetColor
getset

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