BloodAndGore/Assets/Scripts/Utils/BobbingRandomizer.cs
2019-08-22 21:36:22 +03:00

25 lines
702 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Saltosion.OneWeapon.Effects;
namespace Saltosion.OneWeapon.Utils {
public class BobbingRandomizer : MonoBehaviour {
public float Variety = 0.05f;
public AcceleratedMovement Movement;
public Bobbing Bobbing;
void Start() {
float RandomOffset = Random.value * (Variety * 2) - Variety;
if (Movement != null) {
Movement.AnimationSpeedModifier = 1 + RandomOffset;
}
if (Bobbing != null) {
Bobbing.BobbingLaunchSpeed = Bobbing.BobbingLaunchSpeed * (1 + RandomOffset);
}
}
}
}