Пример #1
0
 public void SetList(QuizInfo quiz)
 {
     mSelectedQuiz = quiz;
     mList.GetComponent <UIDraggablePanel2>().Init(1, delegate(UIListItem item, int index){
         ScriptItemHitterHighlight sItem = item.Target.GetComponent <ScriptItemHitterHighlight>();
         sItem.Init(this, mSelectedQuiz, transform.FindChild("ItemDetail").gameObject);
         item.Target.transform.FindChild("Round").gameObject.SetActive(false);
     });
     mList.GetComponent <UIDraggablePanel2>().ResetPosition();
 }
Пример #2
0
    public void ResetList(Vector3 vector3, Vector2 vector2)
    {
        Debug.Log("list Cnt : " + QuizMgr.QuizList.Count);
        mGameRoundCounter = 99;
        foreach (QuizInfo quizInfo in QuizMgr.QuizList)
        {
            quizInfo.mShowInningFlag = false;
            if (quizInfo.typeCode.Contains("_QZD_"))
            {
                if (mGameRoundCounter > quizInfo.gameRound)
                {
                    if (mGameRoundCounter < 99)
                    {
                    }
                    else
                    {
                        mGameRound  = quizInfo.gameRound;
                        mInningType = quizInfo.inningType;
                    }
                    mGameRoundCounter        = quizInfo.gameRound;
                    mInningCounter           = quizInfo.inningType;
                    quizInfo.mShowInningFlag = true;
                }
                else if (mInningCounter != quizInfo.inningType)
                {
                    mInningCounter           = quizInfo.inningType;
                    quizInfo.mShowInningFlag = true;
                }
            }
        }
        ScriptMainTop.MyPoint = 0;
        Debug.Log("MyPoint Reset");
        QuizRespInfo resp = null;

        for (int i = 0; i < mEventProgQuiz.Response.data.quiz.Count; i++)
        {
            QuizInfo quizInfo2 = mEventProgQuiz.Response.data.quiz[i];
            for (int a = 0; a < quizInfo2.resp.Count; a++)
            {
                resp = quizInfo2.resp[a];
                if (resp.respValue.Equals(quizInfo2.quizValue))
                {
                    ScriptMainTop.MyPoint += resp.expectRewardPoint;
                    break;
                }
            }
        }

//		for (int i=0; i<mEventProgQuiz.Response.data.quiz.Count; i++) {
//			Debug.Log ("mEventProgQuiz.Response.data.quiz [0].gameRound  : "+mEventProgQuiz.Response.data.quiz [i].gameRound);
//		}


        Debug.Log("mEventProgQuiz.Response.data.quiz : " + mEventProgQuiz.Response.data.quiz.Count);
//		if (mEventProgQuiz.Response.data.quiz.Count <= 0) {
//			TF_Landing.GetComponent<LandingManager>().GetLineUp();
//		}
        Debug.Log("UtilMgr.gameround is " + UtilMgr.gameround);
        if (UtilMgr.gameround == 0 && mEventProgQuiz.Response.data.quiz != null)
        {
            if (mEventProgQuiz.Response.data.quiz [0].gameRound != null)
            {
                if (mEventProgQuiz.Response.data.quiz.Count > 0)
                {
                    //					transform.root.FindChild("TF_Highlight").FindChild("MatchPlaying").FindChild("ListHighlight").FindChild("Label").gameObject.SetActive(false);
                    //				Debug.Log("(mEventProgQuiz.Response.data.quiz [0].gameRound) : " + (mEventProgQuiz.Response.data.quiz [0].gameRound));
                    //				Debug.Log("(mEventProgQuiz.Response.data.quiz [0].inningType) : " + (mEventProgQuiz.Response.data.quiz [0].inningType));
                    UtilMgr.gameround = (((mEventProgQuiz.Response.data.quiz [0].gameRound) * 2) + (mEventProgQuiz.Response.data.quiz [0].inningType - 1));
                    if (UtilMgr.gameround > 1)
                    {
                        if (UserMgr.Schedule.myEntryFee != null)
                        {
                            if (int.Parse(UserMgr.Schedule.myEntryFee) > 0)
                            {
                                TF_Landing.GetComponent <LandingManager> ().GetRank();
                            }
                        }
                    }
                }
            }
        }
        else
        {
            if (mEventProgQuiz.Response.data.quiz [0].gameRound != null)
            {
                if (UtilMgr.gameround < ((mEventProgQuiz.Response.data.quiz [0].gameRound) * 2) + (mEventProgQuiz.Response.data.quiz [0].inningType - 1) && UtilMgr.gameround > 0)
                {
                    TF_Landing.GetComponent <LandingManager> ().GetRank();
                }
                UtilMgr.gameround = ((mEventProgQuiz.Response.data.quiz [0].gameRound) * 2) + (mEventProgQuiz.Response.data.quiz [0].inningType - 1);
            }
        }
        mList.GetComponent <UIDraggablePanel2> ().Init(QuizMgr.QuizList.Count,
                                                       delegate(UIListItem item, int index) {
            ScriptItemHitterHighlight sItem = item.Target.GetComponent <ScriptItemHitterHighlight>();
            QuizInfo quizInfo = mEventProgQuiz.Response.data.quiz[index];

            sItem.Init(this, quizInfo, transform.FindChild("ItemDetail").gameObject);
            item.Target.transform.FindChild("Round").gameObject.SetActive(false);
            if (quizInfo.mShowInningFlag)
            {
                item.Target.transform.FindChild("Round").gameObject.SetActive(true);
                item.Target.transform.FindChild("Round").FindChild("LblRound")
                .GetComponent <UILabel>().text = "" + quizInfo.gameRound;
                if (quizInfo.inningType == 0)
                {
                    item.Target.transform.FindChild("Round").FindChild("SprArrow")
                    .GetComponent <UISprite>().flip = UIBasicSprite.Flip.Nothing;
                }
                else
                {
                    item.Target.transform.FindChild("Round").FindChild("SprArrow")
                    .GetComponent <UISprite>().flip = UIBasicSprite.Flip.Vertically;
                }
            }
        });
        mList.GetComponent <UIDraggablePanel2> ().ResetPosition();
//		if(vector3 == Vector3.zero){
//			Debug.Log("no vector");
//		} else{
//			Debug.Log("vector : "+vector3.y);
//			mList.transform.localPosition = vector3;
//			mList.GetComponent<UIPanel>().clipOffset = vector2;
//		}
    }