using System.Collections.Generic;
using UnityEngine;
using mgaia.Utils;
using mgaia.Utils.LayerSystem;

namespace mgaia.tk2d
{
    /// <summary>
    /// Efeito de fade para os elementos da tk2d
    /// </summary>
    /// <owner>Victor</owner>
    public class tk2dLayerSliceEffectFade : BaseLayerSliceEffectFade
    {
        /// <summary>
        /// Retorna todos os containers de cor que passarão pelo efeito de fade
        /// </summary>
        protected override IColorContainer[] GetColorContainers()
        {
            List<IColorContainer> colorContainers = new List<IColorContainer>();

            foreach (tk2dTextMesh textMesh in GetComponentsInChildren<tk2dTextMesh>(true))
            {
                colorContainers.Add(new TextMeshColorContainer(textMesh));
            }

            foreach (tk2dBaseSprite baseSprite in GetComponentsInChildren<tk2dBaseSprite>(true))
            {
                colorContainers.Add(new SpriteColorContainer(baseSprite));
            }

            return colorContainers.ToArray();
        }
    }
}