using UnityEngine;
using mgaia.Utils.Typing;

namespace mgaia.tk2d
{
    public class tk2dTypingMethod : ITypingMethod
    {
        private tk2dTextMesh mTextMesh;

        public tk2dTypingMethod(tk2dTextMesh textMesh)
        {
            mTextMesh = textMesh;
        }

        public void Type(char charToType)
        {
            mTextMesh.text += charToType.ToString();
            
            //FIX PARA FORÇAR O REFRESH DE CORES EM LABELS MULTICOLORIDOS
            mTextMesh.color = mTextMesh.color;
        }

        public void TypeAllString(string stringToType)
        {
            mTextMesh.text = stringToType;

            //FIX PARA FORÇAR O REFRESH DE CORES EM LABELS MULTICOLORIDOS
            mTextMesh.color = mTextMesh.color;
        }
    }
}