void ReceivedUserRanking()
    {
        transform.FindChild("Body").FindChild("ScrollUser").gameObject.SetActive(true);
        transform.FindChild("Body").FindChild("ScrollPlayer").gameObject.SetActive(false);

        UtilMgr.ClearList(transform.FindChild("Body").FindChild("ScrollUser"));
        transform.FindChild("Body").FindChild("ScrollUser").GetComponent <UIDraggablePanel2>().Init(
            mUserEvent.Response.data.Count, delegate(UIListItem item, int index) {
            item.Target.transform.FindChild("SprRankbox").FindChild("Label").GetComponent <UILabel>()
            .text = mUserEvent.Response.data[index].rank + "";
            item.Target.transform.FindChild("LblName").GetComponent <UILabel>()
            .text = mUserEvent.Response.data[index].name;
            item.Target.transform.FindChild("LblPtLeft").GetComponent <UILabel>()
            .text = mUserEvent.Response.data[index].rankPoint + "";

            item.Target.transform.FindChild("SprPhotoBG").FindChild("Photo").FindChild("Texture")
            .GetComponent <UITexture>().mainTexture = UtilMgr.GetTextureDefault();
            UtilMgr.LoadUserImage(mUserEvent.Response.data[index].photoUrl,
                                  item.Target.transform.FindChild("SprPhotoBG").FindChild("Photo").FindChild("Texture")
                                  .GetComponent <UITexture>());
        });
        transform.FindChild("Body").FindChild("ScrollUser").GetComponent <UIDraggablePanel2>().ResetPosition();

        if (NeedAnimation)
        {
            UtilMgr.AddBackState(UtilMgr.STATE.Ranking);
            UtilMgr.AnimatePageToLeft("Lobby", "Ranking");
        }
    }
    void InitEntries()
    {
        Transform tf = transform.FindChild("Changeables").FindChild("Entries");

        tf.gameObject.SetActive(true);
        UtilMgr.ClearList(tf.FindChild("Draggable"));
        tf.FindChild("Draggable").GetComponent <UIDraggablePanel2>().Init(mEntryEvent.Response.data.Count,
                                                                          delegate(UIListItem item, int index) {
            item.Target.transform.FindChild("SprRankbox").FindChild("Label").GetComponent <UILabel>()
            .text = mEntryEvent.Response.data[index].rank + "";
            item.Target.transform.FindChild("LblName").GetComponent <UILabel>().text
                = mEntryEvent.Response.data[index].name;
            item.Target.transform.FindChild("LblPtLeft").GetComponent <UILabel>().text
                = mEntryEvent.Response.data[index].fantasyPoint + "";

            float ratio = mEntryEvent.Response.data[index].gameOverPlayers / 9f;
            int width   = (int)(152 * ratio);
            item.Target.transform.FindChild("Panel").FindChild("SprGaugeFront").GetComponent <UISprite>()
            .width = width;
            item.Target.transform.FindChild("Panel").FindChild("SprGaugeFront").localPosition
                = new Vector3(-((152 - width) / 2), 0);

            item.Target.transform.FindChild("SprPhotoBG")
            .FindChild("Photo").FindChild("Texture").GetComponent <UITexture>().mainTexture =
                UtilMgr.GetTextureDefault();

            UtilMgr.LoadUserImage(mEntryEvent.Response.data[index].photoUrl,
                                  item.Target.transform.FindChild("SprPhotoBG")
                                  .FindChild("Photo").FindChild("Texture").GetComponent <UITexture>());
        });
        tf.FindChild("Draggable").GetComponent <UIDraggablePanel2>().ResetPosition();
    }
    public void Initialize()
    {
        UtilMgr.ClearList(transform.FindChild("Body").FindChild("List").FindChild("Scroll View"));

        float height = 136f * 8f;

        for (int i = 0; i < transform.FindChild("Body").FindChild("Ground").FindChild("BtnPosition").childCount; i++)
        {
            transform.FindChild("Body").FindChild("Ground").FindChild("BtnPosition")
            .GetChild(i).GetComponent <BtnPosition>().SetUndesignated();

            GameObject go = Instantiate(mRegItem);
            go.transform.parent        = transform.FindChild("Body").FindChild("List").FindChild("Scroll View");
            go.transform.localPosition = new Vector3(0, height - (136f * i), 0);
            go.transform.localScale    = new Vector3(1f, 1f, 1f);
            go.transform.FindChild("Label").GetComponent <UILabel>().text = (i + 1) + "";
            go.transform.GetComponent <ItemPosition>().SetUndesignated();

//			go.transform.FindChild("BG").GetComponents<UIDragScrollView>()[0].scrollView
//				= transform.FindChild("Body").FindChild("List").FindChild("Scroll View").GetComponent<UIScrollView>();
//			go.transform.FindChild("BG").GetComponents<UIDragScrollView>()[1].scrollView
//				= transform.FindChild("Body").GetComponent<UIScrollView>();
        }
        transform.FindChild("Body").FindChild("List").FindChild("Scroll View").GetComponent <UIScrollView>().ResetPosition();

        transform.FindChild("Body").FindChild("Btm").GetComponent <BtmInfo>()
        .SetBtmInfo(transform.FindChild("Body").FindChild("List").FindChild("Scroll View"));

        transform.FindChild("InfoTop").FindChild("NewEntry").FindChild("Input").GetComponent <UIInput>().value =
            transform.FindChild("InfoTop").FindChild("NewEntry").FindChild("Input").GetComponent <UIInput>().defaultText;

        transform.FindChild("Body").GetComponent <UIScrollView>().ResetPosition();
    }
Exemple #4
0
    public void InitItemShop(string title, int category, GetItemShopGoldEvent goldEvent)
    {
        mItemList = goldEvent.Response.data;
        transform.FindChild("Top").FindChild("LblShop").GetComponent <UILabel>().text = title;
        mCategory = category;
        UtilMgr.ClearList(transform.FindChild("Body").FindChild("Scroll View"));

        if (category == GOLD)
        {
            /**서버 요청에 의해 마켓 결제용 api가 따로 존재해서 지금은 사용하지 않음*/
            InitGoldList();
        }
        else if (category == TICKET)
        {
            InitTicketList();
        }
        else if (category == CARD)
        {
            InitCardList();
        }
        else
        {
            InitSkillList();
        }
    }
    void InitRules()
    {
        Transform tf = transform.FindChild("Changeables").FindChild("Rules");

        tf.gameObject.SetActive(true);
        UtilMgr.ClearList(tf.FindChild("Scroll View"));

        float stackedHeight = 0f;

        GameObject go = Instantiate(mItemRulesHeader);

        go.transform.parent        = tf.FindChild("Scroll View");
        stackedHeight             -= 30f;
        go.transform.localPosition = new Vector3(0, stackedHeight);
        stackedHeight             -= 30f;
        go.transform.localScale    = new Vector3(1f, 1f, 1f);
        go.transform.FindChild("LblLeft").GetComponent <UILabel>().text = UtilMgr.GetLocalText("StrHitter");
        for (int i = 0; i < RulesInfo[0].Length; i++)
        {
            go = Instantiate(mItemRulesDetail);
            go.transform.parent        = tf.FindChild("Scroll View");
            stackedHeight             -= 68f;
            go.transform.localPosition = new Vector3(0, stackedHeight);
            stackedHeight             -= 68f;
            go.transform.localScale    = new Vector3(1f, 1f, 1f);
            go.transform.FindChild("LblLeft").GetComponent <UILabel>().text = RulesInfo[0][i].mName;
            go.transform.FindChild("LblRight").GetComponent <UILabel>().text
                = RulesInfo[0][i].mPoint;
//				> 0f ? "+ " + RulesInfo[0][i].mPoint
//				: "- " + Math.Abs(RulesInfo[0][i].mPoint);
        }
        go = Instantiate(mItemRulesHeader);
        go.transform.parent        = tf.FindChild("Scroll View");
        stackedHeight             -= 30f;
        go.transform.localPosition = new Vector3(0, stackedHeight);
        stackedHeight             -= 30f;
        go.transform.localScale    = new Vector3(1f, 1f, 1f);
        go.transform.FindChild("LblLeft").GetComponent <UILabel>().text = UtilMgr.GetLocalText("StrPitcher2");
        for (int i = 0; i < RulesInfo[1].Length; i++)
        {
            go = Instantiate(mItemRulesDetail);
            go.transform.parent        = tf.FindChild("Scroll View");
            stackedHeight             -= 68f;
            go.transform.localPosition = new Vector3(0, stackedHeight);
            stackedHeight             -= 68f;
            go.transform.localScale    = new Vector3(1f, 1f, 1f);
            go.transform.FindChild("LblLeft").GetComponent <UILabel>().text = RulesInfo[1][i].mName;
            go.transform.FindChild("LblRight").GetComponent <UILabel>().text
                = RulesInfo[1][i].mPoint;
//				> 0f ? "+ " + RulesInfo[1][i].mPoint
//				: "- " + Math.Abs(RulesInfo[1][i].mPoint);
        }

        tf.FindChild("Scroll View").GetComponent <UIScrollView>().ResetPosition();
    }
    void InitGames()
    {
        Transform tf = transform.FindChild("Changeables").FindChild("Games");

        tf.gameObject.SetActive(true);
        UtilMgr.ClearList(tf.FindChild("Draggable"));
        tf.FindChild("Draggable").GetComponent <UIDraggablePanel2>().Init(mTeamEvent.Response.data.Count,
                                                                          delegate(UIListItem item, int index) {
            item.Target.transform.FindChild("SprLeft").FindChild("Label").GetComponent <UILabel>()
            .text = mTeamEvent.Response.data[index].awayTeamRuns + "";
            item.Target.transform.FindChild("SprRight").FindChild("Label").GetComponent <UILabel>()
            .text = mTeamEvent.Response.data[index].homeTeamRuns + "";
            item.Target.transform.FindChild("SprLeft").FindChild("SprEmblem").GetComponent <UISprite>()
            .spriteName = mTeamEvent.Response.data[index].awayTeamId + "";
            item.Target.transform.FindChild("SprRight").FindChild("SprEmblem").GetComponent <UISprite>()
            .spriteName = mTeamEvent.Response.data[index].homeTeamId + "";

            if (!UtilMgr.IsMLB())
            {
                item.Target.transform.FindChild("SprLeft").FindChild("SprEmblem").GetComponent <UISprite>().width   = 74;
                item.Target.transform.FindChild("SprLeft").FindChild("SprEmblem").GetComponent <UISprite>().height  = 60;
                item.Target.transform.FindChild("SprRight").FindChild("SprEmblem").GetComponent <UISprite>().width  = 74;
                item.Target.transform.FindChild("SprRight").FindChild("SprEmblem").GetComponent <UISprite>().height = 60;
            }


            item.Target.transform.FindChild("LblCenter").GetComponent <UILabel>()
            .text      = mTeamEvent.Response.data[index].awayTeam + "         " + mTeamEvent.Response.data[index].homeTeam;
            int hour   = int.Parse(mTeamEvent.Response.data[index].dateTime.Substring(8, 2));
            string min = mTeamEvent.Response.data[index].dateTime.Substring(10, 2);            //20160326220500

            if (UtilMgr.IsMLB())
            {
                item.Target.transform.FindChild("LblCenter").FindChild("LblUnder").GetComponent <UILabel>()
                .text = mTeamEvent.Response.data[index].day + " ET " + UtilMgr.GetAMPM(hour)[0] + ":" + min
                        + " " + UtilMgr.GetAMPM(hour)[1];
            }
            else
            {
                if (Localization.language.Equals("English"))
                {
                    item.Target.transform.FindChild("LblCenter").FindChild("LblUnder").GetComponent <UILabel>()
                    .text = mTeamEvent.Response.data[index].day + " KST " + UtilMgr.GetAMPM(hour)[0] + ":" + min
                            + " " + UtilMgr.GetAMPM(hour)[1];
                }
                else
                {
                    item.Target.transform.FindChild("LblCenter").FindChild("LblUnder").GetComponent <UILabel>()
                    .text = "KST " + UtilMgr.GetAMPM(hour)[0] + ":" + min
                            + " (" + UtilMgr.GetAMPM(hour)[1] + UtilMgr.DayToKorean(mTeamEvent.Response.data[index].day) + ")";
                }
            }
        });
        tf.FindChild("Draggable").GetComponent <UIDraggablePanel2>().ResetPosition();
    }
Exemple #7
0
    public void Reload()
    {
        transform.FindChild("Top").FindChild("LblMyLineup").GetComponent <UILabel>().text
            = UtilMgr.GetLocalText("LblMyLineup") + " [00a0e9][" + mLineupEvent.Response.data.Count + "/50]";

        transform.FindChild("Body").FindChild("Draggable").GetComponent <UIDraggablePanel2>().RemoveAll();
        UtilMgr.ClearList(transform.FindChild("Body").FindChild("Draggable"));
        transform.FindChild("Body").FindChild("Draggable").GetComponent <UIDraggablePanel2>()
        .Init(mLineupEvent.Response.data.Count, delegate(UIListItem item, int index) {
            InitItem(item, index);
        });
        transform.FindChild("Body").FindChild("Draggable").GetComponent <UIDraggablePanel2>().ResetPosition();
    }
Exemple #8
0
    void ReceivedLineup()
    {
        transform.FindChild("Top").FindChild("LblMyLineup").GetComponent <UILabel>().text
            = UtilMgr.GetLocalText("LblMyLineup") + " [00a0e9][" + mLineupEvent.Response.data.Count + "/50]";

        UtilMgr.ClearList(transform.FindChild("Body").FindChild("Draggable"));
        transform.FindChild("Body").FindChild("Draggable").GetComponent <UIDraggablePanel2>()
        .Init(mLineupEvent.Response.data.Count, delegate(UIListItem item, int index) {
            InitItem(item, index);
        });
        transform.FindChild("Body").FindChild("Draggable").GetComponent <UIDraggablePanel2>().ResetPosition();

        UtilMgr.AddBackState(UtilMgr.STATE.Lineup);
        UtilMgr.AnimatePageToLeft("RegisterEntry", "Lineup");
    }
    void InitPrizes()
    {
        Transform tf = transform.FindChild("Changeables").FindChild("Prizes");

        tf.gameObject.SetActive(true);
        UtilMgr.ClearList(tf.FindChild("Draggable"));

        tf.FindChild("Draggable").GetComponent <UIDraggablePanel2>().Init(
            mRewardEvent.Response.data.Count, delegate(UIListItem item, int index) {
            item.Target.transform.FindChild("LblLeft").GetComponent <UILabel>().text
                = mRewardEvent.Response.data[index].rank
                  + UtilMgr.GetOrderString(mRewardEvent.Response.data[index].rank);
            item.Target.transform.FindChild("LblRight").GetComponent <UILabel>().text
                = mRewardEvent.Response.data[index].gold + "G";
        });
    }
Exemple #10
0
    void InitGoldList()
    {
        UtilMgr.ClearList(transform.FindChild("Body").FindChild("Scroll View"));
        float        height     = 0;
        UIScrollView scrollview = transform.FindChild("Body").FindChild("Scroll View").GetComponent <UIScrollView>();

        for (int i = 0; i < mGoldList.Count; i++)
        {
            ShopGoldInfo shopInfo = mGoldList[i];
            GameObject   go       = Instantiate(mItemShop);
            height = -136f;
            go.transform.parent        = scrollview.transform;
            go.transform.localScale    = new Vector3(1f, 1f, 1f);
            go.transform.localPosition = new Vector3(0, height * i, 0);
            go.transform.FindChild("LblTitle").GetComponent <UILabel>().text = shopInfo.productName;
            go.transform.FindChild("LblDesc").GetComponent <UILabel>().text  = shopInfo.productDesc;
            if (shopInfo.productDesc.IndexOf("BONUS") > -1)
            {
                go.transform.FindChild("BtnPhoto").FindChild("Bonus").gameObject.SetActive(true);
            }
            else
            {
                go.transform.FindChild("BtnPhoto").FindChild("Bonus").gameObject.SetActive(false);
            }

            go.transform.FindChild("BtnPhoto").FindChild("Item").GetComponent <UISprite>().spriteName
                = "shop_gold_number_" + (i + 1);
            go.transform.FindChild("BtnPhoto").FindChild("Item").GetComponent <UISprite>().height = 108;
            go.transform.FindChild("BtnPhoto").FindChild("Item").GetComponent <UISprite>().width  = 108;
            go.transform.FindChild("BtnPhoto").FindChild("SprTicket").gameObject.SetActive(false);

            if (IsSupported)
            {
                go.transform.FindChild("LblPrice").gameObject.SetActive(true);
                go.transform.FindChild("LblPrice").GetComponent <UILabel>().text
                    = mGoldList[i].priceDesc;
            }
            else
            {
                go.transform.FindChild("LblPrice").gameObject.SetActive(false);
            }
            go.transform.FindChild("LblPrice").FindChild("Sprite").gameObject.SetActive(false);

            go.transform.FindChild("BtnRight").GetComponent <ShopItemBtns>().mGoldInfo = shopInfo;
        }
        scrollview.ResetPosition();
    }
Exemple #11
0
//	IEnumerator WriteTimer(){
//		System.DateTime now = System.DateTime.Now;
//		while(mStop){
//
//		}
//
//		yield return 0;
//	}

    void ReceivedRT()
    {
        bool DonotDelete = false;

        if (mMatchCnt == mRTEvent.Response.data.Count)
        {
            DonotDelete = true;
        }

        if (!DonotDelete)
        {
            UtilMgr.ClearList(transform.FindChild("ScrollRT"));
        }

        float width = 720f;

        for (int i = 0; i < mRTEvent.Response.data.Count; i++)
        {
            Transform item = null;
            if (!DonotDelete)
            {
                item               = Instantiate(mItemRT).transform;
                item.parent        = transform.FindChild("ScrollRT");
                item.localPosition = new Vector3(width * i, 1f, 1f);
                item.localScale    = new Vector3(1f, 1f, 1f);
                item.name          = "itemRTList_" + i;
            }
            else
            {
                item = transform.FindChild("ScrollRT").GetChild(i);
            }

            EventInfo data = mRTEvent.Response.data[i];
            item.GetComponent <ItemRT>().mEventInfo = data;

            item.FindChild("Label").GetComponent <UILabel>().text = i + "";
            if (i == 0)
            {
                item.FindChild("SprBG").FindChild("BtnLeft").GetComponent <BoxCollider2D>().size = Vector2.zero;
                item.FindChild("SprBG").FindChild("BtnLeft").FindChild("Background")
                .GetComponent <UISprite>().color = new Color(0f, 0f, 0f, 0f);
                item.FindChild("SprBG").FindChild("BtnLeft").FindChild("Background (1)")
                .GetComponent <UISprite>().color = new Color(0f, 0f, 0f, 0f);
            }
            else if (i == mRTEvent.Response.data.Count - 1)
            {
                item.FindChild("SprBG").FindChild("BtnRight").GetComponent <BoxCollider2D>().size = Vector2.zero;
                item.FindChild("SprBG").FindChild("BtnRight").FindChild("Background")
                .GetComponent <UISprite>().color = new Color(0f, 0f, 0f, 0f);
                item.FindChild("SprBG").FindChild("BtnRight").FindChild("Background (1)")
                .GetComponent <UISprite>().color = new Color(0f, 0f, 0f, 0f);
            }

            if (Localization.language.Equals("English"))
            {
                item.FindChild("Top").FindChild("LblStadium").GetComponent <UILabel>().text = data.stadiumName;
            }
            else
            {
                item.FindChild("Top").FindChild("LblStadium").GetComponent <UILabel>().text = data.korStadiumName;
            }

            item.FindChild("Top").FindChild("LblStadium").FindChild("Sprite").localPosition = new Vector3(
                -((((float)item.FindChild("Top").FindChild("LblStadium").GetComponent <UILabel>().width) / 2f) + 25f), 1f);

            item.FindChild("Score").FindChild("Left").FindChild("LblScore").GetComponent <UILabel>().text
                = data.awayTeamRuns + "";
            item.FindChild("Score").FindChild("Right").FindChild("LblScore").GetComponent <UILabel>().text
                = data.homeTeamRuns + "";
            item.FindChild("Score").FindChild("Left").FindChild("LblTeam").GetComponent <UILabel>().text
                = data.awayTeam;
            item.FindChild("Score").FindChild("Right").FindChild("LblTeam").GetComponent <UILabel>().text
                = data.homeTeam;
            item.FindChild("Score").FindChild("Left").FindChild("SprEmblem").GetComponent <UISprite>().spriteName
                = data.awayTeamId + "";
            item.FindChild("Score").FindChild("Right").FindChild("SprEmblem").GetComponent <UISprite>().spriteName
                = data.homeTeamId + "";

            if (!UtilMgr.IsMLB())
            {
                item.FindChild("Score").FindChild("Left").FindChild("SprEmblem").GetComponent <UISprite>().width   = 74;
                item.FindChild("Score").FindChild("Left").FindChild("SprEmblem").GetComponent <UISprite>().height  = 60;
                item.FindChild("Score").FindChild("Right").FindChild("SprEmblem").GetComponent <UISprite>().width  = 74;
                item.FindChild("Score").FindChild("Right").FindChild("SprEmblem").GetComponent <UISprite>().height = 60;
            }

            if (data.inningHalf.Equals("T"))
            {
                item.FindChild("Score").FindChild("Left").FindChild("SprStar").gameObject.SetActive(true);
                item.FindChild("Score").FindChild("Right").FindChild("SprStar").gameObject.SetActive(false);

                if (data.inning < 1)
                {
                    item.FindChild("Players").GetComponent <UILabel>().text = "";
                }
                else
                {
                    if (Localization.language.Equals("English"))
                    {
                        item.FindChild("Players").GetComponent <UILabel>().text
                            = UtilMgr.GetLocalText("StrTop") + " " + data.inning + UtilMgr.GetRoundString(data.inning);
                    }
                    else
                    {
                        item.FindChild("Players").GetComponent <UILabel>().text
                            = data.inning + UtilMgr.GetRoundString(data.inning) + " " + UtilMgr.GetLocalText("StrTop");
                    }
                }

                item.FindChild("Players").FindChild("Left").FindChild("Frame")
                .FindChild("Photo").FindChild("TxtPlayer").GetComponent <UITexture>().mainTexture
                    = UtilMgr.GetTextureDefault();

                item.FindChild("Players").FindChild("Left").FindChild("Frame")
                .FindChild("Photo").FindChild("TxtPlayer").GetComponent <UITexture>().color
                    = new Color(1f, 1f, 1f, 50f / 255f);
//				if(!UtilMgr.IsMLB())
                item.FindChild("Players").FindChild("Left").FindChild("Frame")
                .FindChild("Photo").FindChild("TxtPlayer").GetComponent <UITexture>().width = 70;

//				UtilMgr.LoadImage(data.hitterPhoto,
//				                  item.FindChild("Players").FindChild("Left").FindChild("Frame")
//				                  .FindChild("Photo").FindChild("TxtPlayer").GetComponent<UITexture>());
                item.FindChild("Players").FindChild("Left")
                .FindChild("Frame").FindChild("SprPos").FindChild("Label").GetComponent <UILabel>().text = "B";

                item.FindChild("Players").FindChild("Right").FindChild("Frame")
                .FindChild("Photo").FindChild("TxtPlayer").GetComponent <UITexture>().mainTexture
                    = UtilMgr.GetTextureDefault();

                item.FindChild("Players").FindChild("Right").FindChild("Frame")
                .FindChild("Photo").FindChild("TxtPlayer").GetComponent <UITexture>().color
                    = new Color(1f, 1f, 1f, 50f / 255f);
//				if(!UtilMgr.IsMLB())
                item.FindChild("Players").FindChild("Right").FindChild("Frame")
                .FindChild("Photo").FindChild("TxtPlayer").GetComponent <UITexture>().width = 70;

//				UtilMgr.LoadImage(data.pitcherPhoto,
//				                  item.FindChild("Players").FindChild("Right").FindChild("Frame")
//				                  .FindChild("Photo").FindChild("TxtPlayer").GetComponent<UITexture>());
                item.FindChild("Players").FindChild("Right")
                .FindChild("Frame").FindChild("SprPos").FindChild("Label").GetComponent <UILabel>().text = "P";

                item.FindChild("Players").FindChild("Left")
                .FindChild("Frame").FindChild("Label").GetComponent <UILabel>().text = data.hitterName;
                item.FindChild("Players").FindChild("Right")
                .FindChild("Frame").FindChild("Label").GetComponent <UILabel>().text = data.pitcherName;
            }
            else
            {
                item.FindChild("Score").FindChild("Right").FindChild("SprStar").gameObject.SetActive(true);
                item.FindChild("Score").FindChild("Left").FindChild("SprStar").gameObject.SetActive(false);

                if (data.inning < 1)
                {
                    item.FindChild("Players").GetComponent <UILabel>().text = "";
                }
                else
                {
                    if (Localization.language.Equals("English"))
                    {
                        item.FindChild("Players").GetComponent <UILabel>().text
                            = UtilMgr.GetLocalText("StrBottom") + " " + data.inning + UtilMgr.GetRoundString(data.inning);
                    }
                    else
                    {
                        item.FindChild("Players").GetComponent <UILabel>().text
                            = data.inning + UtilMgr.GetRoundString(data.inning) + " " + UtilMgr.GetLocalText("StrBottom");
                    }
                }

                item.FindChild("Players").FindChild("Left").FindChild("Frame")
                .FindChild("Photo").FindChild("TxtPlayer").GetComponent <UITexture>().mainTexture
                    = UtilMgr.GetTextureDefault();

                item.FindChild("Players").FindChild("Left").FindChild("Frame")
                .FindChild("Photo").FindChild("TxtPlayer").GetComponent <UITexture>().color
                    = new Color(1f, 1f, 1f, 50f / 255f);

//				if(!UtilMgr.IsMLB())
                item.FindChild("Players").FindChild("Left").FindChild("Frame")
                .FindChild("Photo").FindChild("TxtPlayer").GetComponent <UITexture>().width = 70;

                item.FindChild("Players").FindChild("Right").FindChild("Frame")
                .FindChild("Photo").FindChild("TxtPlayer").GetComponent <UITexture>().mainTexture
                    = UtilMgr.GetTextureDefault();

                item.FindChild("Players").FindChild("Right").FindChild("Frame")
                .FindChild("Photo").FindChild("TxtPlayer").GetComponent <UITexture>().color
                    = new Color(1f, 1f, 1f, 50f / 255f);

//				if(!UtilMgr.IsMLB())
                item.FindChild("Players").FindChild("Right").FindChild("Frame")
                .FindChild("Photo").FindChild("TxtPlayer").GetComponent <UITexture>().width = 70;

//				UtilMgr.LoadImage(data.hitterPhoto,
//				                  item.FindChild("Players").FindChild("Right").FindChild("Frame")
//				                  .FindChild("Photo").FindChild("TxtPlayer").GetComponent<UITexture>());
                item.FindChild("Players").FindChild("Right")
                .FindChild("Frame").FindChild("SprPos").FindChild("Label").GetComponent <UILabel>().text = "B";

//				UtilMgr.LoadImage(data.pitcherPhoto,
//				                  item.FindChild("Players").FindChild("Left").FindChild("Frame")
//				                  .FindChild("Photo").FindChild("TxtPlayer").GetComponent<UITexture>());
                item.FindChild("Players").FindChild("Left")
                .FindChild("Frame").FindChild("SprPos").FindChild("Label").GetComponent <UILabel>().text = "P";

                item.FindChild("Players").FindChild("Right")
                .FindChild("Frame").FindChild("Label").GetComponent <UILabel>().text = data.hitterName;
                item.FindChild("Players").FindChild("Left")
                .FindChild("Frame").FindChild("Label").GetComponent <UILabel>().text = data.pitcherName;
            }

            string dateTime = null;
            if (UtilMgr.IsMLB())
            {
                dateTime = data.dateTime;
            }
            else
            {
                dateTime = data.korDateTime;
            }
            int year = 0, mon = 0, day = 0, hour = 0, min = 0, sec = 0;
            year = int.Parse(dateTime.Substring(0, 4));
            mon  = int.Parse(dateTime.Substring(4, 2));
            day  = int.Parse(dateTime.Substring(6, 2));
            hour = int.Parse(dateTime.Substring(8, 2));
            min  = int.Parse(dateTime.Substring(10, 2));
            sec  = int.Parse(dateTime.Substring(12, 2));

            if (data.status.Equals("Scheduled"))
            {
                item.FindChild("BtnEnter").FindChild("LblEnter").GetComponent <UILabel>().text =
                    UtilMgr.GetLocalText("StrGameReady");
                item.FindChild("BtnEnter").FindChild("Background").GetComponent <UISprite>().color
                    = new Color(255f / 255f, 91f / 255f, 16f / 255f);
                item.FindChild("BtnEnter").GetComponent <UIButton>().defaultColor
                    = new Color(255f / 255f, 91f / 255f, 16f / 255f);
                item.FindChild("BtnEnter").GetComponent <UIButton>().hover
                    = new Color(255f / 255f, 91f / 255f, 16f / 255f);
                item.FindChild("BtnEnter").GetComponent <UIButton>().pressed
                    = new Color(255f / 255f, 91f / 255f, 16f / 255f);
                item.FindChild("Top").FindChild("SprLive").gameObject.SetActive(false);

                string strMin = min + " ";
                if (min < 10)
                {
                    strMin = "0" + min + " ";
                }

                if (UtilMgr.IsMLB())
                {
                    item.FindChild("Players").GetComponent <UILabel>().text = "ET "
                                                                              + UtilMgr.GetAMPM(hour)[0] + ":" +
                                                                              strMin + UtilMgr.GetAMPM(hour)[1];
                }
                else
                {
                    item.FindChild("Players").GetComponent <UILabel>().text = "KST "
                                                                              + UtilMgr.GetAMPM(hour)[0] + ":" +
                                                                              strMin + UtilMgr.GetAMPM(hour)[1];
                }
            }
            else if (data.status.Equals("InProgress"))
            {
                item.FindChild("BtnEnter").FindChild("LblEnter").GetComponent <UILabel>().text
                    = UtilMgr.GetLocalText("LblEnter");
                item.FindChild("BtnEnter").FindChild("Background").GetComponent <UISprite>().color
                    = new Color(0 / 255f, 106f / 255f, 216f / 255f);
                item.FindChild("BtnEnter").GetComponent <UIButton>().defaultColor
                    = new Color(0 / 255f, 106f / 255f, 216f / 255f);
                item.FindChild("BtnEnter").GetComponent <UIButton>().hover
                    = new Color(0 / 255f, 106f / 255f, 216f / 255f);
                item.FindChild("BtnEnter").GetComponent <UIButton>().pressed
                    = new Color(1f, 91f / 255f, 16f / 255f);
                item.FindChild("Top").FindChild("SprLive").gameObject.SetActive(true);

                if (!UtilMgr.IsMLB())
                {
                    if (data.inningState.Equals("END"))
                    {
                        item.FindChild("BtnEnter").FindChild("LblEnter").GetComponent <UILabel>().text
                            = "공수 교대 중";
                    }
                }
            }
            else if (data.status.Equals("Final"))
            {
                item.FindChild("BtnEnter").FindChild("LblEnter").GetComponent <UILabel>().text
                    = UtilMgr.GetLocalText("StrGameOver");
                item.FindChild("BtnEnter").FindChild("Background").GetComponent <UISprite>().color
                    = new Color(102f / 255f, 102f / 255f, 102f / 255f);
                item.FindChild("BtnEnter").GetComponent <UIButton>().defaultColor
                    = new Color(102f / 255f, 102f / 255f, 102f / 255f);
                item.FindChild("BtnEnter").GetComponent <UIButton>().hover
                    = new Color(102f / 255f, 102f / 255f, 102f / 255f);
                item.FindChild("BtnEnter").GetComponent <UIButton>().pressed
                    = new Color(102f / 255f, 102f / 255f, 102f / 255f);
                item.FindChild("Top").FindChild("SprLive").gameObject.SetActive(false);
            }
            else if (data.status.Equals("Postponed"))
            {
                item.FindChild("BtnEnter").FindChild("LblEnter").GetComponent <UILabel>().text
                    = UtilMgr.GetLocalText("StrPostponed");
                item.FindChild("BtnEnter").FindChild("Background").GetComponent <UISprite>().color
                    = new Color(102f / 255f, 102f / 255f, 102f / 255f);
                item.FindChild("BtnEnter").GetComponent <UIButton>().defaultColor
                    = new Color(102f / 255f, 102f / 255f, 102f / 255f);
                item.FindChild("BtnEnter").GetComponent <UIButton>().hover
                    = new Color(102f / 255f, 102f / 255f, 102f / 255f);
                item.FindChild("BtnEnter").GetComponent <UIButton>().pressed
                    = new Color(102f / 255f, 102f / 255f, 102f / 255f);
                item.FindChild("Top").FindChild("SprLive").gameObject.SetActive(false);
            }
            else if (data.status.Equals("Cancel"))
            {
                item.FindChild("BtnEnter").FindChild("LblEnter").GetComponent <UILabel>().text
                    = UtilMgr.GetLocalText("StrGameCanceled");
                item.FindChild("BtnEnter").FindChild("Background").GetComponent <UISprite>().color
                    = new Color(102f / 255f, 102f / 255f, 102f / 255f);
                item.FindChild("BtnEnter").GetComponent <UIButton>().defaultColor
                    = new Color(102f / 255f, 102f / 255f, 102f / 255f);
                item.FindChild("BtnEnter").GetComponent <UIButton>().hover
                    = new Color(102f / 255f, 102f / 255f, 102f / 255f);
                item.FindChild("BtnEnter").GetComponent <UIButton>().pressed
                    = new Color(102f / 255f, 102f / 255f, 102f / 255f);
                item.FindChild("Top").FindChild("SprLive").gameObject.SetActive(false);
            }
            else
            {
                item.FindChild("BtnEnter").FindChild("LblEnter").GetComponent <UILabel>().text
                    = UtilMgr.GetLocalText("StrGameOver");
                item.FindChild("BtnEnter").FindChild("Background").GetComponent <UISprite>().color
                    = new Color(102f / 255f, 102f / 255f, 102f / 255f);
                item.FindChild("BtnEnter").GetComponent <UIButton>().defaultColor
                    = new Color(102f / 255f, 102f / 255f, 102f / 255f);
                item.FindChild("BtnEnter").GetComponent <UIButton>().hover
                    = new Color(102f / 255f, 102f / 255f, 102f / 255f);
                item.FindChild("BtnEnter").GetComponent <UIButton>().pressed
                    = new Color(102f / 255f, 102f / 255f, 102f / 255f);
                item.FindChild("Top").FindChild("SprLive").gameObject.SetActive(false);
            }

            if (data.joinYN > 0)
            {
                item.FindChild("Top").FindChild("SprJoined").gameObject.SetActive(true);
            }
            else
            {
                item.FindChild("Top").FindChild("SprJoined").gameObject.SetActive(false);
            }
        }



//		transform.FindChild("ScrollRT").GetComponent<UIScrollView>().ResetPosition();
        transform.FindChild("ScrollRT").GetComponent <UICenterOnChild>().Recenter();

        if (transform.root.FindChild("Lobby").GetComponent <Lobby>().mState != UtilMgr.STATE.Lobby)
        {
            UtilMgr.AnimatePageToRight(
                transform.root.FindChild("Lobby").GetComponent <Lobby>().mState.ToString(), "Lobby",
                new EventDelegate(AnimationFinish));
            transform.root.FindChild("Lobby").GetComponent <Lobby>().mState = UtilMgr.STATE.Lobby;
        }
        else
        {
            AnimationFinish();
        }
    }
Exemple #12
0
    public void Init(string title, ContestDataEvent contestEvent)
    {
        mList = contestEvent.Response.data;
        transform.gameObject.SetActive(true);
        transform.localPosition = new Vector3(1000f, 0);
        transform.FindChild("Top").FindChild("LblTitle").GetComponent <UILabel>().text = title;

        int  totalTickets    = 0;
        long totalEarnedRP   = 0;
        long totalEarnedGold = 0;
        long total1stPrize   = 0;

        foreach (ContestListInfo info in mList)
        {
            totalTickets    += info.entryTicket;
            totalEarnedRP   += info.myRewardRP;
            totalEarnedGold += info.myRewardGold;
            total1stPrize   += info.firstRewardGold;
        }

        UtilMgr.ClearList(transform.FindChild("Body").FindChild("Scroll View"));        //,
//		                  Vector2.zero, new Vector3(0, -118f, 0));

        if (title.Equals(UtilMgr.GetLocalText("LblUpcomingContests")))
        {
            transform.FindChild("Top").FindChild("Upcoming").gameObject.SetActive(true);
            transform.FindChild("Top").FindChild("Live").gameObject.SetActive(false);
            transform.FindChild("Top").FindChild("Recent").gameObject.SetActive(false);

            transform.FindChild("Top").FindChild("Upcoming").FindChild("Entries").FindChild("LblEntriesV")
            .GetComponent <UILabel>().text = contestEvent.Response.data.Count + "";
            transform.FindChild("Top").FindChild("Upcoming").FindChild("EntryFees").FindChild("LblEntryFeesV")
            .GetComponent <UILabel>().text = totalTickets + "";

            InitUpcomingList();
        }
        else if (title.Equals(UtilMgr.GetLocalText("LblLive")))
        {
            transform.FindChild("Top").FindChild("Upcoming").gameObject.SetActive(false);
            transform.FindChild("Top").FindChild("Live").gameObject.SetActive(true);
            transform.FindChild("Top").FindChild("Recent").gameObject.SetActive(false);

            transform.FindChild("Top").FindChild("Live").FindChild("Entries").FindChild("LblEntriesV")
            .GetComponent <UILabel>().text = contestEvent.Response.data.Count + "";
            transform.FindChild("Top").FindChild("Live").FindChild("EntryFees").FindChild("LblEntryFeesV")
            .GetComponent <UILabel>().text = totalTickets + "";
            transform.FindChild("Top").FindChild("Live").FindChild("Winnings").FindChild("LblWinningsV")
            .GetComponent <UILabel>().text = total1stPrize + "G";

            InitLiveList();
        }
        else
        {
            transform.FindChild("Top").FindChild("Upcoming").gameObject.SetActive(false);
            transform.FindChild("Top").FindChild("Live").gameObject.SetActive(false);
            transform.FindChild("Top").FindChild("Recent").gameObject.SetActive(true);

            transform.FindChild("Top").FindChild("Recent").FindChild("EntryFees").FindChild("LblEntryFeesV")
            .GetComponent <UILabel>().text = totalEarnedRP + "RP";
            transform.FindChild("Top").FindChild("Recent").FindChild("Winnings").FindChild("LblWinningsV")
            .GetComponent <UILabel>().text = totalEarnedGold + "G";

            InitRecentList();
        }

        InitEnded();
    }
Exemple #13
0
    void InitNews()
    {
        transform.FindChild("Body").FindChild("Changeables").FindChild("News").FindChild("NoNews").gameObject.SetActive(true);
        if (mNewsEvent.Response.data == null ||
            mNewsEvent.Response.data.Count < 1)
        {
            return;
        }
        transform.FindChild("Body").FindChild("Changeables").FindChild("News").FindChild("NoNews").gameObject.SetActive(false);

        transform.FindChild("Body").FindChild("Changeables").FindChild("News").gameObject.SetActive(true);
        UtilMgr.ClearList(
            transform.FindChild("Body").FindChild("Changeables").FindChild("News").FindChild("Scroll View"));
        UISprite d;


        string newsDay = "";
        float  height  = 390f;

//		int colorIndicator = 0;
        for (int i = 0; i < mNewsEvent.Response.data.Count; i++)
        {
            GameObject     go   = null;
            PlayerNewsInfo info = mNewsEvent.Response.data[i];
            if (!newsDay.Equals(info.newsDay))
            {
                newsDay                    = info.newsDay;
                go                         = Instantiate(mItemNewsDay);
                go.transform.parent        = transform.FindChild("Body").FindChild("Changeables").FindChild("News").FindChild("Scroll View");
                height                    -= 30f;
                go.transform.localPosition = new Vector3(0, height);
                height                    -= 30f;
                go.transform.localScale    = new Vector3(1f, 1f, 1f);
                go.transform.FindChild("Label").GetComponent <UILabel>().text = info.newsDay;
            }
            go = Instantiate(mItemNewsTitle);

            go.transform.parent = transform.FindChild("Body").FindChild("Changeables").FindChild("News").FindChild("Scroll View");
            go.transform.FindChild("Label").GetComponent <UILabel>().text = info.title;
            float h = (float)go.transform.FindChild("Label").GetComponent <UILabel>().height;
            h += 20f;
            go.transform.FindChild("BG").localPosition = new Vector3(0, 10f);
            go.transform.FindChild("BG").GetComponent <UISprite>().height      = (int)h;
            go.transform.FindChild("BG").GetComponent <BoxCollider2D>().size   = new Vector2(680f, h);
            go.transform.FindChild("BG").GetComponent <BoxCollider2D>().offset = new Vector2(0, 0);
            height -= h / 2f;
            go.transform.localPosition = new Vector3(0, height);
            height -= h / 2f;
            go.transform.localScale = new Vector3(1f, 1f, 1f);

            go = Instantiate(mItemNewsContent);

            go.transform.parent = transform.FindChild("Body").FindChild("Changeables").FindChild("News").FindChild("Scroll View");
            go.transform.FindChild("Label").GetComponent <UILabel>().text = info.content;
            h  = (float)go.transform.FindChild("Label").GetComponent <UILabel>().height;
            h += 20f;
            go.transform.FindChild("BG").GetComponent <UISprite>().height    = (int)h;
            go.transform.FindChild("BG").GetComponent <BoxCollider2D>().size = new Vector2(680f, h);
            height -= h / 2f;
            go.transform.localPosition = new Vector3(0, height);
            height -= h / 2f;
            go.transform.localScale = new Vector3(1f, 1f, 1f);
        }
        transform.FindChild("Body").FindChild("Changeables").FindChild("News").FindChild("Scroll View")
        .GetComponent <UIScrollView>().ResetPosition();
    }
Exemple #14
0
    void InitGameLog()
    {
        transform.FindChild("Body").FindChild("Changeables").FindChild("GameLog").gameObject.SetActive(true);
        UtilMgr.ClearList(
            transform.FindChild("Body").FindChild("Changeables").FindChild("GameLog").FindChild("Scroll View"));

        string month          = "";
        float  height         = 390f;
        int    colorIndicator = 0;

        for (int i = 0; i < mGameEvent.Response.data.Count; i++)
        {
            GameObject     go   = null;
            PlayerGameInfo info = mGameEvent.Response.data[i];
            if (!month.Equals(info.month))
            {
                month                      = info.month;
                colorIndicator             = 0;
                go                         = Instantiate(mItemGameMonth);
                go.transform.parent        = transform.FindChild("Body").FindChild("Changeables").FindChild("GameLog").FindChild("Scroll View");
                height                    -= 30f;
                go.transform.localPosition = new Vector3(0, height);
                height                    -= 30f;
                go.transform.localScale    = new Vector3(1f, 1f, 1f);
                go.transform.FindChild("Label").GetComponent <UILabel>().text = info.month;

                if (IsPitcher)
                {
                    go = Instantiate(mItemGameArticlesP);
                }
                else
                {
                    go = Instantiate(mItemGameArticlesH);
                }

                go.transform.parent = transform.FindChild("Body").FindChild("Changeables").FindChild("GameLog").FindChild("Scroll View");
                height -= 25f;
                go.transform.localPosition = new Vector3(0, height);
                height -= 25f;
                go.transform.localScale = new Vector3(1f, 1f, 1f);
            }
            if (IsPitcher)
            {
                go = Instantiate(mItemGameSubP);
            }
            else
            {
                go = Instantiate(mItemGameSubH);
            }

            go.transform.parent = transform.FindChild("Body").FindChild("Changeables").FindChild("GameLog").FindChild("Scroll View");
            height -= 25f;
            go.transform.localPosition = new Vector3(0, height);
            height -= 25f;
            go.transform.localScale = new Vector3(1f, 1f, 1f);

            if (IsPitcher)
            {
                go.transform.FindChild("3").GetComponent <UILabel>().text = info.IP;
                go.transform.FindChild("4").GetComponent <UILabel>().text = info.PH;
                go.transform.FindChild("5").GetComponent <UILabel>().text = info.BB;
                go.transform.FindChild("6").GetComponent <UILabel>().text = info.SO;
                go.transform.FindChild("7").GetComponent <UILabel>().text = info.ER;
                go.transform.FindChild("8").GetComponent <UILabel>().text = info.W;
            }
            else
            {
                go.transform.FindChild("3").GetComponent <UILabel>().text = info.AB;
                go.transform.FindChild("4").GetComponent <UILabel>().text = info.H;
                go.transform.FindChild("5").GetComponent <UILabel>().text = info.HR;
                go.transform.FindChild("6").GetComponent <UILabel>().text = info.RBI;
                go.transform.FindChild("7").GetComponent <UILabel>().text = info.R;
                go.transform.FindChild("8").GetComponent <UILabel>().text = info.BB;
            }
            go.transform.FindChild("1").GetComponent <UILabel>().text = info.day;
            go.transform.FindChild("2").GetComponent <UILabel>().text = info.VS;
            go.transform.FindChild("9").GetComponent <UILabel>().text = info.FP;

            if (colorIndicator++ % 2 == 0)
            {
                go.transform.FindChild("BG").GetComponent <UISprite>().color = new Color(1f, 1f, 1f);
            }
            else
            {
                go.transform.FindChild("BG").GetComponent <UISprite>().color = new Color(230f / 255f, 230f / 255f, 230f / 255f);
            }
        }
        transform.FindChild("Body").FindChild("Changeables").FindChild("GameLog").FindChild("Scroll View")
        .GetComponent <UIScrollView>().ResetPosition();
    }
    void ReceivedCard()
    {
        UserMgr.CardList = mCardEvent.Response.data;
        UtilMgr.ClearList(transform.FindChild("Body").FindChild("Draggable"));

        if (mSortedList != null)
        {
            mSortedList.Clear();
        }
        mSortedList = new List <CardInfo>();

        if (transform.root.FindChild("CardPowerUp").GetComponent <CardPowerUp>().mType == CardPowerUp.TYPE.LEVELUP)
        {
            foreach (CardInfo info in mCardEvent.Response.data)
            {
                if (info.itemSeq == mTargetCard.itemSeq)
                {
                    continue;
                }
                else if (info.useYn > 0)
                {
                    continue;
                }
                mSortedList.Add(info);
            }
        }
        else
        {
            foreach (CardInfo info in mCardEvent.Response.data)
            {
                if (info.itemSeq == mTargetCard.itemSeq)
                {
                    continue;
                }
                else if (info.useYn > 0)
                {
                    continue;
                }
                else if (info.cardClass != mTargetCard.cardClass)
                {
                    continue;
                }
                else if (info.cardLevel < 5)
                {
                    continue;
                }
                mSortedList.Add(info);
            }
        }


        transform.FindChild("Body").FindChild("Draggable").GetComponent <UIDraggablePanel2>()
        .Init(mSortedList.Count, delegate(UIListItem item, int index){
            InitInvenItem(item, index);
        });
        transform.FindChild("Body").FindChild("Draggable").GetComponent <UIDraggablePanel2>().ResetPosition();

        if (transform.root.FindChild("CardPowerUp").GetComponent <CardPowerUp>().mType == CardPowerUp.TYPE.LEVELUP)
        {
            transform.FindChild("Top").FindChild("LblSelected").FindChild("Label")
            .GetComponent <UILabel>().text =
                transform.root.FindChild("CardPowerUp").GetComponent <CardPowerUp>().mCardFeedList.Count + "/4";
        }
        else
        {
            transform.FindChild("Top").FindChild("LblSelected").FindChild("Label")
            .GetComponent <UILabel>().text =
                transform.root.FindChild("CardPowerUp").GetComponent <CardPowerUp>().mCardFeedList.Count + "/1";
        }
        UtilMgr.AddBackState(UtilMgr.STATE.SelectFeeding);
        UtilMgr.AnimatePageToLeft("CardPowerUp", "SelectFeeding");
    }