using UnityEngine;
using System.Collections;

public class Library : MonoBehaviour
{//Sciprt that hold Global Setting for the game 
    public static Library Data;
    public float moveSpeedSet; //the amount the chac moves per frame
    public float jumpHeightSet; //the amount the chac moves up after jumping
    public float moveAccSet;
    public KeyCode moveLeftKeySet;
    public KeyCode moveRightKeySet;
    public KeyCode jumpKeySet;
    public KeyCode actButtonKey;
    public string noColors;
    public enum BlockColor {Red, Green, Blue, RedGreen,RedBlue,GreenBlue };
    public Sprite[] colorBoxSprites;
    public string[] colorLayers;
    public AudioClip sound;
    
    //public float camaraMoveTime;
    void Awake()
    {
        Data = this;
    }
    // Use this for initialization

    void Start()
    {
        GameObject[] playerAvatars = GameObject.FindGameObjectsWithTag("Player");
        foreach (GameObject avatar in playerAvatars)
        {
            avatar.GetComponent<MovmentControl>().moveSpeed = moveSpeedSet; ; //the amount the chac moves per frame
            avatar.GetComponent<MovmentControl>().jumpHeight =jumpHeightSet; //the amount the chac moves up after jumping
            avatar.GetComponent<MovmentControl>().moveAcc = moveAccSet;
            avatar.GetComponent<MovmentControl>().moveLeftKey = moveLeftKeySet;
            avatar.GetComponent<MovmentControl>().moveRightKey = moveRightKeySet;
            avatar.GetComponent<MovmentControl>().jumpKey = jumpKeySet;
        }
        var a = gameObject.AddComponent<AudioSource>();
        a.loop = true;
        a.clip = sound;
        a.Play();


    }
	// Update is called once per frame
	void Update ()
    {
	
	}
}
