HEADER

Shake

Overview

The Shake extension, like you probably have guessed, allows you create all kind of different camera shake effects. You can create shake effects that are applied once or multiple times, like explosions and gun fire. Or you can create constant shake effects that are enabled during a certain period of time, like a handheld camera effect or a long earthquake. The shake editor simply lists all the available presets on the current scene. To create new ones press the "Create ShakePreset" or "Create ConstantShakePreset". They'll be automatically added to the list. You can then select each preset individually and tweak the values. All presets live on their own files and all changes are saved even at runtime. This way you can test your shakes during runtime and adjust until you find the perfect values.

Shake once example (explosion)

Shake

Constant shake example (handheld)

Shake Constant

Editor

Parameters:

Shake Preset Editor

Parameters:

Constant Shake Preset Editor

Parameters:

Methods

For runtime implementation of a shake on your game you can use the methods:

Shake(float duration, Vector2 strength, int vibrato, float randomness, float initialAngle, Vector3 rotation, float smoothness)

Or, if you simply want to use one of your presets:

Shake(string presetName)
Shake(int presetIndex)

And if you want to stop all current shakes:

StopShaking()

This extension provides a static instance so it’s easier to call its methods. As an example:

ProCamera2DShake.Instance.Shake();