Feel  4.3
The best way to improve your game's feel and make it extra juicy
MoreMountains.Feedbacks.MMF_Material Class Reference
Inheritance diagram for MoreMountains.Feedbacks.MMF_Material:
MoreMountains.Feedbacks.MMF_Feedback

Public Types

enum  Methods { Methods.Sequential, Methods.Random }
 the possible methods to switch materials More...
 

Public Member Functions

virtual float GetTime ()
 
virtual float GetDeltaTime ()
 

Public Attributes

override bool HasAutomatedTargetAcquisition => true
 sets the inspector color for this feedback More...
 
Renderer TargetRenderer
 the renderer to change material on More...
 
int[] RendererMaterialIndexes
 the list of material indexes we want to change on the target renderer. If left empty, will only target the material at index 0 More...
 
Methods Method
 the selected method More...
 
bool Loop = true
 whether or not the sequential order should loop More...
 
bool AlwaysNewMaterial = true
 whether or not to always pick a new material in random mode More...
 
int InitialIndex = 0
 the initial index to start with More...
 
List< Material > Materials
 the list of materials to pick from More...
 
bool InterpolateTransition = false
 
float TransitionDuration = 1f
 the duration of the interpolation, in seconds More...
 
AnimationCurve TransitionCurve = new AnimationCurve(new Keyframe(0, 0), new Keyframe(1, 1))
 the animation curve to interpolate the transition on 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 AutomateTargetAcquisition ()
 A method meant to be implemented per feedback letting you specify what happens (usually setting a target) More...
 
override void CustomInitialization (MMF_Player owner)
 On init, grabs the current index More...
 
virtual void InitializeMaterials ()
 
override void CustomPlayFeedback (Vector3 position, float feedbacksIntensity=1.0f)
 On play feedback, we change the material if possible More...
 
virtual void ApplyMaterial (Material material)
 Applies the new material to all indexes More...
 
virtual void LerpMaterial (Material fromMaterial, Material toMaterial, float t, int materialIndex)
 Lerps to destination material for all indexes More...
 
virtual IEnumerator TransitionMaterial (Material originalMaterial, Material newMaterial, int materialIndex)
 A coroutine used to interpolate between materials More...
 
virtual int DetermineNextIndex ()
 Determines the new material to pick More...
 
override void CustomStopFeedback (Vector3 position, float feedbacksIntensity=1)
 Stops the transition on stop if needed More...
 
override void CustomRestoreInitialValues ()
 On restore, we put our object back at its initial position More...
 

Protected Attributes

int _currentIndex
 
float _startedAt
 
Coroutine[] _coroutines
 
Material[] _tempMaterials
 
Material[] _initialMaterials
 

Properties

override float? FeedbackDuration [get, set]
 the duration of this feedback is the duration of the shake More...
 

Member Enumeration Documentation

◆ Methods

the possible methods to switch materials

Enumerator
Sequential 
Random 

Member Function Documentation

◆ ApplyMaterial()

virtual void MoreMountains.Feedbacks.MMF_Material.ApplyMaterial ( Material  material)
protectedvirtual

Applies the new material to all indexes

Parameters
material

◆ AutomateTargetAcquisition()

override void MoreMountains.Feedbacks.MMF_Material.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_Material.CustomInitialization ( MMF_Player  owner)
protectedvirtual

On init, grabs the current index

Parameters
owner

Reimplemented from MoreMountains.Feedbacks.MMF_Feedback.

◆ CustomPlayFeedback()

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

On play feedback, we change the material if possible

Parameters
position
feedbacksIntensity

Implements MoreMountains.Feedbacks.MMF_Feedback.

◆ CustomRestoreInitialValues()

override void MoreMountains.Feedbacks.MMF_Material.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_Material.CustomStopFeedback ( Vector3  position,
float  feedbacksIntensity = 1 
)
protectedvirtual

Stops the transition on stop if needed

Parameters
position
feedbacksIntensity

Reimplemented from MoreMountains.Feedbacks.MMF_Feedback.

◆ DetermineNextIndex()

virtual int MoreMountains.Feedbacks.MMF_Material.DetermineNextIndex ( )
protectedvirtual

Determines the new material to pick

Returns

◆ GetDeltaTime()

virtual float MoreMountains.Feedbacks.MMF_Material.GetDeltaTime ( )
virtual

◆ GetTime()

virtual float MoreMountains.Feedbacks.MMF_Material.GetTime ( )
virtual

◆ InitializeMaterials()

virtual void MoreMountains.Feedbacks.MMF_Material.InitializeMaterials ( )
protectedvirtual

◆ LerpMaterial()

virtual void MoreMountains.Feedbacks.MMF_Material.LerpMaterial ( Material  fromMaterial,
Material  toMaterial,
float  t,
int  materialIndex 
)
protectedvirtual

Lerps to destination material for all indexes

Parameters
fromMaterial
toMaterial
t
materialIndex

◆ TransitionMaterial()

virtual IEnumerator MoreMountains.Feedbacks.MMF_Material.TransitionMaterial ( Material  originalMaterial,
Material  newMaterial,
int  materialIndex 
)
protectedvirtual

A coroutine used to interpolate between materials

Parameters
originalMaterial
newMaterial
Returns

Member Data Documentation

◆ _coroutines

Coroutine [] MoreMountains.Feedbacks.MMF_Material._coroutines
protected

◆ _currentIndex

int MoreMountains.Feedbacks.MMF_Material._currentIndex
protected

◆ _initialMaterials

Material [] MoreMountains.Feedbacks.MMF_Material._initialMaterials
protected

◆ _startedAt

float MoreMountains.Feedbacks.MMF_Material._startedAt
protected

◆ _tempMaterials

Material [] MoreMountains.Feedbacks.MMF_Material._tempMaterials
protected

◆ AlwaysNewMaterial

bool MoreMountains.Feedbacks.MMF_Material.AlwaysNewMaterial = true

whether or not to always pick a new material in random mode

◆ FeedbackTypeAuthorized

bool MoreMountains.Feedbacks.MMF_Material.FeedbackTypeAuthorized = true
static

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

◆ HasAutomatedTargetAcquisition

override bool MoreMountains.Feedbacks.MMF_Material.HasAutomatedTargetAcquisition => true

sets the inspector color for this feedback

◆ InitialIndex

int MoreMountains.Feedbacks.MMF_Material.InitialIndex = 0

the initial index to start with

◆ InterpolateTransition

bool MoreMountains.Feedbacks.MMF_Material.InterpolateTransition = false

whether or not to interpolate between 2 materials IMPORTANT : this will only work for materials that share the same shader and texture (see https://docs.unity3d.com/ScriptReference/Material.Lerp.html)

◆ Loop

bool MoreMountains.Feedbacks.MMF_Material.Loop = true

whether or not the sequential order should loop

◆ Materials

List<Material> MoreMountains.Feedbacks.MMF_Material.Materials

the list of materials to pick from

◆ Method

Methods MoreMountains.Feedbacks.MMF_Material.Method

the selected method

◆ RendererMaterialIndexes

int [] MoreMountains.Feedbacks.MMF_Material.RendererMaterialIndexes

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

◆ TargetRenderer

Renderer MoreMountains.Feedbacks.MMF_Material.TargetRenderer

the renderer to change material on

◆ TransitionCurve

AnimationCurve MoreMountains.Feedbacks.MMF_Material.TransitionCurve = new AnimationCurve(new Keyframe(0, 0), new Keyframe(1, 1))

the animation curve to interpolate the transition on

◆ TransitionDuration

float MoreMountains.Feedbacks.MMF_Material.TransitionDuration = 1f

the duration of the interpolation, in seconds

Property Documentation

◆ FeedbackDuration

override float? MoreMountains.Feedbacks.MMF_Material.FeedbackDuration
getset

the duration of this feedback is the duration of the shake


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