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

public class ClockScript : MonoBehaviour {


    public GameObject levelManager;
    public GameObject needle;

    public List<GameObject> spawners;
	// Use this for initialization
	void Start () {
		
	}
	
	// Update is called once per frame
	void Update () {
        if (levelManager.GetComponent<LevelManager>().levelProgression() >= 1) {
            foreach (GameObject spawner in spawners) {

                spawner.gameObject.SetActive(false);
            }

            levelManager.GetComponent<LevelManager>().winGame();
        }
	}
    private void LateUpdate()
    {
        Quaternion needleRot = needle.transform.rotation;
        //needleRot.z = ;
        needleRot = Quaternion.Euler(0, 0, levelManager.GetComponent<LevelManager>().levelProgression() * 360.0f); ;
        needle.transform.rotation = needleRot;
    }
}
