FairyGUI.FieldTypes.ParseEaseType C# (CSharp) Method

ParseEaseType() public static method

public static ParseEaseType ( string value ) : Ease
value string
return Ease
        public static Ease ParseEaseType(string value)
        {
            Ease type;
            if (!EaseTypeMap.TryGetValue(value, out type))
                type = Ease.OutExpo;

            return type;
        }

Usage Example

示例#1
0
        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);
                }
            }
        }
All Usage Examples Of FairyGUI.FieldTypes::ParseEaseType