FairyGUI.GButton.Setup_AfterAdd C# (CSharp) Method

Setup_AfterAdd() public method

public Setup_AfterAdd ( XML cxml ) : void
cxml FairyGUI.Utils.XML
return void
        public override void Setup_AfterAdd(XML cxml)
        {
            base.Setup_AfterAdd(cxml);

            if (_downEffect == 2)
                this.SetPivot(0.5f, 0.5f);

            XML xml = cxml.GetNode("Button");
            if (xml == null)
                return;

            string str;

            str = xml.GetAttribute("title");
            if (str != null)
                this.title = str;
            str = xml.GetAttribute("icon");
            if (str != null)
                this.icon = str;
            str = xml.GetAttribute("selectedTitle");
            if (str != null)
                this.selectedTitle = str;
            str = xml.GetAttribute("selectedIcon");
            if (str != null)
                this.selectedIcon = str;

            str = xml.GetAttribute("titleColor");
            if (str != null)
                this.titleColor = ToolSet.ConvertFromHtmlColor(str);
            str = xml.GetAttribute("controller");
            if (str != null)
                _relatedController = parent.GetController(str);
            pageOption.id = xml.GetAttribute("page");
            this.selected = xml.GetAttributeBool("checked", false);

            str = xml.GetAttribute("sound");
            if (str != null)
                sound = UIPackage.GetItemAssetByURL(str) as AudioClip;

            str = xml.GetAttribute("volume");
            if (str != null)
                soundVolumeScale = float.Parse(str) / 100f;
        }

Usage Example

	static public int Setup_AfterAdd(IntPtr l) {
		try {
			FairyGUI.GButton self=(FairyGUI.GButton)checkSelf(l);
			FairyGUI.Utils.XML a1;
			checkType(l,2,out a1);
			self.Setup_AfterAdd(a1);
			pushValue(l,true);
			return 1;
		}
		catch(Exception e) {
			return error(l,e);
		}
	}
All Usage Examples Of FairyGUI.GButton::Setup_AfterAdd