using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class DGA : MonoBehaviour {
    public InputManager inputManager; // For speed and convenience.
    public WaveGenerator waveGenerator; // For speed and convenience.
    public float tempo; // Global tempo.
    public float scaleToMovementSlowDown = 160f; // Scale must equaly fast compared to movement.
    public Color waveFormTransparancyColor; // For speed and convenience.

    [HideInInspector]
    public static DGA control; // For speed and convenience.
    [HideInInspector]
    public float clampedDeltaTime; // For safety and speed.
    [HideInInspector]
    public float startTime; // When the sequence started.
    [HideInInspector]
    public bool gameStarted; // System wide to start only after title.

    private void Initialize () {
        inputManager.Initialize ();
        waveGenerator.Initialize ();
        tempo *= (Screen.width / 1280f);
    }

    public void Awake () {
        if (control == null) {
            control = this;

            Initialize ();
        } else
            Destroy (gameObject);
    }

    // Update is called once per frame
    public void Update () {
        clampedDeltaTime = Mathf.Clamp (Time.deltaTime, .016f, .06f);
    }
}
