public void TriggerShake() { ShakeData newData = new ShakeData(); newData.Label = ShakeLabel + "_" + this.GetInstanceID(); newData.ShakeMagnitude = Magnitude; newData.ShakeDuration = Duration; newData.Source = transform; newData.DistanceWeight = DistanceWeight; if (UseCustomAdvancedData) { newData.MaxShakeDistance = CustomMaxDistance; newData.DurationFalloff = CustomDurationFalloff; newData.DistanceFalloff = CustomDistanceFalloff; } else { newData.MaxShakeDistance = CameraShaker.current.DefaultMaxShakeDistance; newData.DurationFalloff = CameraShaker.current.DefaultDurationFalloff; newData.DistanceFalloff = CameraShaker.current.DefaultDistanceFalloff; } CameraShaker.current.StartNewShake(newData); }
public void StartNewShake(ShakeData newData) { activeShakes.Add(newData); }