using System.Collections.Generic;
using UnityEngine;

namespace mgaia.Utils.LayerSystem
{
    /// <summary>
    /// Efeito de fade para objetos da Unity
    /// </summary>
    /// <owner>Victor</owner>
    public class UnityLayerSliceEffectFade : BaseLayerSliceEffectFade
    {
        protected override IColorContainer[] GetColorContainers()
        {
            List<IColorContainer> colorContainers = new List<IColorContainer>();

            foreach (Transform childTransform in GetComponentsInChildren<Transform>(true))
            {
                if (childTransform.renderer != null && childTransform.renderer.material != null)
                {
                    colorContainers.Add(new GameObjectColorContainer(childTransform.gameObject));
                }
            }

            return colorContainers.ToArray();
        }
    }
}