Nez.CameraShake.shake C# (CSharp) Méthode

shake() public méthode

if the shake is already running this will overwrite the current values only if shakeIntensity > the current shakeIntensity. if the shake is not currently active it will be started.
public shake ( float shakeIntensity = 15f, float shakeDegredation = 0.9f, Vector2 shakeDirection = default(Vector2) ) : void
shakeIntensity float how much should we shake it
shakeDegredation float higher values cause faster degradation
shakeDirection Vector2 Vector3.zero will result in a shake on just the x/y axis. any other values will result in the passed /// in shakeDirection * intensity being the offset the camera is moved
Résultat void
		public void shake( float shakeIntensity = 15f, float shakeDegredation = 0.9f, Vector2 shakeDirection = default( Vector2 ) )
		{
			enabled = true;
			if( _shakeIntensity < shakeIntensity )
			{
				_shakeDirection = shakeDirection;
				_shakeIntensity = shakeIntensity;
				if( shakeDegredation < 0f || shakeDegredation >= 1f )
					shakeDegredation = 0.95f;
				
				_shakeDegredation = shakeDegredation;
			}
		}