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

public class Font : MonoBehaviour
{
    public Image[] numbers;
    public Sprite[] spriteNumbers;
    
	void Awake ()
    {
        //numbers = GetComponentsInChildren<Image>();
        ResetNumbers();
        
    }

	public void WriteNumber (string num)
    {
        ResetNumbers();
        char[] nums = num.ToCharArray();
        for (int i = 0; i < nums.Length; i++)
        {
            numbers[i].sprite = spriteNumbers[int.Parse(nums[i].ToString())];
            numbers[i].color = Color.white;
        }
	}

    void ResetNumbers ()
    {
        for (int i = 0; i < numbers.Length; i++)
        {
            numbers[i].sprite = null;
            numbers[i].color = new Color(0,0,0,0);
        }
    }
}
