/// <summary> /// Suitable for short and snappy shakes in 2D. Moves camera in X and Y axes and rotates it in Z axis. /// </summary> /// <param name="positionStrength">Strength of motion in X and Y axes.</param> /// <param name="rotationStrength">Strength of rotation in Z axis.</param> /// <param name="freq">Frequency of shaking.</param> /// <param name="numBounces">Number of vibrations before stop.</param> public void ShortShake2D( float positionStrength = 0.08f, float rotationStrength = 0.1f, float freq = 25, int numBounces = 5) { BounceShake.Params pars = new BounceShake.Params { positionStrength = positionStrength, rotationStrength = rotationStrength, freq = freq, numBounces = numBounces }; shaker.RegisterShake(new BounceShake(pars)); }
/// <summary> /// Adds a shake to the list of active shakes. /// </summary> public static void Shake(ICameraShake shake) { if (IsInstanceNull()) { return; } Instance.RegisterShake(shake); }