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_Material Class Reference
Inheritance diagram for MoreMountains.Feedbacks.MMF_Material:
MoreMountains.Feedbacks.MMF_Feedback

Public Types

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

Public Member Functions

virtual float GetTime ()
virtual float GetDeltaTime ()

Public Attributes

Renderer TargetRenderer
 the renderer to change material on
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
Methods Method
 the selected method
bool Loop = true
 whether or not the sequential order should loop
bool AlwaysNewMaterial = true
 whether or not to always pick a new material in random mode
int InitialIndex = 0
 the initial index to start with
List< Material > Materials
 the list of materials to pick from
bool InterpolateTransition = false
float TransitionDuration = 1f
 the duration of the interpolation, in seconds
AnimationCurve TransitionCurve = new AnimationCurve(new Keyframe(0, 0), new Keyframe(1, 1))
 the animation curve to interpolate the transition on

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, grabs the current index.
virtual void InitializeMaterials ()
override void CustomPlayFeedback (Vector3 position, float feedbacksIntensity=1.0f)
 On play feedback, we change the material if possible.
virtual void ApplyMaterial (Material material)
 Applies the new material to all indexes.
virtual void LerpMaterial (Material fromMaterial, Material toMaterial, float t, int materialIndex)
 Lerps to destination material for all indexes.
virtual IEnumerator TransitionMaterial (Material originalMaterial, Material newMaterial, int materialIndex)
 A coroutine used to interpolate between materials.
virtual int DetermineNextIndex ()
 Determines the new material to pick.
override void CustomStopFeedback (Vector3 position, float feedbacksIntensity=1)
 Stops the transition on stop if needed.
override void CustomRestoreInitialValues ()
 On restore, we put our object back at its initial position.

Protected Attributes

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

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 shake

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

On play feedback, we change the material if possible.

Parameters
position
feedbacksIntensity

◆ 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

◆ 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

◆ HasAutomatedTargetAcquisition

override bool MoreMountains.Feedbacks.MMF_Material.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_Material.cs