Infinite Runner Engine v1.9
Public Types | Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes | Properties | List of all members
MoreMountains.Feedbacks.MMF_Flicker Class Reference

This feedback will make the bound renderer flicker for the set duration when played (and restore its initial color when stopped) More...

Inheritance diagram for MoreMountains.Feedbacks.MMF_Flicker:
MoreMountains.Feedbacks.MMF_Feedback

Public Types

enum  Modes { Color , PropertyName }
 sets the inspector color for this feedback More...
 

Public Member Functions

virtual IEnumerator Flicker (Renderer renderer, int materialIndex, Color initialColor, Color flickerColor, float flickerSpeed, float flickerDuration)
 

Public Attributes

Renderer BoundRenderer
 the renderer to flicker when played More...
 
Modes Mode = Modes.Color
 the selected mode to flicker the renderer More...
 
string PropertyName = "_Tint"
 the name of the property to target More...
 
float FlickerDuration = 0.2f
 the duration of the flicker when getting damage More...
 
float FlickerOctave = 0.04f
 the frequency at which to flicker More...
 
Color FlickerColor = new Color32(255, 20, 20, 255)
 the color we should flicker the sprite to More...
 
int[] MaterialIndexes
 the list of material indexes we want to flicker on the target renderer. If left empty, will only target the material at index 0 More...
 
bool UseMaterialPropertyBlocks = false
 if this is true, this component will use material property blocks instead of working on an instance of the material. More...
 

Static Public Attributes

static bool FeedbackTypeAuthorized = true
 a static bool used to disable all feedbacks of this type at once More...
 

Protected Member Functions

override void CustomInitialization (MMF_Player owner)
 On init we grab our initial color and components More...
 
override void CustomPlayFeedback (Vector3 position, float feedbacksIntensity=1.0f)
 On play we make our renderer flicker More...
 
override void CustomReset ()
 On reset we make our renderer stop flickering More...
 
virtual void SetColor (int materialIndex, Color color)
 
override void CustomStopFeedback (Vector3 position, float feedbacksIntensity=1)
 Stops this feedback More...
 

Protected Attributes

Color[] _initialFlickerColors
 
int[] _propertyIDs
 
bool[] _propertiesFound
 
Coroutine[] _coroutines
 
MaterialPropertyBlock _propertyBlock
 

Static Protected Attributes

const string _colorPropertyName = "_Color"
 

Properties

override float FeedbackDuration [getset]
 the duration of this feedback is the duration of the flicker More...
 

Detailed Description

This feedback will make the bound renderer flicker for the set duration when played (and restore its initial color when stopped)

Member Enumeration Documentation

◆ Modes

sets the inspector color for this feedback

the possible modes Color : will control material.color PropertyName : will target a specific shader property by name

Enumerator
Color 
PropertyName 

Member Function Documentation

◆ CustomInitialization()

override void MoreMountains.Feedbacks.MMF_Flicker.CustomInitialization ( MMF_Player  owner)
protectedvirtual

On init we grab our initial color and components

Parameters
owner

Reimplemented from MoreMountains.Feedbacks.MMF_Feedback.

◆ CustomPlayFeedback()

override void MoreMountains.Feedbacks.MMF_Flicker.CustomPlayFeedback ( Vector3  position,
float  feedbacksIntensity = 1.0f 
)
protectedvirtual

On play we make our renderer flicker

Parameters
position
feedbacksIntensity

Implements MoreMountains.Feedbacks.MMF_Feedback.

◆ CustomReset()

override void MoreMountains.Feedbacks.MMF_Flicker.CustomReset ( )
protectedvirtual

On reset we make our renderer stop flickering

Reimplemented from MoreMountains.Feedbacks.MMF_Feedback.

◆ CustomStopFeedback()

override void MoreMountains.Feedbacks.MMF_Flicker.CustomStopFeedback ( Vector3  position,
float  feedbacksIntensity = 1 
)
protectedvirtual

Stops this feedback

Parameters
position
feedbacksIntensity

Reimplemented from MoreMountains.Feedbacks.MMF_Feedback.

◆ Flicker()

virtual IEnumerator MoreMountains.Feedbacks.MMF_Flicker.Flicker ( Renderer  renderer,
int  materialIndex,
Color  initialColor,
Color  flickerColor,
float  flickerSpeed,
float  flickerDuration 
)
virtual

◆ SetColor()

virtual void MoreMountains.Feedbacks.MMF_Flicker.SetColor ( int  materialIndex,
Color  color 
)
protectedvirtual

Member Data Documentation

◆ _colorPropertyName

const string MoreMountains.Feedbacks.MMF_Flicker._colorPropertyName = "_Color"
staticprotected

◆ _coroutines

Coroutine [] MoreMountains.Feedbacks.MMF_Flicker._coroutines
protected

◆ _initialFlickerColors

Color [] MoreMountains.Feedbacks.MMF_Flicker._initialFlickerColors
protected

◆ _propertiesFound

bool [] MoreMountains.Feedbacks.MMF_Flicker._propertiesFound
protected

◆ _propertyBlock

MaterialPropertyBlock MoreMountains.Feedbacks.MMF_Flicker._propertyBlock
protected

◆ _propertyIDs

int [] MoreMountains.Feedbacks.MMF_Flicker._propertyIDs
protected

◆ BoundRenderer

Renderer MoreMountains.Feedbacks.MMF_Flicker.BoundRenderer

the renderer to flicker when played

◆ FeedbackTypeAuthorized

bool MoreMountains.Feedbacks.MMF_Flicker.FeedbackTypeAuthorized = true
static

a static bool used to disable all feedbacks of this type at once

◆ FlickerColor

Color MoreMountains.Feedbacks.MMF_Flicker.FlickerColor = new Color32(255, 20, 20, 255)

the color we should flicker the sprite to

◆ FlickerDuration

float MoreMountains.Feedbacks.MMF_Flicker.FlickerDuration = 0.2f

the duration of the flicker when getting damage

◆ FlickerOctave

float MoreMountains.Feedbacks.MMF_Flicker.FlickerOctave = 0.04f

the frequency at which to flicker

◆ MaterialIndexes

int [] MoreMountains.Feedbacks.MMF_Flicker.MaterialIndexes

the list of material indexes we want to flicker on the target renderer. If left empty, will only target the material at index 0

◆ Mode

Modes MoreMountains.Feedbacks.MMF_Flicker.Mode = Modes.Color

the selected mode to flicker the renderer

◆ PropertyName

string MoreMountains.Feedbacks.MMF_Flicker.PropertyName = "_Tint"

the name of the property to target

◆ UseMaterialPropertyBlocks

bool MoreMountains.Feedbacks.MMF_Flicker.UseMaterialPropertyBlocks = false

if this is true, this component will use material property blocks instead of working on an instance of the material.

Property Documentation

◆ FeedbackDuration

override float MoreMountains.Feedbacks.MMF_Flicker.FeedbackDuration
getset

the duration of this feedback is the duration of the flicker


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