private void Awake()
{
Attribute[] childAttributes = transform.GetComponentsInChildren<Attribute>();
attributes = new Dictionary<AttributeType, Attribute>(childAttributes.Length);
for (int i = 0; i < childAttributes.Length; i++)
{
Attribute childAttribute = childAttributes[i];
if (attributes.ContainsKey(childAttribute.AttributeType))
{
Debug.Log("Duplicated attribute " + childAttribute.AttributeType, this);
continue;
}
attributes.Add(childAttribute.AttributeType, childAttribute);
}
}