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

public enum ColorUsed
{
    Red,
    Yellow,
    Green,
    Blue,
    Purple
}



public class ManagerReferences : MonoBehaviour {
    public Color[] Colors;
    public GameObject ball;
    public int score;
    public Text scoreText;

	// Use this for initialization
	void Start () {
        score = 0;
	}
	
	// Update is called once per frame
	void Update () {
		
	}

    public void IncreaseScore(int amount) {
        score += amount;
        scoreText.text = score.ToString();
    }

    public void SwitchColorPlayer(ColorUsed newColor)
    {
        SpriteRenderer renderer = ball.GetComponent<SpriteRenderer>();
        switch(newColor)
        {
            case ColorUsed.Red:
                renderer.color = Colors[0];
                break;
            case ColorUsed.Yellow:
                renderer.color = Colors[1];
                break;
            case ColorUsed.Green:
                renderer.color = Colors[2];
                break;
            case ColorUsed.Blue:
                renderer.color = Colors[3];
                break;
            case ColorUsed.Purple:
                renderer.color = Colors[4];
                break;
            default:
                renderer.color = Colors[0];
                break;
        }
    }

    public void ShowNewScene()
    {
        Application.LoadLevel("Restart");
    }


}
