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

public class ChangingColor : MonoBehaviour
{
    public Library.BlockColor startColor;
    Sprite currentSprite;
	// Use this for initialization
	void Start ()
    {
        currentSprite = Library.Data.colorBoxSprites[(int)startColor];
        this.GetComponent<SpriteRenderer>().sprite = currentSprite;
    }
	// Update is called once per frame
	void Update ()
    {
		
	}
    public void ChangeColor(Library.BlockColor spriteChange)
    {
        currentSprite =  Library.Data.colorBoxSprites[(int)spriteChange];
        this.GetComponent<SpriteRenderer>().sprite = currentSprite;
        this.gameObject.layer = LayerMask.NameToLayer(Library.Data.colorLayers[(int)spriteChange]);
    }
}
