public void Setup(XML xml) { string str; _controller = _owner.parent.GetController(xml.GetAttribute("controller")); if (_controller == null) return; Init(); str = xml.GetAttribute("tween"); if (str != null) tween = true; str = xml.GetAttribute("ease"); if (str != null) easeType = FieldTypes.ParseEaseType(str); str = xml.GetAttribute("duration"); if (str != null) tweenTime = float.Parse(str); str = xml.GetAttribute("delay"); if (str != null) delay = float.Parse(str); if (this is GearDisplay) { string[] pages = xml.GetAttributeArray("pages"); if (pages != null) ((GearDisplay)this).pages = pages; } else { string[] pages = xml.GetAttributeArray("pages"); string[] values = xml.GetAttributeArray("values", '|'); if (pages != null && values != null) { for (int i = 0; i < values.Length; i++) AddStatus(pages[i], values[i]); } str = xml.GetAttribute("default"); if (str != null) AddStatus(null, str); } }
static public int Setup(IntPtr l) { try { FairyGUI.GearBase self = (FairyGUI.GearBase)checkSelf(l); FairyGUI.Utils.XML a1; checkType(l, 2, out a1); self.Setup(a1); pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }