Corgi Engine v10.1
Loading...
Searching...
No Matches
MoreMountains.Feedbacks.MMF_ShaderGlobal Class Reference

Turns an object active or inactive at the various stages of the feedback. More...

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

Public Types

enum  Modes {
  SetGlobalColor , SetGlobalFloat , SetGlobalInt , SetGlobalMatrix ,
  SetGlobalTexture , SetGlobalVector , EnableKeyword , DisableKeyword ,
  WarmupAllShaders
}
 sets the inspector color for this feedback More...

Public Attributes

Modes Mode = Modes.SetGlobalFloat
 the selected mode for this feedback
string PropertyName = ""
 the name of the global property
int PropertyNameID = 0
 the name ID of the property retrieved by Shader.PropertyToID
Color GlobalColor = Color.yellow
 a global color property for all shaders
float GlobalFloat = 1f
 a global float property for all shaders
int GlobalInt = 1
 a global int property for all shaders
Matrix4x4 GlobalMatrix = Matrix4x4.identity
 a global matrix property for all shaders
RenderTexture GlobalTexture
 a global texture property for all shaders
Vector4 GlobalVector
 a global vector property for all shaders
string Keyword
 a global shader keyword
bool InterpolateValue = false
 whether or not to interpolate the value over time. If set to false, the change will be instant. Only applies to Color, Float, Int, and Vector modes.
float Duration = 2f
 the duration of the interpolation
MMTweenType InterpolationCurve = new MMTweenType(new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.3f, 1f), new Keyframe(1, 0)), "InterpolateValue")
 the curve over which to interpolate the value

Static Public Attributes

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

Protected Member Functions

virtual bool CanInterpolate ()
 Returns true if the current Mode supports interpolation.
override void CustomInitialization (MMF_Player owner)
 On init we capture the initial values of the global shader properties for interpolation and restore.
virtual void GetInitialValues ()
 Captures the current global shader property values for later use in interpolation and restore.
override void CustomPlayFeedback (Vector3 position, float feedbacksIntensity=1.0f)
 On Play we set our global shader property, either instantly or interpolated over time.
virtual void ApplyGlobalValue ()
 Applies the global shader value instantly (no interpolation)
virtual IEnumerator InterpolationSequenceCo (float intensityMultiplier)
 An internal coroutine used to interpolate the value over time.
virtual void SetValueAtTime (float t, float intensityMultiplier)
 Sets the value of the global shader property at a given normalized time during interpolation.
override void CustomStopFeedback (Vector3 position, float feedbacksIntensity=1)
 Stops this feedback.
override void CustomRestoreInitialValues ()
 On restore, we restore our initial state.
virtual void SetGlobalColor (Color color)
 Sets a global color on the shader, using either PropertyName or PropertyNameID.
virtual void SetGlobalFloat (float value)
 Sets a global float on the shader, using either PropertyName or PropertyNameID.
virtual void SetGlobalInt (int value)
 Sets a global int on the shader, using either PropertyName or PropertyNameID.
virtual void SetGlobalMatrix (Matrix4x4 matrix)
 Sets a global matrix on the shader, using either PropertyName or PropertyNameID.
virtual void SetGlobalTexture (Texture texture)
 Sets a global texture on the shader, using either PropertyName or PropertyNameID.
virtual void SetGlobalVector (Vector4 vector)
 Sets a global vector on the shader, using either PropertyName or PropertyNameID.

Protected Attributes

Color _initialColor
float _initialFloat
int _initialInt
Matrix4x4 _initialMatrix
RenderTexture _initialTexture
Vector4 _initialVector
Coroutine _coroutine
Color _newColor
Vector4 _newVector

Properties

override float FeedbackDuration [get, set]

Additional Inherited Members

Detailed Description

Turns an object active or inactive at the various stages of the feedback.

Member Enumeration Documentation

◆ Modes

sets the inspector color for this feedback

Enumerator
SetGlobalColor 
SetGlobalFloat 
SetGlobalInt 
SetGlobalMatrix 
SetGlobalTexture 
SetGlobalVector 
EnableKeyword 
DisableKeyword 
WarmupAllShaders 

Member Function Documentation

◆ ApplyGlobalValue()

virtual void MoreMountains.Feedbacks.MMF_ShaderGlobal.ApplyGlobalValue ( )
protectedvirtual

Applies the global shader value instantly (no interpolation)

◆ CanInterpolate()

virtual bool MoreMountains.Feedbacks.MMF_ShaderGlobal.CanInterpolate ( )
protectedvirtual

Returns true if the current Mode supports interpolation.

◆ CustomInitialization()

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

On init we capture the initial values of the global shader properties for interpolation and restore.

Reimplemented from MoreMountains.Feedbacks.MMF_Feedback.

◆ CustomPlayFeedback()

override void MoreMountains.Feedbacks.MMF_ShaderGlobal.CustomPlayFeedback ( Vector3 position,
float feedbacksIntensity = 1::0f )
protected

On Play we set our global shader property, either instantly or interpolated over time.

Parameters
position
feedbacksIntensity

◆ CustomRestoreInitialValues()

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

On restore, we restore our initial state.

Reimplemented from MoreMountains.Feedbacks.MMF_Feedback.

◆ CustomStopFeedback()

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

Stops this feedback.

Reimplemented from MoreMountains.Feedbacks.MMF_Feedback.

◆ GetInitialValues()

virtual void MoreMountains.Feedbacks.MMF_ShaderGlobal.GetInitialValues ( )
protectedvirtual

Captures the current global shader property values for later use in interpolation and restore.

◆ InterpolationSequenceCo()

virtual IEnumerator MoreMountains.Feedbacks.MMF_ShaderGlobal.InterpolationSequenceCo ( float intensityMultiplier)
protectedvirtual

An internal coroutine used to interpolate the value over time.

◆ SetGlobalColor()

virtual void MoreMountains.Feedbacks.MMF_ShaderGlobal.SetGlobalColor ( Color color)
protectedvirtual

Sets a global color on the shader, using either PropertyName or PropertyNameID.

◆ SetGlobalFloat()

virtual void MoreMountains.Feedbacks.MMF_ShaderGlobal.SetGlobalFloat ( float value)
protectedvirtual

Sets a global float on the shader, using either PropertyName or PropertyNameID.

◆ SetGlobalInt()

virtual void MoreMountains.Feedbacks.MMF_ShaderGlobal.SetGlobalInt ( int value)
protectedvirtual

Sets a global int on the shader, using either PropertyName or PropertyNameID.

◆ SetGlobalMatrix()

virtual void MoreMountains.Feedbacks.MMF_ShaderGlobal.SetGlobalMatrix ( Matrix4x4 matrix)
protectedvirtual

Sets a global matrix on the shader, using either PropertyName or PropertyNameID.

◆ SetGlobalTexture()

virtual void MoreMountains.Feedbacks.MMF_ShaderGlobal.SetGlobalTexture ( Texture texture)
protectedvirtual

Sets a global texture on the shader, using either PropertyName or PropertyNameID.

◆ SetGlobalVector()

virtual void MoreMountains.Feedbacks.MMF_ShaderGlobal.SetGlobalVector ( Vector4 vector)
protectedvirtual

Sets a global vector on the shader, using either PropertyName or PropertyNameID.

◆ SetValueAtTime()

virtual void MoreMountains.Feedbacks.MMF_ShaderGlobal.SetValueAtTime ( float t,
float intensityMultiplier )
protectedvirtual

Sets the value of the global shader property at a given normalized time during interpolation.

Member Data Documentation

◆ _coroutine

Coroutine MoreMountains.Feedbacks.MMF_ShaderGlobal._coroutine
protected

◆ _initialColor

Color MoreMountains.Feedbacks.MMF_ShaderGlobal._initialColor
protected

◆ _initialFloat

float MoreMountains.Feedbacks.MMF_ShaderGlobal._initialFloat
protected

◆ _initialInt

int MoreMountains.Feedbacks.MMF_ShaderGlobal._initialInt
protected

◆ _initialMatrix

Matrix4x4 MoreMountains.Feedbacks.MMF_ShaderGlobal._initialMatrix
protected

◆ _initialTexture

RenderTexture MoreMountains.Feedbacks.MMF_ShaderGlobal._initialTexture
protected

◆ _initialVector

Vector4 MoreMountains.Feedbacks.MMF_ShaderGlobal._initialVector
protected

◆ _newColor

Color MoreMountains.Feedbacks.MMF_ShaderGlobal._newColor
protected

◆ _newVector

Vector4 MoreMountains.Feedbacks.MMF_ShaderGlobal._newVector
protected

◆ Duration

float MoreMountains.Feedbacks.MMF_ShaderGlobal.Duration = 2f

the duration of the interpolation

◆ FeedbackTypeAuthorized

bool MoreMountains.Feedbacks.MMF_ShaderGlobal.FeedbackTypeAuthorized = true
static

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

◆ GlobalColor

Color MoreMountains.Feedbacks.MMF_ShaderGlobal.GlobalColor = Color.yellow

a global color property for all shaders

◆ GlobalFloat

float MoreMountains.Feedbacks.MMF_ShaderGlobal.GlobalFloat = 1f

a global float property for all shaders

◆ GlobalInt

int MoreMountains.Feedbacks.MMF_ShaderGlobal.GlobalInt = 1

a global int property for all shaders

◆ GlobalMatrix

Matrix4x4 MoreMountains.Feedbacks.MMF_ShaderGlobal.GlobalMatrix = Matrix4x4.identity

a global matrix property for all shaders

◆ GlobalTexture

RenderTexture MoreMountains.Feedbacks.MMF_ShaderGlobal.GlobalTexture

a global texture property for all shaders

◆ GlobalVector

Vector4 MoreMountains.Feedbacks.MMF_ShaderGlobal.GlobalVector

a global vector property for all shaders

◆ InterpolateValue

bool MoreMountains.Feedbacks.MMF_ShaderGlobal.InterpolateValue = false

whether or not to interpolate the value over time. If set to false, the change will be instant. Only applies to Color, Float, Int, and Vector modes.

◆ InterpolationCurve

MMTweenType MoreMountains.Feedbacks.MMF_ShaderGlobal.InterpolationCurve = new MMTweenType(new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.3f, 1f), new Keyframe(1, 0)), "InterpolateValue")

the curve over which to interpolate the value

◆ Keyword

string MoreMountains.Feedbacks.MMF_ShaderGlobal.Keyword

a global shader keyword

◆ Mode

Modes MoreMountains.Feedbacks.MMF_ShaderGlobal.Mode = Modes.SetGlobalFloat

the selected mode for this feedback

◆ PropertyName

string MoreMountains.Feedbacks.MMF_ShaderGlobal.PropertyName = ""

the name of the global property

◆ PropertyNameID

int MoreMountains.Feedbacks.MMF_ShaderGlobal.PropertyNameID = 0

the name ID of the property retrieved by Shader.PropertyToID

Property Documentation

◆ FeedbackDuration

override float MoreMountains.Feedbacks.MMF_ShaderGlobal.FeedbackDuration
getset

The documentation for this class was generated from the following file:
  • Assets/CorgiEngine/ThirdParty/MoreMountains/MMFeedbacks/MMFeedbacks/Feedbacks/MMF_ShaderGlobal.cs