Feel 5.9.1
The best way to improve your game's feel and make it extra juicy
Loading...
Searching...
No Matches
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 }

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
List< Renderer > ExtraBoundRenderers
 more renderers to flicker when played
Modes Mode = Modes.Color
 the selected mode to flicker the renderer
string PropertyName = "_Tint"
 the name of the property to target
float FlickerDuration = 0.2f
 the duration of the flicker when getting damage
float FlickerPeriod = 0.04f
 the duration of the period for the flicker
Color FlickerColor = new Color32(255, 20, 20, 255)
 the color we should flicker the sprite to
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
bool UseMaterialPropertyBlocks = false
 if this is true, this component will use material property blocks instead of working on an instance of the material.
string SpriteRendererTextureProperty = "_MainTex"
 if using material property blocks on a sprite renderer, you'll want to make sure the sprite texture gets passed to the block when updating it. For that, you need to specify your sprite's material's shader's texture property name. If you're not working with a sprite renderer, you can safely ignore this.

Static Public Attributes

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

Protected Member Functions

override void AutomateTargetAcquisition ()
 A method meant to be implemented per feedback letting you specify what happens (usually setting a target)
override void CustomInitialization (MMF_Player owner)
 On init we grab our initial color and components.
virtual void AcquireRenderers (MMF_Player owner)
virtual void StoreSpriteRendererTexture ()
override void CustomPlayFeedback (Vector3 position, float feedbacksIntensity=1.0f)
 On play we make our renderer flicker.
override void CustomReset ()
 On reset we make our renderer stop flickering.
virtual void SetStoredSpriteRendererTexture (Renderer renderer, MaterialPropertyBlock block)
virtual void SetColor (Renderer renderer, int materialIndex, Color color)
override void CustomStopFeedback (Vector3 position, float feedbacksIntensity=1)
 Stops this feedback.
override void CustomRestoreInitialValues ()
 On restore, we put our object back at its initial position.

Protected Attributes

int[] _propertyIDs
bool[] _propertiesFound
bool _spriteRendererIsNull
Coroutine[] _coroutines
List< Coroutine[]> _extraCoroutines
Color[] _initialFlickerColors
List< Color[]> _extraInitialFlickerColors
MaterialPropertyBlock _propertyBlock
List< MaterialPropertyBlock > _extraPropertyBlocks
SpriteRenderer _spriteRenderer
List< SpriteRenderer > _spriteRenderers
Texture2D _spriteRendererTexture
List< Texture2D > _spriteRendererTextures

Static Protected Attributes

const string _colorPropertyName = "_Color"

Properties

override bool HasAutomatedTargetAcquisition [get]
 sets the inspector color for this feedback
override float FeedbackDuration [get, set]
 the duration of this feedback is the duration of the flicker

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

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

Enumerator
Color 
PropertyName 

Member Function Documentation

◆ AcquireRenderers()

virtual void MoreMountains.Feedbacks.MMF_Flicker.AcquireRenderers ( MMF_Player owner)
protectedvirtual

◆ AutomateTargetAcquisition()

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

A method meant to be implemented per feedback letting you specify what happens (usually setting a target)

Reimplemented from MoreMountains.Feedbacks.MMF_Feedback.

◆ 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 )
protected

On play we make our renderer flicker.

Parameters
position
feedbacksIntensity

◆ CustomReset()

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

On reset we make our renderer stop flickering.

Reimplemented from MoreMountains.Feedbacks.MMF_Feedback.

◆ CustomRestoreInitialValues()

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

On restore, we put our object back at its initial position.

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 ( Renderer renderer,
int materialIndex,
Color color )
protectedvirtual

◆ SetStoredSpriteRendererTexture()

virtual void MoreMountains.Feedbacks.MMF_Flicker.SetStoredSpriteRendererTexture ( Renderer renderer,
MaterialPropertyBlock block )
protectedvirtual

◆ StoreSpriteRendererTexture()

virtual void MoreMountains.Feedbacks.MMF_Flicker.StoreSpriteRendererTexture ( )
protectedvirtual

Member Data Documentation

◆ _colorPropertyName

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

◆ _coroutines

Coroutine [] MoreMountains.Feedbacks.MMF_Flicker._coroutines
protected

◆ _extraCoroutines

List<Coroutine[]> MoreMountains.Feedbacks.MMF_Flicker._extraCoroutines
protected

◆ _extraInitialFlickerColors

List<Color[]> MoreMountains.Feedbacks.MMF_Flicker._extraInitialFlickerColors
protected

◆ _extraPropertyBlocks

List<MaterialPropertyBlock> MoreMountains.Feedbacks.MMF_Flicker._extraPropertyBlocks
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

◆ _spriteRenderer

SpriteRenderer MoreMountains.Feedbacks.MMF_Flicker._spriteRenderer
protected

◆ _spriteRendererIsNull

bool MoreMountains.Feedbacks.MMF_Flicker._spriteRendererIsNull
protected

◆ _spriteRenderers

List<SpriteRenderer> MoreMountains.Feedbacks.MMF_Flicker._spriteRenderers
protected

◆ _spriteRendererTexture

Texture2D MoreMountains.Feedbacks.MMF_Flicker._spriteRendererTexture
protected

◆ _spriteRendererTextures

List<Texture2D> MoreMountains.Feedbacks.MMF_Flicker._spriteRendererTextures
protected

◆ BoundRenderer

Renderer MoreMountains.Feedbacks.MMF_Flicker.BoundRenderer

the renderer to flicker when played

◆ ExtraBoundRenderers

List<Renderer> MoreMountains.Feedbacks.MMF_Flicker.ExtraBoundRenderers

more renderers 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

◆ FlickerPeriod

float MoreMountains.Feedbacks.MMF_Flicker.FlickerPeriod = 0.04f

the duration of the period for the 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

◆ SpriteRendererTextureProperty

string MoreMountains.Feedbacks.MMF_Flicker.SpriteRendererTextureProperty = "_MainTex"

if using material property blocks on a sprite renderer, you'll want to make sure the sprite texture gets passed to the block when updating it. For that, you need to specify your sprite's material's shader's texture property name. If you're not working with a sprite renderer, you can safely ignore this.

◆ 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

◆ HasAutomatedTargetAcquisition

override bool MoreMountains.Feedbacks.MMF_Flicker.HasAutomatedTargetAcquisition
get

sets the inspector color for this feedback


The documentation for this class was generated from the following file:
  • H:/Code/MoreMountains/feel/Assets/Feel/MMFeedbacks/MMFeedbacks/Feedbacks/MMF_Flicker.cs