Feel  5.1
The best way to improve your game's feel and make it extra juicy
MoreMountains.Feedbacks.MMCameraShaker Class Reference

A class to add to your camera. It'll listen to MMCameraShakeEvents and will shake your camera accordingly More...

Inheritance diagram for MoreMountains.Feedbacks.MMCameraShaker:
MoreMountains.Feedbacks.MMCameraShakerRotation

Public Member Functions

virtual void ShakeCamera (float duration, float amplitude, float frequency, float amplitudeX, float amplitudeY, float amplitudeZ, bool useUnscaledTime)
 Shakes the camera for Duration seconds, by the desired amplitude and frequency More...
 
virtual void OnCameraShakeEvent (float duration, float amplitude, float frequency, float amplitudeX, float amplitudeY, float amplitudeZ, bool infinite, MMChannelData channelData, bool useUnscaledTime)
 When a MMCameraShakeEvent is caught, shakes the camera More...
 

Public Attributes

MMChannelModes ChannelMode = MMChannelModes.Int
 
int Channel = 0
 the channel to listen to - has to match the one on the feedback More...
 
MMChannel MMChannelDefinition = null
 
float CooldownBetweenShakes = 0f
 a cooldown, in seconds, after a shake, during which no other shake can start More...
 

Protected Member Functions

virtual void Awake ()
 On Awake, grabs the MMShaker component More...
 
virtual void OnEnable ()
 On enable, starts listening for events More...
 
virtual void OnDisable ()
 On disable, stops listening to events More...
 

Protected Attributes

MMWiggle _wiggle
 
float _shakeStartedTimestamp = -Single.MaxValue
 

Detailed Description

A class to add to your camera. It'll listen to MMCameraShakeEvents and will shake your camera accordingly

Member Function Documentation

◆ Awake()

virtual void MoreMountains.Feedbacks.MMCameraShaker.Awake ( )
protectedvirtual

On Awake, grabs the MMShaker component

◆ OnCameraShakeEvent()

virtual void MoreMountains.Feedbacks.MMCameraShaker.OnCameraShakeEvent ( float  duration,
float  amplitude,
float  frequency,
float  amplitudeX,
float  amplitudeY,
float  amplitudeZ,
bool  infinite,
MMChannelData  channelData,
bool  useUnscaledTime 
)
virtual

When a MMCameraShakeEvent is caught, shakes the camera

Parameters
shakeEventShake event.

◆ OnDisable()

virtual void MoreMountains.Feedbacks.MMCameraShaker.OnDisable ( )
protectedvirtual

On disable, stops listening to events

◆ OnEnable()

virtual void MoreMountains.Feedbacks.MMCameraShaker.OnEnable ( )
protectedvirtual

On enable, starts listening for events

◆ ShakeCamera()

virtual void MoreMountains.Feedbacks.MMCameraShaker.ShakeCamera ( float  duration,
float  amplitude,
float  frequency,
float  amplitudeX,
float  amplitudeY,
float  amplitudeZ,
bool  useUnscaledTime 
)
virtual

Shakes the camera for Duration seconds, by the desired amplitude and frequency

Parameters
durationDuration.
amplitudeAmplitude.
frequencyFrequency.

Reimplemented in MoreMountains.Feedbacks.MMCameraShakerRotation.

Member Data Documentation

◆ _shakeStartedTimestamp

float MoreMountains.Feedbacks.MMCameraShaker._shakeStartedTimestamp = -Single.MaxValue
protected

◆ _wiggle

MMWiggle MoreMountains.Feedbacks.MMCameraShaker._wiggle
protected

◆ Channel

int MoreMountains.Feedbacks.MMCameraShaker.Channel = 0

the channel to listen to - has to match the one on the feedback

◆ ChannelMode

MMChannelModes MoreMountains.Feedbacks.MMCameraShaker.ChannelMode = MMChannelModes.Int

whether to listen on a channel defined by an int or by a MMChannel scriptable object. Ints are simple to setup but can get messy and make it harder to remember what int corresponds to what. MMChannel scriptable objects require you to create them in advance, but come with a readable name and are more scalable

◆ CooldownBetweenShakes

float MoreMountains.Feedbacks.MMCameraShaker.CooldownBetweenShakes = 0f

a cooldown, in seconds, after a shake, during which no other shake can start

◆ MMChannelDefinition

MMChannel MoreMountains.Feedbacks.MMCameraShaker.MMChannelDefinition = null

the MMChannel definition asset to use to listen for events. The feedbacks targeting this shaker will have to reference that same MMChannel definition to receive events - to create a MMChannel, right click anywhere in your project (usually in a Data folder) and go MoreMountains > MMChannel, then name it with some unique name


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