GetAttributeFloat() public method

public GetAttributeFloat ( string attrName ) : float
attrName string
return float
 static public int GetAttributeFloat(IntPtr l)
 {
     try {
         int argc = LuaDLL.lua_gettop(l);
         if (argc == 2)
         {
             FairyGUI.Utils.XML self = (FairyGUI.Utils.XML)checkSelf(l);
             System.String      a1;
             checkType(l, 2, out a1);
             var ret = self.GetAttributeFloat(a1);
             pushValue(l, true);
             pushValue(l, ret);
             return(2);
         }
         else if (argc == 3)
         {
             FairyGUI.Utils.XML self = (FairyGUI.Utils.XML)checkSelf(l);
             System.String      a1;
             checkType(l, 2, out a1);
             System.Single a2;
             checkType(l, 3, out a2);
             var ret = self.GetAttributeFloat(a1, a2);
             pushValue(l, true);
             pushValue(l, ret);
             return(2);
         }
         pushValue(l, false);
         LuaDLL.lua_pushstring(l, "No matched override function to call");
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
示例#2
0
        public void Setup(XML xml)
        {
            this.name = xml.GetAttribute("name");
            _options = xml.GetAttributeInt("options");
            this.autoPlay = xml.GetAttributeBool("autoPlay");
            if (this.autoPlay)
            {
                this.autoPlayRepeat = xml.GetAttributeInt("autoPlayRepeat", 1);
                this.autoPlayDelay = xml.GetAttributeFloat("autoPlayDelay");
            }
            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;
                    if (item.time + item.duration > _maxTime)
                        _maxTime = item.time + item.duration;

                    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
                {
                    if (item.time > _maxTime)
                        _maxTime = item.time;
                    DecodeValue(item.type, cxml.GetAttribute("value", string.Empty), item.value);
                }
            }
        }