示例#1
0
        protected void _insertOriSprite(_graphChaSprite newspr, int ori, Variant oriDatas)
        {
            Variant variant = oriDatas[ori];
            bool    flag    = variant == null;

            if (flag)
            {
                variant = GameTools.createGroup(new object[]
                {
                    "sprs",
                    new List <_graphChaSprite>
                    {
                        newspr
                    },
                    "offx",
                    0,
                    "offy",
                    0,
                    "ori",
                    ori
                });
                this._titleOriData[ori] = variant;
            }
            else
            {
                bool flag2 = ori == 0;
                if (flag2)
                {
                    (variant["sprs"]._val as List <_graphChaSprite>).Add(newspr);
                }
                else
                {
                    int i;
                    for (i = (variant["sprs"]._val as List <_graphChaSprite>).Count; i > 0; i--)
                    {
                        bool flag3 = this._compareSprite((variant["sprs"]._val as List <_graphChaSprite>)[i - 1].userdata, newspr.userdata) <= 0;
                        if (flag3)
                        {
                            break;
                        }
                    }
                    bool flag4 = i >= (variant["sprs"]._val as List <_graphChaSprite>).Count;
                    if (flag4)
                    {
                        (variant["sprs"]._val as List <_graphChaSprite>).Add(newspr);
                    }
                    else
                    {
                        (variant["sprs"]._val as List <_graphChaSprite>).Insert(i, newspr);
                    }
                }
            }
            this._updateOriSprite(variant, oriDatas);
        }
示例#2
0
        public void addTitleSpr(string tp, Variant titleConf, int showtp = 0, Variant showInfo = null)
        {
            Variant variant = this._titleSprites[tp];
            bool    flag    = variant == null;

            if (flag)
            {
                bool flag2 = titleConf == null;
                if (flag2)
                {
                    return;
                }
                variant                = new Variant();
                variant["conf"]        = titleConf;
                variant["sprs"]        = new Variant();
                variant["sprs"]._val   = new Dictionary <string, Variant>();
                this._titleSprites[tp] = variant;
            }
            Variant variant2 = variant["conf"]["show"][showtp.ToString()];
            bool    flag3    = variant2 != null && false;

            if (flag3)
            {
                _graphChaSprite graphChaSprite = _graphChaSpriteHost.createChaSprite(variant2["tp"]);
                bool            flag4          = showInfo == null;
                if (flag4)
                {
                    showInfo = new Variant();
                }
                this._adjustShowInfo(variant2, showInfo);
                bool flag5 = variant["sprs"].ContainsKey(showtp.ToString());
                if (flag5)
                {
                    this.removeTitleSpr(tp, showtp, true);
                }
                graphChaSprite.userdata = GameTools.createGroup(new Variant[]
                {
                    "tp",
                    tp,
                    "showtp",
                    showtp,
                    "conf",
                    variant["conf"]
                });
                variant["sprs"][showtp.ToString()] = GameTools.createGroup(new object[]
                {
                    "spr",
                    graphChaSprite,
                    "add",
                    false
                });
                graphChaSprite.initShowInfo(showInfo, new Action <_graphChaSprite>(this.initTitleFinish));
            }
        }
示例#3
0
        protected void initDynamicFinish(_graphChaSprite spr)
        {
            bool disposed = this._disposed;

            if (disposed)
            {
                spr.dispose();
            }
            else
            {
                spr.userdata["loaded"] = true;
            }
        }
示例#4
0
        protected void initTitleFinish(_graphChaSprite spr)
        {
            bool disposed = this._disposed;

            if (disposed)
            {
                spr.dispose();
            }
            else
            {
                Variant variant = this._titleSprites[spr.userdata["tp"]];
                bool    flag    = variant == null;
                if (flag)
                {
                    spr.dispose();
                }
                else
                {
                    Dictionary <string, Variant> dictionary = variant["sprs"][spr.userdata["showtp"]._str]._val as Dictionary <string, Variant>;
                    bool flag2 = dictionary == null || dictionary["spr"]._val != spr;
                    if (flag2)
                    {
                        spr.dispose();
                    }
                    else
                    {
                        bool flag3 = (dictionary["spr"]._val as _graphChaSprite).dispObj == null;
                        if (flag3)
                        {
                            variant["sprs"][spr.userdata["showtp"]._str] = null;
                        }
                        else
                        {
                            dictionary["add"] = true;
                            this._titleSpr.addChild(spr.dispObj);
                            this._insertOriSprite(spr, spr.userdata["conf"]["ori"], this._titleOriData);
                            bool flag4 = spr is _graphChaAniSprite;
                            if (flag4)
                            {
                                this._aniSprites.Add(spr as _graphChaAniSprite);
                            }
                            bool flag5 = spr is _graphChatSprite;
                            if (flag5)
                            {
                                this._chatSprites.Add(spr as _graphChatSprite);
                            }
                        }
                    }
                }
            }
        }
示例#5
0
        protected void _dynamicDefaultAni(float currTm, Variant aniInfo)
        {
            Variant         variant        = aniInfo["conf"];
            float           num            = currTm - aniInfo["stm"];
            _graphChaSprite graphChaSprite = aniInfo["spr"]._val as _graphChaSprite;
            bool            @bool          = aniInfo["criatk"]._bool;
            float           num2;

            if (@bool)
            {
                bool flag = num < variant["scaletm_b"]._float;
                if (flag)
                {
                    num2 = num / variant["scaletm_b"]._float + 1f;
                    graphChaSprite.dispObj.scale = num2;
                }
                else
                {
                    bool flag2 = num < variant["scaletm_s"]._float + variant["scaletm_b"]._float;
                    if (flag2)
                    {
                        num2 = 2f - (num - variant["scaletm_b"]._float) / variant["scaletm_s"]._float;
                        graphChaSprite.dispObj.scale = num2;
                    }
                    else
                    {
                        num2 = 1f;
                        graphChaSprite.dispObj.scale = num2;
                        aniInfo["criatk"]            = false;
                    }
                }
                graphChaSprite.dispObj.x = aniInfo["stx"]._float - (num2 - 1f) * graphChaSprite.dispObj.width / 4f;
            }
            num2 = num / variant["ttm"]._float - 1f;
            graphChaSprite.dispObj.y = aniInfo["sty"]._float - 120f * (num2 * num2 * num2 + 1f);
            bool flag3 = variant["ttm"]._float - num < variant["alphatm"]._float;

            if (flag3)
            {
                graphChaSprite.dispObj.alpha = (variant["ttm"]._float - num) / variant["alphatm"]._float;
            }
        }
示例#6
0
        protected void initDpSprFin(_graphChaSprite dpSpr)
        {
            this._dpNum--;
            bool flag = this._dpNum == 0;

            if (flag)
            {
                foreach (string current in this._dpInfo.Keys)
                {
                    Variant         variant        = this._dpInfo[current];
                    Variant         variant2       = variant["info"];
                    _graphChaSprite graphChaSprite = variant["spr"]._val as _graphChaSprite;
                    bool            flag2          = variant2.ContainsKey("width");
                    if (flag2)
                    {
                        graphChaSprite.dispObj.width = variant2["width"]._float;
                    }
                    bool flag3 = variant2.ContainsKey("height");
                    if (flag3)
                    {
                        graphChaSprite.dispObj.height = variant2["height"]._float;
                    }
                    bool flag4 = variant2.ContainsKey("offy") && variant2["offy"]._float != 0f;
                    if (flag4)
                    {
                        graphChaSprite.dispObj.y += variant2["offy"]._float;
                    }
                    bool flag5 = variant2.ContainsKey("offx") && variant2["offx"]._float != 0f;
                    if (flag5)
                    {
                        graphChaSprite.dispObj.x += variant2["offx"]._float;
                    }
                    this._dpSpr.addChild(graphChaSprite.dispObj);
                }
                bool flag6 = this._initDpCallBack != null;
                if (flag6)
                {
                    this._initDpCallBack();
                }
            }
        }
示例#7
0
 public void InitDpSpr(Variant conf, Action initCB)
 {
     this._initDpCallBack = initCB;
     this._dpNum          = conf["show"].Count;
     foreach (Variant current in conf["show"].Values)
     {
         _graphChaSprite graphChaSprite = _graphChaSpriteHost.createChaSprite(current["tp"]);
         this._dpInfo[current["layer"]] = GameTools.createGroup(new object[]
         {
             "spr",
             graphChaSprite
         });
         this._dpInfo[current["layer"]]["info"] = current;
         bool flag = "txt" == current["tp"];
         if (flag)
         {
             Variant variant = current.clone();
             bool    flag2   = current.ContainsKey("style");
             if (flag2)
             {
                 variant["style"] = _graphChaSpriteHost.GetDisplayStyle(current["style"]);
             }
             Variant variant2 = new Variant();
             bool    flag3    = current.ContainsKey("fmt");
             if (flag3)
             {
                 GameTools.mergeSimpleObject(current["fmt"][0], variant2, false, true);
             }
             variant["fmt"] = variant2;
             graphChaSprite.initShowInfo(variant, new Action <_graphChaSprite>(this.initDpSprFin));
         }
         else
         {
             graphChaSprite.initShowInfo(current, new Action <_graphChaSprite>(this.initDpSprFin));
         }
     }
 }
示例#8
0
        protected void _dynamicAniTp1(float currTm, Variant aniInfo)
        {
            Variant         variant        = aniInfo["conf"];
            float           num            = currTm - aniInfo["stm"]._float;
            _graphChaSprite graphChaSprite = aniInfo["spr"]._val as _graphChaSprite;
            float           num2           = variant["distance"]._float;
            bool            flag           = aniInfo["dri"]["x"]._float > 0f;

            if (flag)
            {
                num2 -= graphChaSprite.dispObj.width;
            }
            float num3  = variant["ttm"]._float - variant["stop_ttm"]._float;
            bool  flag2 = num < variant["stop_s"]._float;
            float num4;
            float num5;
            float val;
            float val2;

            if (flag2)
            {
                num4 = num;
                num5 = variant["stop_s"]._float;
                val  = aniInfo["stx"]._float;
                val2 = aniInfo["sty"]._float;
            }
            else
            {
                bool flag3 = num > variant["stop_s"]._float + variant["stop_ttm"]._float;
                if (flag3)
                {
                    num4 = num - variant["stop_ttm"]._float - variant["stop_s"]._float;
                    num5 = num3 - variant["stop_s"]._float;
                    val  = num2 * aniInfo["dri"]["x"]._float * (variant["stop_s"]._float / num3) + aniInfo["stx"]._float;
                    val2 = num2 * aniInfo["dri"]["y"]._float * (variant["stop_s"]._float / num3) + aniInfo["sty"]._float;
                }
                else
                {
                    num4 = 0f;
                    num5 = 0f;
                    val  = num2 * aniInfo["dri"]["x"]._float * (variant["stop_s"]._float / num3) + aniInfo["stx"]._float;
                    val2 = num2 * aniInfo["dri"]["y"]._float * (variant["stop_s"]._float / num3) + aniInfo["sty"]._float;
                }
            }
            float val3 = num2 * aniInfo["dri"]["x"]._float * (num5 / num3);
            float val4 = num2 * aniInfo["dri"]["y"]._float * (num5 / num3);

            num5 += (float)GameTools.randomInst.NextDouble() * 50f;
            Variant att = GameTools.createGroup(new Variant[]
            {
                "duration",
                num5,
                "change",
                val3,
                "begin",
                val
            });
            float x = (float)Algorithm.TweenExpoEaseOut(att, (double)num4);

            graphChaSprite.dispObj.x = x;
            att = GameTools.createGroup(new Variant[]
            {
                "duration",
                num5,
                "change",
                val4,
                "begin",
                val2
            });
            graphChaSprite.dispObj.y = (float)Algorithm.TweenExpoEaseOut(att, (double)num4);
            bool flag4 = variant["ttm"]._float - num < variant["alphatm"]._float;

            if (flag4)
            {
                graphChaSprite.dispObj.alpha = (variant["ttm"]._float - num) / variant["alphatm"]._float;
            }
        }