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);
            }
        }
    }
}
