Exemplo n.º 1
0
        public void AddAni(Func <Variant, double, double> tweenFun, string attnm, Variant aniAtt, int plycnt = 1, float delay = 0f)
        {
            bool flag  = false;
            bool flag2 = this.m_data.ContainsKey("ctrl");

            if (flag2)
            {
                flag = true;
                Type         type       = this.m_data["ctrl"]._val.GetType();
                object[]     properties = type.GetProperties();
                PropertyInfo property   = type.GetProperty(attnm);
                bool         flag3      = property != null && property.Name != attnm;
                if (flag3)
                {
                    return;
                }
            }
            bool flag4 = !flag && !this.m_data.ContainsKey(attnm);

            if (!flag4)
            {
                this._anis[attnm] = GameTools.createGroup(new object[]
                {
                    "nm",
                    attnm,
                    "tweenFun",
                    tweenFun,
                    "plycnt",
                    plycnt,
                    "ccnt",
                    0,
                    "delay",
                    delay
                });
                this._anis[attnm]["aniAtt"] = aniAtt;
                this._aniAttChanged         = true;
            }
        }
Exemplo n.º 2
0
        public void addProcess(IProcess p)
        {
            bool flag = p == null;

            if (flag)
            {
                GameTools.PrintError("processQueue addProcess null!");
            }
            else
            {
                bool flag2 = p.processName == "";
                if (flag2)
                {
                    GameTools.PrintError("processQueue addProcess processName null!");
                }
                bool destroy = p.destroy;
                if (destroy)
                {
                    p.destroy = false;
                }
                this._processVec.Add(p);
            }
        }
Exemplo n.º 3
0
        public BaseLGUI getLGTUIInst(string lguiName, string uiName, Action <IUI, Variant> cb, Variant data)
        {
            BaseLGUI lgui = null;

            if (lguiName != "UI_BASE")
            {
                lgui = createInst(tracsLguiName(lguiName), false) as BaseLGUI;

                if (lgui == null)
                {            //todo err
                    GameTools.PrintNotice(" getLGTUIInst LGUIClass[" + lguiName + "]  err!!");
                    return(null);
                }
            }
            else
            {
                lgui = new BaseLGUI(this);
            }

            lgui.uiName = uiName;
            lgui.bindui(cb, data);
            return(lgui);
        }
Exemplo n.º 4
0
        public BaseLGUI getLGUI(string lguiName)
        {
            bool     flag = !this.m_uiCtrlMap.ContainsKey(lguiName);
            BaseLGUI baseLGUI;
            BaseLGUI result;

            if (flag)
            {
                baseLGUI = (base.createInst(this.tracsLguiName(lguiName), true) as BaseLGUI);
                bool flag2 = baseLGUI == null;
                if (flag2)
                {
                    GameTools.PrintNotice(" createInst LGUIClass[ " + lguiName + " ] err!");
                    result = null;
                    return(result);
                }
                baseLGUI.uiName            = lguiName;
                this.m_uiCtrlMap[lguiName] = baseLGUI;
            }
            baseLGUI = this.m_uiCtrlMap[lguiName];
            result   = baseLGUI;
            return(result);
        }
Exemplo n.º 5
0
        public IGREffectParticles createEffect(string id)
        {
            IGREffectParticles iGREffectParticles = this._world.createEntity(Define.GREntityType.EFFECT_PARTICLE, id) as IGREffectParticles;
            bool flag = id.Length < 20;
            IGREffectParticles result;
            string             assetPath;

            if (flag)
            {
                Variant effectConf = this.GraphMgr.getEffectConf(id);
                bool    flag2      = effectConf == null;
                if (flag2)
                {
                    GameTools.PrintError("createEffect[" + id + "] no conf ERR!");
                    result = null;
                    return(result);
                }
                assetPath = effectConf["file"]._str;
            }
            else
            {
                assetPath = id;
            }
            iGREffectParticles.asset = os.asset.getAsset <IAssetParticles>(assetPath);
            bool flag3 = iGREffectParticles == null;

            if (flag3)
            {
                GameTools.PrintError("createEffect[" + id + "] ERR!");
                result = null;
            }
            else
            {
                result = iGREffectParticles;
            }
            return(result);
        }
Exemplo n.º 6
0
        //-----------------------------------------------------------------------------------
        // attnm: 属性名字 --- obj中的属性
        //tweenFun:插值算法
        //aniAtt: 插值算法的参数  必须有下列参数  其他视具体算法需求
        //			{	begin:属性开始值,
        //				change:属性变化范围,
        //				duration:播放一次的时间,
        //			}
        //plycnt: 播放次数 -1为无限循环
        //delay:延迟播放 时间
        public void AddAni(Func <Variant, double, double> tweenFun, String attnm, Variant aniAtt, int plycnt = 1, float delay = 0)
        {
            bool isCtrl = false;

            if (m_data.ContainsKey("ctrl"))
            {
                isCtrl = true;
                Type         t  = m_data["ctrl"]._val.GetType();
                object[]     mm = t.GetProperties();
                PropertyInfo at = t.GetProperty(attnm);
                if (at != null && at.Name != attnm)
                {
                    return;
                }
            }
            if (!isCtrl && !m_data.ContainsKey(attnm))
            {
                return;
            }

            _anis[attnm]           = GameTools.createGroup("nm", attnm, "tweenFun", tweenFun, "plycnt", plycnt, "ccnt", 0, "delay", delay);
            _anis[attnm]["aniAtt"] = aniAtt;
            _aniAttChanged         = true;
        }
Exemplo n.º 7
0
        protected void _openUI(string uiname, Variant data)
        {
            bool     flag = !this.m_uiCtrlMap.ContainsKey(uiname);
            BaseLGUI baseLGUI;

            if (flag)
            {
                baseLGUI = (base.createInst(this.tracsLguiName(uiname), true) as BaseLGUI);
                bool flag2 = baseLGUI == null;
                if (flag2)
                {
                    GameTools.PrintNotice(" createInst LGUIClass[ " + uiname + " ] err!");
                }
                baseLGUI.uiName          = uiname;
                this.m_uiCtrlMap[uiname] = baseLGUI;
            }
            baseLGUI = this.m_uiCtrlMap[uiname];
            bool flag3 = !baseLGUI.isOpen;

            if (flag3)
            {
                baseLGUI.open(data);
            }
        }
Exemplo n.º 8
0
 /// <summary>
 /// 排序,默认升序。降序参数:option = GameTools.DESCENDING
 /// </summary>
 /// <param name="data"></param>
 /// <param name="key"></param>
 /// <param name="option"></param>
 static public void Sort(Variant data, string key, uint option = GameTools.NUMERIC)
 {
     data._arr.Sort(GameTools.sortFun(key, option));
 }
Exemplo n.º 9
0
        private static int sortConparison(Variant left, Variant right, List <Variant> keys, List <Variant> opts)
        {
            int  num  = 0;
            bool flag = keys != null && keys.Count > 0;

            if (flag)
            {
                int  num2  = -1;
                bool flag2 = left.ContainsKey(keys[0]._str) && right.ContainsKey(keys[0]._str);
                if (flag2)
                {
                    bool flag3 = left[keys[0]].isStr && !int.TryParse(left[keys[0]]._str, out num2);
                    if (flag3)
                    {
                        num = left[keys[0]]._str.CompareTo(right[keys[0]]);
                    }
                    else
                    {
                        bool flag4 = left[keys[0]] > right[keys[0]];
                        if (flag4)
                        {
                            num = 1;
                        }
                        else
                        {
                            bool flag5 = left[keys[0]] == right[keys[0]];
                            if (flag5)
                            {
                                num = 0;
                            }
                            else
                            {
                                num = -1;
                            }
                        }
                    }
                }
                else
                {
                    bool flag6 = !left.ContainsKey(keys[0]._str) && !right.ContainsKey(keys[0]._str);
                    if (flag6)
                    {
                        num = 0;
                    }
                    bool flag7 = !left.ContainsKey(keys[0]._str);
                    if (flag7)
                    {
                        num = -1;
                    }
                    bool flag8 = !right.ContainsKey(keys[0]._str);
                    if (flag8)
                    {
                        num = 1;
                    }
                }
                bool flag9 = num == 0;
                if (flag9)
                {
                    List <Variant> opts2  = null;
                    bool           flag10 = opts != null && opts.Count > 1;
                    if (flag10)
                    {
                        opts2 = opts.GetRange(1, opts.Count - 1);
                    }
                    num = GameTools.sortConparison(left, right, keys.GetRange(1, keys.Count - 1), opts2);
                }
            }
            bool flag11 = opts != null && opts.Count > 0;

            if (flag11)
            {
                uint @uint = opts[0]._uint;
                if (@uint == 2u)
                {
                    num = -num;
                }
            }
            return(num);
        }
Exemplo n.º 10
0
        public static string GetSuperHtmlStr(string str, string format, string clkFun = null, string clkPar = null)
        {
            string str2 = GameTools.FormatStr(str, format, clkFun, clkPar, "");

            return(GameTools.GetFinFormatStr(str2));
        }
Exemplo n.º 11
0
 public static string clearSuperTxtStr()
 {
     return(GameTools.GetFinFormatStr(""));
 }
Exemplo n.º 12
0
        public static Variant mergeSimpleObject(Variant src, Variant dest, bool clone = false, bool cuseSrc = true)
        {
            Variant variant  = new Variant();
            Variant variant2 = src;
            bool    flag     = !cuseSrc;

            if (flag)
            {
                variant2 = dest;
            }
            if (clone)
            {
                bool isArr = src.isArr;
                if (isArr)
                {
                    using (List <Variant> .Enumerator enumerator = src._arr.GetEnumerator())
                    {
                        while (enumerator.MoveNext())
                        {
                            string key   = enumerator.Current;
                            bool   flag2 = dest.ContainsKey(key);
                            if (flag2)
                            {
                                bool flag3 = (dest[key].isArr || dest[key].isDct) && (src[key].isArr || src[key].isDct);
                                if (flag3)
                                {
                                    variant[key] = GameTools.mergeSimpleObject(src[key], dest[key], false, true);
                                }
                                else
                                {
                                    variant[key] = variant2[key].clone();
                                }
                            }
                            else
                            {
                                variant[key] = src[key].clone();
                            }
                        }
                    }
                }
                bool isDct = src.isDct;
                if (isDct)
                {
                    foreach (string current in src.Keys)
                    {
                        bool flag4 = dest.ContainsKey(current);
                        if (flag4)
                        {
                            bool flag5 = (dest[current].isArr || dest[current].isDct) && (src[current].isArr || src[current].isDct);
                            if (flag5)
                            {
                                variant[current] = GameTools.mergeSimpleObject(src[current], dest[current], false, true);
                            }
                            else
                            {
                                variant[current] = variant2[current].clone();
                            }
                        }
                        else
                        {
                            variant[current] = src[current].clone();
                        }
                    }
                }
                bool flag6 = dest.Count > 0;
                if (flag6)
                {
                    foreach (string current2 in dest.Keys)
                    {
                        bool flag7 = variant.ContainsKey(current2);
                        if (!flag7)
                        {
                            variant[current2] = dest[current2].clone();
                        }
                    }
                }
            }
            else
            {
                bool isDct2 = src.isDct;
                if (isDct2)
                {
                    foreach (string current3 in src.Keys)
                    {
                        bool flag8 = dest.ContainsKey(current3);
                        if (flag8)
                        {
                            bool flag9 = (dest[current3].isArr || dest[current3].isDct) && (src[current3].isArr || src[current3].isDct);
                            if (flag9)
                            {
                                variant[current3] = GameTools.mergeSimpleObject(src[current3], dest[current3], false, true);
                            }
                            else
                            {
                                variant[current3] = variant2[current3];
                            }
                        }
                        else
                        {
                            variant[current3] = src[current3];
                        }
                    }
                }
                bool flag10 = dest.Count > 0;
                if (flag10)
                {
                    foreach (string current4 in dest.Keys)
                    {
                        bool flag11 = variant.ContainsKey(current4);
                        if (!flag11)
                        {
                            variant[current4] = dest[current4];
                        }
                    }
                }
            }
            return(variant);
        }