public void Setup(XML xml)
{
this.name = xml.GetAttribute("name");
_options = xml.GetAttributeInt("options");
XMLList col = xml.Elements("item");
foreach (XML cxml in col)
{
TransitionItem item = new TransitionItem();
_items.Add(item);
item.time = (float)cxml.GetAttributeInt("time") / (float)FRAME_RATE;
item.targetId = cxml.GetAttribute("target", string.Empty);
item.type = FieldTypes.ParseTransitionActionType(cxml.GetAttribute("type"));
item.tween = cxml.GetAttributeBool("tween");
item.label = cxml.GetAttribute("label");
if (item.tween)
{
item.duration = (float)cxml.GetAttributeInt("duration") / FRAME_RATE;
string ease = cxml.GetAttribute("ease");
if (ease != null)
{
item.easeType = FieldTypes.ParseEaseType(ease);
}
item.repeat = cxml.GetAttributeInt("repeat");
item.yoyo = cxml.GetAttributeBool("yoyo");
item.label2 = cxml.GetAttribute("label2");
string v = cxml.GetAttribute("endValue");
if (v != null)
{
DecodeValue(item.type, cxml.GetAttribute("startValue", string.Empty), item.startValue);
DecodeValue(item.type, v, item.endValue);
}
else
{
item.tween = false;
DecodeValue(item.type, cxml.GetAttribute("startValue", string.Empty), item.value);
}
}
else
{
DecodeValue(item.type, cxml.GetAttribute("value", string.Empty), item.value);
}
}
}