using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using Janus;

[Script(ScriptRole.View)]
public class DinoNestView : MonoBehaviour
{
//* This is an Editor only hack to quickly color all of the baby dinos sprites in a dino nest
	// as opposed to individually editing all the children sprites one by one for all 6 nests
	public Color NestColor;
	
	void Update ()
	{
		QuickColor();	
	}
	
	void QuickColor ()
	{	
		foreach (var dino in transform.FindChild("dino_babies").GetComponentsInChildren<Animator>())
		{
			foreach(var sr in dino.GetComponentsInChildren<SpriteRenderer>())
			{
				if (!sr.name.Contains("eye"))
					sr.color = NestColor;
				UnityEditor.EditorUtility.SetDirty(sr);
			}
		}
	}
	//*/
}