public void IniciarShake(ShakeAxis S = ShakeAxis.y, int totalShake = 5, float shakeAngle = 1) { //transform.rotation = Quaternion.identity; this.totalShake = totalShake; this.shakeAngle = shakeAngle; this.axis = S; tempoDecorrido = 0; contShake = 0; estadoC = EstadoComplementarDaCamera.shake; }
private void OnRequestShakeCam(IGameEvent e) { StandardSendGameEvent ssge = (StandardSendGameEvent)e; int totalShake = 5; float angle = 1; ShakeAxis axis = ShakeAxis.x; if (ssge.MyObject.Length > 0) { axis = (ShakeAxis)ssge.MyObject[0]; if (ssge.MyObject.Length > 1) { totalShake = (int)ssge.MyObject[1]; angle = (float)ssge.MyObject[2]; } } shake.IniciarShake(axis, totalShake, angle); }
public void Shake(float magnitude, float duration, ShakeMode mode, ShakeAxis options) { if (IsShaking) { _shakeDuration += duration; } else { IsShaking = true; _shakeMagnitude = magnitude; _shakeMode = mode; _shakeOptions = options; _shakeDuration = duration; _shakeAnchorPosition = _position; _shakeSpeed = 600f; _shakeDistance = 30f; _shakeAngle = 1.5707963267948966f; } }
public void Shake(float magnitude, float duration, ShakeAxis options) { Shake(magnitude, duration, ShakeMode.Random, options); }