Camera Shake 1.6.0f1
Reference Manual
|
Shakes the camera and UI. More...
Public Types | |
enum | ShakeType { CameraMatrix, LocalPosition } |
The type of shake to perform on a camera. More... | |
Public Member Functions | |
void | BeginShakeGUI () |
Use this at the beginning of an OnGUI call in order to shake OnGUI with Camera Shake. More... | |
void | BeginShakeGUILayout () |
Use this at the beginning of an OnGUI call in order to shake OnGUI with Camera Shake (uses GUILayout). More... | |
void | CancelShake () |
Cancels and resets a camera shake in progress. More... | |
void | CancelShake (float time) |
Cancels a camera shake in progress, and resets associated cameras over the specified time, in seconds. More... | |
void | EndShakeGUI () |
Use this at the end of an OnGUI call in order to shake OnGUI with Camera Shake. More... | |
void | EndShakeGUILayout () |
Use this at the end of an OnGUI call in order to shake OnGUI with Camera Shake (uses GUILayout). More... | |
bool | IsCancelling () |
Returns true if the camera is currently cancelling a shake action. More... | |
bool | IsShaking () |
Returns true if the camera is currently shaking. More... | |
void | Shake () |
Shake all cameras associated with this component, using the default settings. More... | |
void | Shake (ShakeType shakeType, int numberOfShakes, Vector3 shakeAmount, Vector3 rotationAmount, float distance, float speed, float decay, float uiShakeModifier, bool multiplyByTimeScale) |
Shake all cameras associated with this component, temporarily overriding the default settings. More... | |
void | Shake (System.Action callback) |
Shake all cameras associated with this component (using the default settings), then call the specified callback once completed. More... | |
void | Shake (ShakeType shakeType, int numberOfShakes, Vector3 shakeAmount, Vector3 rotationAmount, float distance, float speed, float decay, float uiShakeModifier, bool multiplyByTimeScale, System.Action callback) |
Shake all cameras associated with this component (using temporarily overriden settings), then call the specified callback once completed. More... | |
Static Public Member Functions | |
static void | CancelAllShakes () |
Cancel all camera shakes in progress in the current scene, and reset all cameras. More... | |
static void | CancelAllShakes (float time) |
Cancel all camera shakes in progress in the current scene, and reset all cameras over the specified time (in seconds). More... | |
static CameraShake[] | GetComponents () |
Get all enabled Camera Shake components in the scene. More... | |
static void | ShakeAll () |
Shake all cameras associated with all enabled Camera Shake components in the scene, using the default settings. More... | |
static void | ShakeAll (ShakeType shakeType, int numberOfShakes, Vector3 shakeAmount, Vector3 rotationAmount, float distance, float speed, float decay, float uiShakeModifier, bool multiplyByTimeScale) |
Shake all cameras associated with all enabled Camera Shake components in the scene, temporarily overriding the default settings. More... | |
static void | ShakeAll (System.Action callback) |
Shake all cameras associated with all enabled Camera Shake components in the scene, then call the specified callback once completed. More... | |
static void | ShakeAll (ShakeType shakeType, int numberOfShakes, Vector3 shakeAmount, Vector3 rotationAmount, float distance, float speed, float decay, float uiShakeModifier, bool multiplyByTimeScale, System.Action callback) |
Shake all cameras associated with all enabled Camera Shake components in the scene (using temporarily overriden settings), then call the specified callback once completed. More... | |
Static Public Member Functions inherited from CameraShakeBase | |
static void | Log (object message, string prefix, string type) |
Logs a prefixed message. More... | |
static void | Log (object message, string prefix, string type, Object context) |
Logs a prefixed message, with context. More... | |
static void | LogError (object message, string prefix, string type) |
Logs a prefixed erorr. More... | |
static void | LogError (object message, string prefix, string type, Object context) |
Logs a prefixed exception, with context. More... | |
static void | LogException (System.Exception ex) |
Logs an exception. More... | |
static void | LogException (System.Exception ex, Object context) |
Logs an exception, with context. More... | |
static void | LogWarning (object message, string prefix, string type) |
Logs a prefixed warning. More... | |
static void | LogWarning (object message, string prefix, string type, Object context) |
Logs a prefixed warning, with context. More... | |
Properties | |
List< Camera > | cameras [get, set] |
The cameras to shake. More... | |
float | decay [get, set] |
The decay speed (between 0 and 1). Higher values will stop shaking sooner. More... | |
float | distance [get, set] |
The initial distance for the first shake. More... | |
bool | multiplyByTimeScale [get, set] |
If true, multiplies the final shake speed by the time scale. More... | |
int | numberOfShakes [get, set] |
The maximum number of shakes to perform. More... | |
Vector3 | rotationAmount [get, set] |
The amount to rotate in each direction. More... | |
Vector3 | shakeAmount [get, set] |
The amount to shake in each direction. More... | |
ShakeType | shakeType [get, set] |
The type of shake to perform (camera matrix or local position). More... | |
float | speed [get, set] |
The speed multiplier for the shake. More... | |
float | uiShakeModifier [get, set] |
The modifier applied to speed in order to shake the UI. More... | |
Rect | uiShakeRect [get, set] |
Gets the current shake area for the UI (in screen space). More... | |
Events | |
System.Action | onEndShaking |
Occurs when a camera has completely stopped shaking and has been reset to its original position. More... | |
System.Action | onPostShake |
Occurs after every individual camera shake. More... | |
System.Action | onPreShake |
Occurs before every individual camera shake. More... | |
System.Action< Vector3, Quaternion > | onShakeOffset |
Occurs before every individual camera movement, with raw positional and rotational offset data. More... | |
System.Action | onStartShaking |
Occurs when a camera starts shaking. More... | |
Shakes the camera and UI.
All events use the System.Action method signature.
|
strong |
|
inline |
Use this at the beginning of an OnGUI call in order to shake OnGUI with Camera Shake.
|
inline |
Use this at the beginning of an OnGUI call in order to shake OnGUI with Camera Shake (uses GUILayout).
|
inlinestatic |
Cancel all camera shakes in progress in the current scene, and reset all cameras.
|
inlinestatic |
Cancel all camera shakes in progress in the current scene, and reset all cameras over the specified time (in seconds).
time | The amount of time to take to reset the cameras, in seconds. During this time, the camera is smoothly moved back to its original orientation. |
|
inline |
Cancels and resets a camera shake in progress.
|
inline |
Cancels a camera shake in progress, and resets associated cameras over the specified time, in seconds.
time | The amount of time to take to reset the camera, in seconds. During this time, the camera is smoothly moved back to its original orientation. |
|
inline |
Use this at the end of an OnGUI call in order to shake OnGUI with Camera Shake.
|
inline |
Use this at the end of an OnGUI call in order to shake OnGUI with Camera Shake (uses GUILayout).
|
inlinestatic |
Get all enabled Camera Shake components in the scene.
|
inline |
Returns true if the camera is currently cancelling a shake action.
|
inline |
Returns true if the camera is currently shaking.
|
inline |
Shake all cameras associated with this component, using the default settings.
|
inline |
Shake all cameras associated with this component, temporarily overriding the default settings.
shakeType | The type of shake to perform (camera matrix or local position). |
numberOfShakes | The maximum number of shakes to perform. |
shakeAmount | The amount to shake in each direction. |
rotationAmount | The amount to rotate in each axis. |
distance | The initial distance for the first shake. |
speed | The speed multiplier for the shake. |
decay | The decay speed (between 0 and 1). Higher values will stop shaking sooner. |
uiShakeModifier | The modifier applied to speed in order to shake the UI. |
multiplyByTimeScale | If true, multiplies the shake speed by the time scale. |
|
inline |
Shake all cameras associated with this component (using the default settings), then call the specified callback once completed.
callback | An action to invoke after the cameras have finished shaking. |
|
inline |
Shake all cameras associated with this component (using temporarily overriden settings), then call the specified callback once completed.
shakeType | The type of shake to perform (camera matrix or local position). |
numberOfShakes | The maximum number of shakes to perform. |
shakeAmount | The amount to shake in each direction. |
rotationAmount | The amount to rotate in each axis. |
distance | The initial distance for the first shake. |
speed | The speed multiplier for the shake. |
decay | The decay speed (between 0 and 1). Higher values will stop shaking sooner. |
uiShakeModifier | The modifier applied to speed in order to shake the UI. |
multiplyByTimeScale | If true, multiplies the shake speed by the time scale. |
callback | An action to invoke after the cameras have finished shaking. |
|
inlinestatic |
Shake all cameras associated with all enabled Camera Shake components in the scene, using the default settings.
|
inlinestatic |
Shake all cameras associated with all enabled Camera Shake components in the scene, temporarily overriding the default settings.
shakeType | The type of shake to perform (camera matrix or local position). |
numberOfShakes | The maximum number of shakes to perform. |
shakeAmount | The amount to shake in each direction. |
rotationAmount | The amount to rotate in each axis. |
distance | The initial distance for the first shake. |
speed | The speed multiplier for the shake. |
decay | The decay speed (between 0 and 1). Higher values will stop shaking sooner. |
uiShakeModifier | The modifier applied to speed in order to shake the UI. |
multiplyByTimeScale | If true, multiplies the shake speed by the time scale. |
|
inlinestatic |
Shake all cameras associated with all enabled Camera Shake components in the scene, then call the specified callback once completed.
callback | An action to invoke after the cameras have finished shaking. |
|
inlinestatic |
Shake all cameras associated with all enabled Camera Shake components in the scene (using temporarily overriden settings), then call the specified callback once completed.
shakeType | The type of shake to perform (camera matrix or local position). |
numberOfShakes | The maximum number of shakes to perform. |
shakeAmount | The amount to shake in each direction. |
rotationAmount | The amount to rotate in each axis. |
distance | The initial distance for the first shake. |
speed | The speed multiplier for the shake. |
decay | The decay speed (between 0 and 1). Higher values will stop shaking sooner. |
uiShakeModifier | The modifier applied to speed in order to shake the UI. |
multiplyByTimeScale | If true, multiplies the shake speed by the time scale. |
callback | An action to invoke after the cameras have finished shaking. |
|
getset |
The cameras to shake.
|
getset |
The decay speed (between 0 and 1). Higher values will stop shaking sooner.
|
getset |
The initial distance for the first shake.
|
getset |
If true, multiplies the final shake speed by the time scale.
|
getset |
The maximum number of shakes to perform.
|
getset |
The amount to rotate in each direction.
|
getset |
The amount to shake in each direction.
|
getset |
The type of shake to perform (camera matrix or local position).
|
getset |
The speed multiplier for the shake.
|
getset |
The modifier applied to speed in order to shake the UI.
|
getset |
Gets the current shake area for the UI (in screen space).
System.Action onEndShaking |
Occurs when a camera has completely stopped shaking and has been reset to its original position.
System.Action onPostShake |
Occurs after every individual camera shake.
System.Action onPreShake |
Occurs before every individual camera shake.
System.Action<Vector3, Quaternion> onShakeOffset |
Occurs before every individual camera movement, with raw positional and rotational offset data.
System.Action onStartShaking |
Occurs when a camera starts shaking.