コード例 #1
0
    private void MatchTeam()
    {
        if (statementType.Equals(ModelFight.FIGHT_MATCHTEAM) || statementType.Equals(ModelFight.FIGHT_FREEMATCH2))//排位
        {
            addRankScore.visible = true;
            rankScoreBg.visible  = true;
            rankScore.visible    = true;
            if (statementType.Equals(ModelFight.FIGHT_MATCHTEAM))
            {
                Dictionary <string, object> info = (Dictionary <string, object>)((object[])figthUserInfo["0"])[2];
                object[] matchReward             = (object[])rank_reward[(Convert.ToInt32(info["rank_lv"])).ToString()];
                rankScoreValue.text = userModel.rank_score.ToString();
                rankScoreBg.url     = userModel.GetRankImg(userModel.rank_score);
                rankImg.url         = userModel.GetRankImg(userModel.rank_score);
                rankScoreStart      = userModel.rank_score;
                rankScoreEnd        = (int)user["rank_score"];
                num = Math.Abs(rankScoreStart - rankScoreEnd);
                if (rankScoreStart > rankScoreEnd)
                {
                    addRankScore.text = "-" + num;
                }
                else if (rankScoreStart > rankScoreEnd)
                {
                    addRankScore.text = "+" + num;
                }
                else
                {
                    if ((int)fightModel.fightData["battle_result"] == 1)//胜利
                    {
                        addRankScore.text = "+" + num;
                    }
                    else
                    {
                        addRankScore.text = "-" + num;
                    }
                }
                if ((int)fightModel.fightData["battle_result"] == 1)//胜利
                {
                    if ((bool)info["is_mvp"])
                    {
                        effectType1  = Config.EFFECT_WIN;
                        animateType1 = null;
                        animateDir1  = null;

                        isMvp = true;

                        rewardName  = Tools.GetFightRewardID(matchReward[2].ToString());
                        effectType2 = rewardName;
                        //animateType2 = matchReward[2].ToString();
                        animateDir2 = null;
                    }
                    else
                    {
                        effectType1  = Config.EFFECT_WIN;
                        animateType1 = "mvp1";
                        animateDir1  = "win_/icon";

                        rewardName  = Tools.GetFightRewardID(matchReward[0].ToString());
                        effectType2 = rewardName;
                        //animateType2 = matchReward[0].ToString();
                        animateDir2 = null;
                    }
                }
                else
                {
                    //userModel.rank_score = (int)info["rank_score"];
                    if ((bool)info["is_mvp"])
                    {
                        effectType1  = Config.EFFECT_LOSE;
                        animateType1 = null;
                        animateDir1  = null;
                        isMvp        = true;
                        rewardName   = Tools.GetFightRewardID(matchReward[2].ToString());
                        effectType2  = rewardName;
                        //animateType2 = matchReward[2].ToString();
                        animateDir2 = null;
                    }
                    else
                    {
                        effectType1  = Config.EFFECT_LOSE;
                        animateType1 = "normal";
                        animateDir1  = "los/lose_";

                        rewardName  = Tools.GetFightRewardID(matchReward[1].ToString());
                        effectType2 = rewardName;
                        //animateType2 = matchReward[1].ToString();
                        animateDir2 = null;
                    }
                }
                initQueue.Init(new List <Action> {
                    Effect1,
                    Effect2,
                    Effect3,
                    Effect4,
                    Effect5,
                    Effect6
                });
            }
            else
            {
                viewFight.visible = false;
                Dictionary <string, object> info = (Dictionary <string, object>)((object[])figthUserInfo["0"])[2];
                if ((int)fightModel.fightData["battle_result"] == 1)//胜利
                {
                    if ((bool)info["is_mvp"])
                    {
                        effectType1  = Config.EFFECT_WIN;
                        animateType1 = null;
                        animateDir1  = null;
                        isMvp        = true;
                    }
                    else
                    {
                        effectType1  = Config.EFFECT_WIN;
                        animateType1 = "mvp1";
                        animateDir1  = "win_/icon";
                    }
                }
                else
                {
                    //userModel.rank_score = (int)info["rank_score"];
                    if ((bool)info["is_mvp"])
                    {
                        effectType1  = Config.EFFECT_LOSE;
                        animateType1 = null;
                        animateDir1  = null;
                        isMvp        = true;
                    }
                    else
                    {
                        effectType1  = Config.EFFECT_LOSE;
                        animateType1 = "normal";
                        animateDir1  = "los/lose_";
                    }
                }
                initQueue.Init(new List <Action> {
                    Effect1,
                    Effect7
                });
            }
        }
    }
コード例 #2
0
    private void touchEnd(EventContext context)
    {
        TimerManager.inst.Remove(Time1);
        TimerManager.inst.Remove(Time_Move);
        if (t1 != null)
        {
            t1.Kill();
        }
        if (t2 != null)
        {
            t2.Kill();
        }
        if (t3 != null)
        {
            t3.Kill();
        }
        float temp = context.inputEvent.y;

        //moveTime = 1f;
        TimerManager.inst.Add(1f, 1, (float a) =>
        {
//            Debug.Log("AAAAAAAAAAAA" + tempTouchStart + "SSSSS" + temp + "vvvvvvv" + image_photo.position.y);
            if (tempTouchStart > temp)
            {
                if (image_photo.position.y > -15)
                {
                    initQueue.Init(new List <Action> {
                        Move1,
                        Distance,
                        Move2,
                        Distance,
                        MoveStart
                    });
                }
                else
                {
                    //image_photo_.asCom.scrollPane.posY = -70;
                    initQueue.Init(new List <Action> {
                        Move2,
                        Distance,
                        MoveStart
                    });
                }
            }
            else
            {
                //image_photo_.asCom.scrollPane.posY = -70;
                //Debug.Log("BBBBBBBBBBB" + tempTouchStart + "SSSSS" + temp);
                //initQueue.Init(new List<Action> {
                //    Move2,
                //    Distance,
                //    MoveStart
                //});
                if (image_photo.position.y < -20)
                {
                    initQueue.Init(new List <Action> {
                        Move2,
                        Distance,
                        MoveStart
                    });
                }
                else
                {
                    initQueue.Init(new List <Action> {
                        MoveStart
                    });
                }
            }
        });
    }