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

public class WaveController : MonoBehaviour {

    public float wavetime;
    public float enemytime;
    static public bool enemy_wave = false;

	// Use this for initialization
	void Start ()
    {
		
	}

    // Update is called once per frame
    void Update()
    {
        if (enemy_wave == false)
        { 
            PowerBar.fillAmount = PowerBar.fillAmount - (wavetime * Time.deltaTime);
        }
        if (enemy_wave == false & PowerBar.fillAmount <= 0)
        {
            enemy_wave = true;
        }

        if (enemy_wave == true)
        {
            PowerBar.fillAmount = PowerBar.fillAmount + (enemytime * Time.deltaTime);
        }
        if (enemy_wave == true & PowerBar.fillAmount >= 1)
        {
            enemy_wave = false;
        }
    }
}
