Beispiel #1
0
    public void AddQuizList(QuizInfo quizInfo)
    {
        Debug.Log("AddQuizList");
        QuizMgr.AddQuizList(quizInfo);
        ResetList();

        mGameRound  = quizInfo.gameRound;
        mInningType = quizInfo.inningType;
    }
    public void AddQuizList(QuizInfo quizInfo)
    {
        mAccumulatedY = 0f;
//		mPosGuide = 0f;
        mPosGuide    = (122 - 30f) / 2f;
        mPreItemSize = 122f;

        QuizMgr.AddQuizList(quizInfo);
//		QuizInfo quizInfo = quizEvent.Response.data.quiz[quizEvent.Response.data.quiz.Count-1];
        if (quizInfo.gameRound == mGameRound &&
            quizInfo.inningType == mInningType)
        {
            GameObject go = mQuizListItems [0];
            RepositionItems(-go.GetComponent <BoxCollider2D> ().size.y);
            mQuizListItems.RemoveAt(0);
            NGUITools.Destroy(go);
        }
//		Debug.Log ("quizInfo.gameRound : " + quizInfo.gameRound + ", mGameRound : " + mGameRound);
//		Debug.Log ("quizInfo.inningType : " + quizInfo.inningType + ", mInningType : " + mInningType);

        AddQuizIntoList(quizInfo);

        mGameRound  = quizInfo.gameRound;
        mInningType = quizInfo.inningType;

        GameObject obj = Instantiate(itemRound, new Vector3(0f, 0f, 0f), Quaternion.identity) as GameObject;

        mQuizListItems.Insert(0, obj);
        RepositionItems(obj.GetComponent <BoxCollider2D> ().size.y);

        obj.transform.parent     = mList.transform;    //.FindChild("Grid");
        obj.transform.localScale = new Vector3(1f, 1f, 1f);
        if (mInningType == 0)
        {
            obj.transform.FindChild("LblTail").gameObject.SetActive(false);
        }
        else
        {
            obj.transform.FindChild("LblHead").gameObject.SetActive(false);
        }

        obj.transform.FindChild("LblRound").GetComponent <UILabel>().text = mGameRound + "";
        obj.transform.localPosition = new Vector3(0f, 0f, 0f);

        mList.GetComponent <UIScrollView> ().ResetPosition();
    }