예제 #1
0
    void InitFeedsToPlayer(int i)
    {
        Transform tf   = transform.FindChild("Body").FindChild("Scroll").FindChild("ItemCardPowerUp");
        CardInfo  info = mCardFeedList[i];

//		Debug.Log("cardClass is "+info.cardClass);
        tf.FindChild("FeedingCardPowerUp").FindChild("PowerUp").FindChild("" + (i + 1)).
        FindChild("FG").gameObject.SetActive(true);
        tf.FindChild("FeedingCardPowerUp").FindChild("PowerUp").FindChild("" + (i + 1)).
        FindChild("FG").GetComponent <UISprite>().spriteName = "upgrade_frame_feed_" + info.cardClass;
        tf.FindChild("FeedingCardPowerUp").FindChild("PowerUp").FindChild("" + (i + 1)).
        FindChild("Star").gameObject.SetActive(true);
        tf.FindChild("FeedingCardPowerUp").FindChild("PowerUp").FindChild("" + (i + 1)).
        FindChild("Star").FindChild("Label").GetComponent <UILabel>().text = info.cardClass + "";
        tf.FindChild("FeedingCardPowerUp").FindChild("PowerUp").FindChild("" + (i + 1)).
        FindChild("LvlLv").gameObject.SetActive(true);
        tf.FindChild("FeedingCardPowerUp").FindChild("PowerUp").FindChild("" + (i + 1)).
        FindChild("LvlLv").FindChild("Label").GetComponent <UILabel>().text = info.cardLevel + "";
        tf.FindChild("FeedingCardPowerUp").FindChild("PowerUp").FindChild("" + (i + 1)).
        FindChild("Panel2").FindChild("Button").gameObject.SetActive(false);
        UtilMgr.LoadImage(info.playerFK,
                          tf.FindChild("FeedingCardPowerUp").FindChild("PowerUp").FindChild("" + (i + 1)).
                          FindChild("Panel").FindChild("Photo").GetComponent <UITexture>());
        tf.FindChild("FeedingCardPowerUp").FindChild("PowerUp").FindChild("" + (i + 1)).
        FindChild("Panel").FindChild("Sprite").GetComponent <UISprite>().color
            = new Color(51f / 255f, 51f / 255f, 51f / 255f);
    }
예제 #2
0
    // Update is called once per frame
    void Update()
    {
        if (mNeedPhoto)
        {
//			StartCoroutine(LoadImage(mPlayerInfo.photoUrl, transform.FindChild("Photo").GetComponent<UITexture>()));
            UtilMgr.LoadImage(mPlayerInfo.playerId, transform.FindChild("Photo").GetComponent <UITexture>());
            mNeedPhoto = false;
        }
    }
예제 #3
0
    void SetTilePlayer()
    {
        transform.FindChild("Player").gameObject.SetActive(true);
        transform.FindChild("Team").gameObject.SetActive(false);

        transform.FindChild("Player").FindChild("LblName").GetComponent <UILabel>().text
            = Localization.language.Equals("English") ? mBingoBoard.playerName : mBingoBoard.playerKorName;
        transform.FindChild("Player").FindChild("LblName").GetComponent <UILabel>().color = new Color(51f / 255f, 51f / 255f, 51f / 255f);

        transform.FindChild("Player").FindChild("Panel").FindChild("Texture").GetComponent <UITexture>().width  = 72;
        transform.FindChild("Player").FindChild("Panel").FindChild("Texture").GetComponent <UITexture>().height = 90;
        UtilMgr.LoadImage(mBingoBoard.playerId,
                          transform.FindChild("Player").FindChild("Panel").FindChild("Texture").GetComponent <UITexture>());
        transform.FindChild("Team").FindChild("LblGuess").gameObject.SetActive(true);
    }
예제 #4
0
    void InitsFeedToPlayer()
    {
        Transform tf   = transform.FindChild("Body").FindChild("Scroll").FindChild("ItemCardPowerUp");
        CardInfo  info = mCardFeedList[0];

        tf.FindChild("FeedingCardPowerUp").FindChild("RankUp").FindChild("FG").gameObject.SetActive(true);
        tf.FindChild("FeedingCardPowerUp").FindChild("RankUp").FindChild("FG").GetComponent <UISprite>().spriteName
            = "upgrade_bg_target_" + info.cardClass;
        tf.FindChild("FeedingCardPowerUp").FindChild("RankUp").FindChild("LblName").gameObject.SetActive(true);
        if (Localization.language.Equals("English"))
        {
            tf.FindChild("FeedingCardPowerUp").FindChild("RankUp").FindChild("LblName").GetComponent <UILabel>().text = info.playerName;
        }
        else
        {
            tf.FindChild("FeedingCardPowerUp").FindChild("RankUp").FindChild("LblName").GetComponent <UILabel>().text = info.korName;
        }
        tf.FindChild("FeedingCardPowerUp").FindChild("RankUp").FindChild("Level").gameObject.SetActive(true);
        for (int i = 0; i < 6; i++)
        {
            tf.FindChild("FeedingCardPowerUp").FindChild("RankUp").FindChild("Level").FindChild("Star" + (i + 1)).GetComponent <UISprite>().color
                = new Color(102f / 255f, 102f / 255f, 102f / 255f);
        }
        for (int i = 0; i < info.cardClass; i++)
        {
            tf.FindChild("FeedingCardPowerUp").FindChild("RankUp").FindChild("Level").FindChild("Star" + (i + 1)).GetComponent <UISprite>().color
                = new Color(252f / 255f, 133f / 255f, 53f / 255f);
        }
        tf.FindChild("FeedingCardPowerUp").FindChild("RankUp").FindChild("Level").FindChild("LvV").GetComponent <UILabel>()
        .text = info.cardLevel + "";
        tf.FindChild("FeedingCardPowerUp").FindChild("RankUp").FindChild("Pos").gameObject.SetActive(true);
        tf.FindChild("FeedingCardPowerUp").FindChild("RankUp").FindChild("Pos").FindChild("SprPos").FindChild("Label").
        GetComponent <UILabel>().text = info.position;
        tf.FindChild("FeedingCardPowerUp").FindChild("RankUp").FindChild("Button").gameObject.SetActive(false);
        tf.FindChild("FeedingCardPowerUp").FindChild("RankUp").FindChild("LblSelectPlayer2").gameObject.SetActive(false);

        UtilMgr.LoadImage(info.playerFK,
                          tf.FindChild("FeedingCardPowerUp").FindChild("RankUp").FindChild("Frame").FindChild("Panel")
                          .FindChild("Texture").GetComponent <UITexture>());
    }
예제 #5
0
    public void LoadImage()
    {
        if (mEventInfo.inningHalf.Equals("T"))
        {
            UtilMgr.LoadImage(mEventInfo.currentHitterId,
                              transform.FindChild("Players").FindChild("Left").FindChild("Frame")
                              .FindChild("Photo").FindChild("TxtPlayer").GetComponent <UITexture>());

            UtilMgr.LoadImage(mEventInfo.currentPitcherId,
                              transform.FindChild("Players").FindChild("Right").FindChild("Frame")
                              .FindChild("Photo").FindChild("TxtPlayer").GetComponent <UITexture>());
        }
        else
        {
            UtilMgr.LoadImage(mEventInfo.currentHitterId,
                              transform.FindChild("Players").FindChild("Right").FindChild("Frame")
                              .FindChild("Photo").FindChild("TxtPlayer").GetComponent <UITexture>());

            UtilMgr.LoadImage(mEventInfo.currentPitcherId,
                              transform.FindChild("Players").FindChild("Left").FindChild("Frame")
                              .FindChild("Photo").FindChild("TxtPlayer").GetComponent <UITexture>());
        }
    }
예제 #6
0
    void InitItem(UIListItem item, int index)
    {
        PlayerInfo info = mPlayerList[index];

        if (info.IsCard)
        {
            item.Target.transform.FindChild("Main").gameObject.SetActive(false);
            item.Target.transform.FindChild("Sub").gameObject.SetActive(true);

            Transform tf = item.Target.transform.FindChild("Sub");
            Debug.Log("korname is " + info.korName);
            tf.GetComponent <ItemSelectPlayerSub>().mPlayerInfo = info;

            tf.FindChild("LblSalaryB").GetComponent <UILabel>().text
                = "[s]$ " + UtilMgr.AddsThousandsSeparator(info.salary_org + "");
            tf.FindChild("LblSalary").GetComponent <UILabel>().text
                = "$ " + UtilMgr.AddsThousandsSeparator(info.salary + "");
            tf.FindChild("Level").FindChild("LblLV").FindChild("Label").GetComponent <UILabel>().text
                = info.level + "";
            tf.FindChild("LblSkill").FindChild("Label").GetComponent <UILabel>().text
                = "1";
            tf.FindChild("SprPhoto").GetComponent <UISprite>().spriteName = "starcard_" + info.grade;

            for (int i = 0; i < 6; i++)
            {
                tf.FindChild("Level").FindChild("Star" + (i + 1)).GetComponent <UISprite>()
                .color = new Color(102f / 255f, 102f / 255f, 102f / 255f);
            }

            for (int i = 0; i < info.grade; i++)
            {
                tf.FindChild("Level").FindChild("Star" + (i + 1)).GetComponent <UISprite>()
                .color = new Color(252f / 255f, 133f / 255f, 53f / 255f);
            }
        }
        else
        {
            item.Target.transform.FindChild("Main").gameObject.SetActive(true);
            item.Target.transform.FindChild("Sub").gameObject.SetActive(false);

            Transform tf = item.Target.transform.FindChild("Main");

            tf.GetComponent <ItemSelectPlayerMain>().mPlayerInfo      = info;
            tf.FindChild("LblPosition").GetComponent <UILabel>().text = info.position;
            if (Localization.language.Equals("English"))
            {
                tf.FindChild("LblName").GetComponent <UILabel>().text = info.firstName + " " + info.lastName;
                if (tf.FindChild("LblName").GetComponent <UILabel>().width > 232)
                {
                    tf.FindChild("LblName").GetComponent <UILabel>().text = info.firstName.Substring(0, 1) + ". " + info.lastName;
                }
                tf.FindChild("LblTeam").GetComponent <UILabel>().text = info.city + " " + info.teamName;
            }
            else
            {
                tf.FindChild("LblName").GetComponent <UILabel>().text = info.korName;
                tf.FindChild("LblTeam").GetComponent <UILabel>().text = info.korTeamName;
            }

            tf.FindChild("LblFPPG").FindChild("LblFPPGV").GetComponent <UILabel>().text
                = string.Format("{0:F1}", info.fppg);
            tf.FindChild("LblPlayed").FindChild("LblPlayedV").GetComponent <UILabel>().text
                = info.games + "";

//			tf.FindChild("LblYear").GetComponent<UILabel>().gameObject.SetActive(false);
            tf.FindChild("LblSalary").GetComponent <UILabel>().text = "$ " + UtilMgr.AddsThousandsSeparator(info.salary);


            item.Target.transform.FindChild("Main").FindChild("MLB").gameObject.SetActive(false);
            item.Target.transform.FindChild("Main").FindChild("KBO").gameObject.SetActive(true);
            tf = item.Target.transform.FindChild("Main").FindChild("KBO");

            if ((info.injuryYN != null) && (info.injuryYN.Equals("Y")))
            {
                tf.FindChild("BtnPhoto").FindChild("Panel").FindChild("SprInjury").gameObject.SetActive(true);
            }
            else
            {
                tf.FindChild("BtnPhoto").FindChild("Panel").FindChild("SprInjury").gameObject.SetActive(false);
            }

            TeamScheduleInfo schedule = null;
            foreach (TeamScheduleInfo team in UserMgr.ScheduleList)
            {
                if (info.team == team.awayTeamId ||
                    info.team == team.homeTeamId)
                {
                    if (team.dateTime.Equals(
                            transform.root.FindChild("RegisterEntry").GetComponent <RegisterEntry>().mContestInfo.startTime))
                    {
                        schedule = team;
                        break;
                    }
                }
            }

            if (schedule != null)
            {
                item.Target.transform.FindChild("Main").FindChild("LblYear").GetComponent <UILabel>().text
                    = schedule.awayTeam + "  @  " + schedule.homeTeam;
            }
            else
            {
                item.Target.transform.FindChild("Main").FindChild("LblYear").gameObject.SetActive(false);
            }

            tf.FindChild("BtnPhoto")
            .FindChild("Panel").FindChild("TxtPlayer").GetComponent <UITexture>().mainTexture
                = UtilMgr.GetTextureDefault();
            tf.FindChild("BtnPhoto")
            .FindChild("Panel").FindChild("TxtPlayer").GetComponent <UITexture>().color
                = new Color(1f, 1f, 1f, 50f / 255f);

            UtilMgr.LoadImage(info.playerId
                              , tf.FindChild("BtnPhoto")
                              .FindChild("Panel").FindChild("TxtPlayer").GetComponent <UITexture>());
        }
    }
 public void LoadImage()
 {
     UtilMgr.LoadImage(mPlayerInfo.playerId
                       , transform.FindChild("BtnPhoto")
                       .FindChild("Panel").FindChild("TxtPlayer").GetComponent <UITexture>());
 }
예제 #8
0
    public void InitBtm()
    {
        Transform btm = transform.FindChild("Body").FindChild("Scroll View").FindChild("Btm");

        btm.gameObject.SetActive(true);

        mSortedLineup = new List <PlayerInfo>();
        bool foundLast = false;
        bool isAway    = false;

        if (mLineupResponse.data.inningHalf.Equals("T") &&
            UserMgr.eventJoined.inningState.Equals("ING"))
        {
            isAway = true;
        }
        if (mLineupResponse.data.inningHalf.Equals("B") &&
            UserMgr.eventJoined.inningState.Equals("END"))
        {
            isAway = true;
        }
//		T END, B ING
//		if((mLineupResponse.data.inningHalf.Equals("T")
//		   && UserMgr.eventJoined.inningState.Equals("ING"))
//		   || (mLineupResponse.data.inningHalf.Equals("B")
//		 && UserMgr.eventJoined.inningState.Equals("END"))){
        Debug.Log("isAway : " + isAway);
        if (isAway)
        {
            mPitcher = mLineupResponse.data.home.pit;
            for (int i = 0; i < mLineupResponse.data.away.hit.Count; i++)
            {
                if (mLineupResponse.data.away.hit[i].currentBatter > 0)
                {
                    foundLast = true;
                    for (int j = 0; j < mLineupResponse.data.away.hit.Count; j++)
                    {
//						if(++i >= mLineupResponse.data.away.hit.Count) i = 0;
                        if (i >= mLineupResponse.data.away.hit.Count)
                        {
                            i = 0;
                        }
                        mSortedLineup.Add(mLineupResponse.data.away.hit[i]);
                        i++;
                    }
                    break;
                }
            }
            if (!foundLast)
            {
                for (int j = 0; j < mLineupResponse.data.away.hit.Count; j++)
                {
                    if (j == 0)
                    {
                        mSortedLineup.Add(mLineupResponse.data.away.hit[mLineupResponse.data.away.hit.Count - 1]);
                    }
                    else
                    {
                        mSortedLineup.Add(mLineupResponse.data.away.hit[j - 1]);
                    }
                }
            }
        }
        else
        {
            mPitcher = mLineupResponse.data.away.pit;
            for (int i = 0; i < mLineupResponse.data.home.hit.Count; i++)
            {
                if (mLineupResponse.data.home.hit[i].currentBatter > 0)
                {
                    foundLast = true;
                    for (int j = 0; j < mLineupResponse.data.home.hit.Count; j++)
                    {
//						if(++i >= mLineupResponse.data.home.hit.Count) i = 0;
                        if (i >= mLineupResponse.data.home.hit.Count)
                        {
                            i = 0;
                        }
                        mSortedLineup.Add(mLineupResponse.data.home.hit[i]);
                        i++;
                    }
                    break;
                }
            }
            if (!foundLast)
            {
                for (int j = 0; j < mLineupResponse.data.home.hit.Count; j++)
                {
                    if (j == 0)
                    {
                        mSortedLineup.Add(mLineupResponse.data.home.hit[mLineupResponse.data.away.hit.Count - 1]);
                    }
                    else
                    {
                        mSortedLineup.Add(mLineupResponse.data.home.hit[j - 1]);
                    }
                }
            }
        }

        btm.FindChild("Info").FindChild("BG").FindChild("LblRound").gameObject.SetActive(true);
        btm.FindChild("Info").FindChild("BG").FindChild("LblName").gameObject.SetActive(true);
        if (Localization.language.Equals("English"))
        {
            string roundStr = mLineupResponse.data.inningHalf.Equals("T") ? "Top" : "Bot";
            roundStr += " " + mLineupResponse.data.inningNumber + UtilMgr.GetRoundString(mLineupResponse.data.inningNumber);
            btm.FindChild("Info").FindChild("BG").FindChild("LblRound").GetComponent <UILabel>().text = roundStr;
            btm.FindChild("Info").FindChild("BG").FindChild("LblName").GetComponent <UILabel>().text
                = mPitcher.playerName;
        }
        else
        {
            string roundStr = mLineupResponse.data.inningNumber
                              + (mLineupResponse.data.inningHalf.Equals("T") ? "회초" : "회말");
            btm.FindChild("Info").FindChild("BG").FindChild("LblRound").GetComponent <UILabel>().text = roundStr;
            btm.FindChild("Info").FindChild("BG").FindChild("LblName").GetComponent <UILabel>().text
                = mPitcher.korName;
        }

        int width = btm.FindChild("Info").FindChild("BG").FindChild("LblName").GetComponent <UILabel>().width;

        btm.FindChild("Info").FindChild("BG").FindChild("LblName").FindChild("Label").localPosition = new Vector3(width + 16f, -3f);
        btm.FindChild("Info").FindChild("BG").FindChild("LblName").FindChild("Label").GetComponent <UILabel>()
        .text = "#" + mPitcher.backNumber + " ERA    " + mPitcher.ERA;
        btm.FindChild("Info").FindChild("SprCircle").FindChild("Hand").FindChild("Label").GetComponent <UILabel>()
        .text = mPitcher.throwHand;

        btm.FindChild("Info").FindChild("SprCircle").FindChild("Photo").FindChild("Panel")
        .FindChild("Texture").GetComponent <UITexture>().mainTexture = UtilMgr.GetTextureDefault();
        btm.FindChild("Info").FindChild("SprCircle").FindChild("Photo").FindChild("Panel")
        .FindChild("Texture").GetComponent <UITexture>().width = 72;
        btm.FindChild("Info").FindChild("SprCircle").FindChild("Photo").FindChild("Panel")
        .FindChild("Texture").GetComponent <UITexture>().height = 90;
        UtilMgr.LoadImage(mPitcher.playerId,
                          btm.FindChild("Info").FindChild("SprCircle").FindChild("Photo").FindChild("Panel")
                          .FindChild("Texture").GetComponent <UITexture>());

        btm.FindChild("Draggable").GetComponent <UIDraggablePanel2>().RemoveAll();
//		if(IsEnded){
//			ShowGameEnded();
//			return;
//		}
//		UtilMgr.ClearList(btm.FindChild("Draggable"));
        btm.FindChild("Draggable").GetComponent <UIPanel>().clipOffset = new Vector2(0, 50f);
        btm.FindChild("Draggable").localPosition = new Vector3(0, -283f);
        btm.FindChild("Draggable").GetComponent <UIDraggablePanel2>().Init(mSortedLineup.Count, delegate(UIListItem item, int index) {
            Transform button = item.Target.transform.FindChild("Scroll View").FindChild("Button");
            button.FindChild("Photo").FindChild("Hand").FindChild("Label").GetComponent <UILabel>()
            .text      = mSortedLineup[index].batHand;
            string avg = mSortedLineup[index].AVG;
            for (int k = mSortedLineup[index].AVG.Length; k < 5; k++)
            {
                avg += "0";
            }
            button.FindChild("Label").GetComponent <UILabel>()
            .text = "#" + mSortedLineup[index].backNumber + " AVG   " + avg;

            if (Localization.language.Equals("English"))
            {
                button.FindChild("LblName").GetComponent <UILabel>()
                .text = mSortedLineup[index].playerName;
            }
            else
            {
                button.FindChild("LblName").GetComponent <UILabel>()
                .text = mSortedLineup[index].korName;
            }
            button.FindChild("Photo").FindChild("Panel").FindChild("Texture").GetComponent <UITexture>().mainTexture
                = UtilMgr.GetTextureDefault();
            button.FindChild("Photo").FindChild("Panel").FindChild("Texture").GetComponent <UITexture>().width  = 72;
            button.FindChild("Photo").FindChild("Panel").FindChild("Texture").GetComponent <UITexture>().height = 90;
            UtilMgr.LoadImage(mSortedLineup[index].playerId,
                              button.FindChild("Photo").FindChild("Panel").FindChild("Texture").GetComponent <UITexture>());

            JoinQuizInfo joinInfo = new JoinQuizInfo();
            joinInfo.gameId       = UserMgr.eventJoined.gameId;
            joinInfo.bingoId      = mBingoId;

            if (mLineupResponse == null)
            {
                return;
            }

            joinInfo.inningNumber = mLineupResponse.data.inningNumber;
            joinInfo.inningHalf   = mLineupResponse.data.inningHalf;
            joinInfo.battingOrder = mSortedLineup[index].battingOrder;
            joinInfo.playerId     = mSortedLineup[index].playerId;
            //
//			joinInfo.checkValue = -1;
//			foreach(CurrentLineupInfo.ForecastInfo forecast in mLineupEvent.Response.data.forecast){
//				if(forecast.battingOrder == joinInfo.battingOrder){
//					joinInfo.checkValue = forecast.myValue;
//					break;
//				}
//			}
            //
            item.Target.GetComponent <ItemBingoList>().Init(joinInfo);

            if (!UserMgr.eventJoined.status.Equals("Scheduled"))
            {
                int lockCnt = 1;
                if (UtilMgr.IsMLB())
                {
                    lockCnt = 2;
                }

                if (index < lockCnt)
                {
                    item.Target.GetComponent <ItemBingoList>().SetToLocking();
                }
            }
        });

        if (UserMgr.eventJoined.status.Equals("Scheduled"))
        {
            transform.root.FindChild("LiveBingo").GetComponent <LiveBingoAnimation>().SetItemBlink(-1);
        }
        else
        {
            transform.root.FindChild("LiveBingo").GetComponent <LiveBingoAnimation>()
            .SetItemBlink(mSortedLineup[0].playerId);
        }


        btm.FindChild("Draggable").GetComponent <UIDraggablePanel2>().ResetPosition();

//		UtilMgr.ClearList(btm.FindChild("Draggable"));
//		float height = 90f;
//		for(int index = 0; index < mSortedLineup.Count; index++){
//			GameObject go = Instantiate(mItemBingoList);
//			go.transform.parent = btm.FindChild("Draggable");
//			go.transform.localScale = new Vector3(1f, 1f, 1f);
//			go.transform.localPosition = new Vector3(0, height);
//			height -= 120f;
//			Transform button = go.transform.FindChild("Scroll View").FindChild("Button");
//			button.FindChild("Photo").FindChild("Hand").FindChild("Label").GetComponent<UILabel>()
//				.text = mSortedLineup[index].batHand;
//			button.FindChild("Label").GetComponent<UILabel>()
//				.text = "#" + mSortedLineup[index].backNumber + " AVG " + mSortedLineup[index].AVG;
//
//			if(Localization.language.Equals("English")){
//				button.FindChild("LblName").GetComponent<UILabel>()
//					.text = mSortedLineup[index].playerName;
//			} else{
//				button.FindChild("LblName").GetComponent<UILabel>()
//					.text = mSortedLineup[index].korName;
//			}
//			button.FindChild("Photo").FindChild("Panel").FindChild("Texture").GetComponent<UITexture>().mainTexture
//				= UtilMgr.GetTextureDefault();
//			button.FindChild("Photo").FindChild("Panel").FindChild("Texture").GetComponent<UITexture>().width = 72;
//			button.FindChild("Photo").FindChild("Panel").FindChild("Texture").GetComponent<UITexture>().height = 90;
//			UtilMgr.LoadImage(mSortedLineup[index].photoUrl,
//			                  button.FindChild("Photo").FindChild("Panel").FindChild("Texture").GetComponent<UITexture>());
//
//			JoinQuizInfo joinInfo = new JoinQuizInfo();
//			joinInfo.gameId = UserMgr.eventJoined.gameId;
//			joinInfo.bingoId = mBingoId;
//			joinInfo.inningNumber = mLineupEvent.Response.data.inningNumber;
//			joinInfo.inningHalf = mLineupEvent.Response.data.inningHalf;
//			joinInfo.battingOrder = mSortedLineup[index].battingOrder;
//			joinInfo.playerId = mSortedLineup[index].playerId;
//			go.GetComponent<ItemBingoList>().Init(joinInfo);
//
//			if(index < 2)
//				go.GetComponent<ItemBingoList>().SetToLocking();
//		}
//		btm.FindChild("Draggable").GetComponent<UIScrollView>().ResetPosition();
    }
예제 #9
0
    bool InitPlayerInfo()
    {
//		if(UtilMgr.IsMLB()){
//			transform.FindChild("Info").FindChild ("MLB").gameObject.SetActive(true);
//			transform.FindChild("Info").FindChild ("KBO").gameObject.SetActive(false);
//
//			transform.FindChild("Info").FindChild ("MLB").FindChild("Panel").FindChild("Photo").GetComponent<UITexture>().mainTexture = mPhoto;
//		} else{
        transform.FindChild("Body").FindChild("Info").FindChild("MLB").gameObject.SetActive(false);
        transform.FindChild("Body").FindChild("Info").FindChild("KBO").gameObject.SetActive(true);
//		}
        mPlayerInfo = null;
        try{
            mPlayerInfo = UserMgr.PlayerDic[mPlayerId];
        }catch {}
//		foreach( in UserMgr.PlayerList){
//			if(info.playerId == ){

//				mPlayerInfo = info;
//				break;
//			}
//		}

        if (mPlayerInfo == null)
        {
//			IsInactive = true;
            DialogueMgr.ShowDialogue(UtilMgr.GetLocalText("StrPlayerInfo"), UtilMgr.GetLocalText("StrPlayerInactive")
                                     , DialogueMgr.DIALOGUE_TYPE.Alert, null);
            return(true);
        }

        if (mPlayerInfo.positionNo == 1)
        {
            IsPitcher = true;
            //					mHand = info.throwHand.Equals("L") ? UtilMgr.GetLocalText("StrLeft") : UtilMgr.GetLocalText("StrRight");
            if (mPlayerInfo.batHand == null)
            {
                mHand = "";
            }
            else if (mPlayerInfo.throwHand.Equals("S"))
            {
                mHand = UtilMgr.GetLocalText("StrSwitch");
            }
            else if (mPlayerInfo.throwHand.Equals("L"))
            {
                mHand = UtilMgr.GetLocalText("StrLeft");
            }
            else
            {
                mHand = UtilMgr.GetLocalText("StrRight");
            }
        }
        else
        {
            IsPitcher = false;
            //					mHand = info.batHand.Equals("L") ? UtilMgr.GetLocalText("StrLeft") : UtilMgr.GetLocalText("StrRight");
            if (mPlayerInfo.batHand == null)
            {
                mHand = "";
            }
            else if (mPlayerInfo.batHand.Equals("S"))
            {
                mHand = UtilMgr.GetLocalText("StrSwitch");
            }
            else if (mPlayerInfo.batHand.Equals("L"))
            {
                mHand = UtilMgr.GetLocalText("StrLeft");
            }
            else
            {
                mHand = UtilMgr.GetLocalText("StrRight");
            }
        }

        if (mPlayerInfo.injuryYN.Equals("N"))
        {
            transform.FindChild("Body").FindChild("Info").FindChild("Injury").gameObject.SetActive(false);
        }
        else
        {
            transform.FindChild("Body").FindChild("Info").FindChild("Injury").gameObject.SetActive(true);
        }

        if (UtilMgr.IsMLB())
        {
            if (mPlayerInfo.firstName.Length < 1)
            {
                transform.FindChild("Body").FindChild("Info").FindChild("LblName").GetComponent <UILabel>().text
                    = mPlayerInfo.lastName;
            }
            else
            {
                transform.FindChild("Body").FindChild("Info").FindChild("LblName").GetComponent <UILabel>().text
                    = mPlayerInfo.firstName.Substring(0, 1) + ". " + mPlayerInfo.lastName;
            }
        }
        else
        {
            if (Localization.language.Equals("English"))
            {
                if (mPlayerInfo.firstName.Length < 1)
                {
                    transform.FindChild("Body").FindChild("Info").FindChild("LblName").GetComponent <UILabel>().text
                        = mPlayerInfo.lastName;
                }
                else
                {
                    transform.FindChild("Body").FindChild("Info").FindChild("LblName").GetComponent <UILabel>().text
                        = mPlayerInfo.firstName.Substring(0, 1) + ". " + mPlayerInfo.lastName;
                }
            }
            else
            {
                transform.FindChild("Body").FindChild("Info").FindChild("LblName").GetComponent <UILabel>().text
                    = mPlayerInfo.korName;
            }
        }

        transform.FindChild("Body").FindChild("Info").FindChild("LblSaraly").GetComponent <UILabel>().text
            = "$" + mPlayerInfo.salary;
        transform.FindChild("Body").FindChild("Info").FindChild("LblFPPG").FindChild("Label").GetComponent <UILabel>().text
            = string.Format("{0:F1}", mPlayerInfo.fppg);
        transform.FindChild("Body").FindChild("Info").FindChild("LblPlayed").FindChild("Label").GetComponent <UILabel>().text
            = "" + mPlayerInfo.games;
        transform.FindChild("Body").FindChild("Info").FindChild("SprPos").FindChild("Label").GetComponent <UILabel>().text
            = mPlayerInfo.position;

        if (IsCard)
        {
            transform.FindChild("Body").FindChild("SprGrade").GetComponent <UISprite>().spriteName = "card_top_bg_" + mCardInfo.cardClass;
            transform.FindChild("Body").FindChild("SprGrade").gameObject.SetActive(true);
        }
        else
        {
            transform.FindChild("Body").FindChild("SprGrade").gameObject.SetActive(false);
        }

        TeamScheduleInfo schedule = null;

        foreach (TeamScheduleInfo info in UserMgr.ScheduleList)
        {
            if (mPlayerInfo.team == info.awayTeamId ||
                mPlayerInfo.team == info.homeTeamId)
            {
                schedule = info;
                break;
            }
        }

        if (schedule != null)
        {
            transform.FindChild("Body").FindChild("Info").FindChild("LblPos").GetComponent <UILabel>().text
                = schedule.awayTeam + "   @   " + schedule.homeTeam;

            int    hour = 1;
            string min  = "";
            if (UtilMgr.IsMLB())
            {
                hour = int.Parse(schedule.dateTime.Substring(8, 2));
                min  = schedule.dateTime.Substring(10, 2);
                transform.FindChild("Body").FindChild("Info").FindChild("LblTime").GetComponent <UILabel>().text
                    = schedule.day + " ET " + UtilMgr.GetAMPM(hour)[0] + ":" + min + " " + UtilMgr.GetAMPM(hour)[1];
            }
            else
            {
                hour = int.Parse(schedule.korDateTime.Substring(8, 2));
                min  = schedule.korDateTime.Substring(10, 2);
                if (Localization.language.Equals("English"))
                {
                    transform.FindChild("Body").FindChild("Info").FindChild("LblTime").GetComponent <UILabel>().text
                        = schedule.day + " KST " + UtilMgr.GetAMPM(hour)[0] + ":" + min + " " + UtilMgr.GetAMPM(hour)[1];
                }
                else
                {
                    transform.FindChild("Body").FindChild("Info").FindChild("LblTime").GetComponent <UILabel>().text
                        = "KST " + UtilMgr.GetAMPM(hour)[0] + ":" + min + " " +
                          UtilMgr.GetAMPM(hour)[1] + " (" + UtilMgr.DayToKorean(schedule.day) + ")";
                }
            }
        }

        if (mPhoto == null)
        {
            UtilMgr.LoadImage(mPlayerInfo.playerId,
                              transform.FindChild("Body").FindChild("Info").FindChild("KBO").FindChild("Panel")
                              .FindChild("Photo").GetComponent <UITexture>());
        }
        else
        {
            transform.FindChild("Body").FindChild("Info").FindChild("KBO").FindChild("Panel").FindChild("Photo")
            .GetComponent <UITexture>().mainTexture = mPhoto;
        }

        return(false);
    }
예제 #10
0
    void InitInvenItem(UIListItem item, int index)
    {
        CardInfo info = mSortedList[index];

        item.Target.transform.FindChild("ItemCard").FindChild("BtnRight").GetComponent <BtnSelectFeeding>().mCardInfo  = info;
        item.Target.transform.FindChild("ItemCard").FindChild("BtnRight").GetComponent <BtnSelectFeeding>().IsSelected = false;

        if (transform.root.FindChild("CardPowerUp").GetComponent <CardPowerUp>().mCardFeedList != null)
        {
            foreach (CardInfo feedInfo in transform.root.FindChild("CardPowerUp").GetComponent <CardPowerUp>().mCardFeedList)
            {
                if (feedInfo.itemSeq == info.itemSeq)
                {
                    item.Target.transform.FindChild("ItemCard").FindChild("BtnRight").GetComponent <BtnSelectFeeding>().IsSelected = true;
                    break;
                }
            }
        }

        Transform tf = item.Target.transform.FindChild("ItemCard");

        if (Localization.language.Equals("English"))
        {
            tf.FindChild("LblName").GetComponent <UILabel>().text = info.firstName + " " + info.lastName;
            if (tf.FindChild("LblName").GetComponent <UILabel>().width > 232)
            {
                tf.FindChild("LblName").GetComponent <UILabel>().text = info.firstName.Substring(0, 1) + ". " + info.lastName;
            }
            tf.FindChild("LblTeam").GetComponent <UILabel>().text = info.city + " " + info.teamName;
        }
        else
        {
            tf.FindChild("LblName").GetComponent <UILabel>().text = info.korName;
            tf.FindChild("LblTeam").GetComponent <UILabel>().text = info.korTeamName;
        }

        tf.FindChild("LblPosition").GetComponent <UILabel>().text = info.position;

        tf.FindChild("LblSalary").GetComponent <UILabel>().text = "$" + info.salary;
        tf.FindChild("Star").FindChild("StarV").GetComponent <UILabel>().text = info.cardClass + "";
        tf.FindChild("Star").FindChild("StarV").localPosition = new Vector3(20f + (18f * (info.cardClass - 1)), -4f);
        for (int i = 1; i <= 6; i++)
        {
            tf.FindChild("Star").FindChild("SprStar" + i).gameObject.SetActive(false);
        }
        for (int i = 1; i <= info.cardClass; i++)
        {
            tf.FindChild("Star").FindChild("SprStar" + i).gameObject.SetActive(true);
            string starStr = "star_bronze";
            if (info.cardClass > 4)
            {
                starStr = "star_gold";
            }
            else if (info.cardClass > 2)
            {
                starStr = "star_silver";
            }
            tf.FindChild("Star").FindChild("SprStar" + i).GetComponent <UISprite>().spriteName = starStr;
        }

        tf.FindChild("Level").localPosition = new Vector3(-124f + (18f * (info.cardClass - 1)), -40f);
        tf.FindChild("Level").FindChild("LblLevel").FindChild("LevelV").GetComponent <UILabel>().text = info.cardLevel + "";
        tf.FindChild("LblFPPG").FindChild("LblFPPGV").GetComponent <UILabel>().text   = info.fppg;
        tf.FindChild("LblSkill").FindChild("LblSkillV").GetComponent <UILabel>().text = "1";
        if (info.useYn > 0)
        {
            tf.FindChild("BtnPhoto").FindChild("Panel").FindChild("Inuse").gameObject.SetActive(true);
            tf.FindChild("BtnPhoto").FindChild("Panel").GetComponent <UIPanel>().baseClipRegion
                = new Vector4(0, 0, 156f, 130f);
        }
        else
        {
            tf.FindChild("BtnPhoto").FindChild("Panel").FindChild("Inuse").gameObject.SetActive(false);
            tf.FindChild("BtnPhoto").FindChild("Panel").GetComponent <UIPanel>().baseClipRegion
                = new Vector4(0, 0, 152f, 108f);
        }
        if ((info.injuryYN != null) && (info.injuryYN.Equals("Y")))
        {
            tf.FindChild("BtnPhoto").FindChild("SprInjury").gameObject.SetActive(true);
        }
        else
        {
            tf.FindChild("BtnPhoto").FindChild("SprInjury").gameObject.SetActive(false);
        }

        tf.FindChild("BtnPhoto").FindChild("Panel").FindChild("Texture").GetComponent <UITexture>().mainTexture
            = UtilMgr.GetTextureDefault();

        tf.FindChild("BtnPhoto").FindChild("Panel").FindChild("Texture").GetComponent <UITexture>().color
            = new Color(1f, 1f, 1f, 50f / 255f);

        UtilMgr.LoadImage(info.playerFK,
                          tf.FindChild("BtnPhoto").FindChild("Panel").FindChild("Texture").GetComponent <UITexture>());
    }
예제 #11
0
    void draw_TopPlayer_post()
    {
        List <PlayerInfo> mSortedList0 = new List <PlayerInfo>();

        foreach (PlayerInfo info in UserMgr.PlayerList)
        {
            //if(info.positionNo == 1) mSortedList.Add(info);		//del
            mSortedList0.Add(info);                                                     // all
        }
        mSortedList0.Sort(delegate(PlayerInfo x, PlayerInfo y) {                        // sort
            return(y.fppg.CompareTo(x.fppg));
        });

        mSortedList = new List <PlayerInfo>();
        for (int i = 0; i < 10; i++)
        {
            mSortedList.Add(mSortedList0[i]);
        }



        //for(int i=0;i<mSortedList.Count;i++) Com.LOOG(i, mSortedList[i].korName, mSortedList[i].fppg);	//debug

        UIDraggablePanel2 drag = Com.FindTransform(transform, "Top_Players", "ScrollBody").GetComponent <UIDraggablePanel2>();

        drag.SetDragAmount(0, 30f, false);
        drag.RemoveAll();
        drag.Init(
            mSortedList.Count, delegate(UIListItem item, int index) {
            UILabel name = Com.Find_UILabel(item.Target.transform, "MLB", "name");
            name.text    = Localization.language.Equals("English")
                                        ? mSortedList[index].firstName.Substring(0, 1) + ". " + mSortedList[index].lastName
                                        : mSortedList[index].korName;

            UITexture tex = Com.FindTransform(item.Target.transform, "MLB", "BtnPhoto", "Texture").GetComponent <UITexture>();
            //tex.color = new Color(1f, 1f, 1f, 50f/255f);
            bool ispic = UtilMgr.LoadImage(mSortedList[index].playerId, tex);
            if (ispic == false)
            {
                tex.mainTexture = UtilMgr.GetTextureDefault();
            }



            UILabel rank = Com.Find_UILabel(item.Target.transform, "ranking_num", "Label");
            if (index < 3)
            {
                rank.transform.parent.gameObject.SetActive(true);
                rank.text = (index + 1) + "";

                if (index == 0)
                {
                    rank.transform.parent.GetComponent <UISprite>().color = Com.GetColor(0xceab2a);
                }
                else if (index == 1)
                {
                    rank.transform.parent.GetComponent <UISprite>().color = Com.GetColor(0x9c9d9f);
                }
                else if (index == 2)
                {
                    rank.transform.parent.GetComponent <UISprite>().color = Com.GetColor(0x935e44);
                }
            }
            else
            {
                rank.transform.parent.gameObject.SetActive(false);
            }

            UILabel fppg = Com.Find_UILabel(item.Target.transform, "FPPG_num");
            fppg.text    = mSortedList[index].fppg.ToString("f1");

            UILabel position = Com.Find_UILabel(item.Target.transform, "position", "Label");
            position.text    = mSortedList[index].position;



            // draw own
            {
                Transform own = Com.FindTransform(item.Target.transform, "own");
                own.gameObject.SetActive(false);
                for (int i = 0; i < UserMgr.CardList.Count; i++)
                {
                    if (UserMgr.CardList[i].playerFK == mSortedList[index].playerId)
                    {
                        own.gameObject.SetActive(true);
                        Com.LOOG("own", UserMgr.CardList[i].korName, UserMgr.CardList[i].fppg, mSortedList[index].fppg);
                        break;
                    }
                }
            }

            Com.FindTransform(item.Target.transform, "BtnPhoto").GetComponent <TopCard>().mPlayerInfo = mSortedList[index];
        });


        drag.ResetPosition();
        drag.GetComponent <SpringPanel>().target  = new Vector3(0, -85, 0);
        drag.GetComponent <SpringPanel>().enabled = true;
    }
예제 #12
0
    void InitInvenItem(UIListItem item, int index)
    {
        CardInfo info = mList[index];

        item.Target.GetComponent <ItemInvenCard>().mCardInfo = info;

        if (info.mType == CardInfo.INVEN_TYPE.CARD)
        {
            item.Target.transform.FindChild("ItemCardPack").gameObject.SetActive(false);
            item.Target.transform.FindChild("ItemCard").gameObject.SetActive(true);
            item.Target.transform.FindChild("ItemExpand").gameObject.SetActive(false);

            Transform tf = item.Target.transform.FindChild("ItemCard");

            tf.GetComponent <ItemCard>().mCardInfo = info;
            tf.FindChild("LblPosition").GetComponent <UILabel>().text = info.position;


            if (Localization.language.Equals("English"))
            {
                tf.FindChild("LblName").GetComponent <UILabel>().text = info.firstName + " " + info.lastName;
                if (tf.FindChild("LblName").GetComponent <UILabel>().width > 232)
                {
                    tf.FindChild("LblName").GetComponent <UILabel>().text = info.firstName.Substring(0, 1) + ". " + info.lastName;
                }
                if (info.teamName.Length < 1)
                {
                    tf.FindChild("LblTeam").GetComponent <UILabel>().text = UtilMgr.GetLocalText("StrInactive");
                }
                else
                {
                    tf.FindChild("LblTeam").GetComponent <UILabel>().text = info.city + " " + info.teamName;
                }
            }
            else
            {
                tf.FindChild("LblName").GetComponent <UILabel>().text = info.korName;
                if (info.teamName.Length < 1)
                {
                    tf.FindChild("LblTeam").GetComponent <UILabel>().text = UtilMgr.GetLocalText("StrInactive");
                }
                else
                {
                    tf.FindChild("LblTeam").GetComponent <UILabel>().text = info.korTeamName;
                }
            }



            tf.FindChild("LblSalary").GetComponent <UILabel>().text = "$" + info.salary;
            tf.FindChild("Star").FindChild("StarV").GetComponent <UILabel>().text = info.cardClass + "";
            tf.FindChild("Star").FindChild("StarV").localPosition = new Vector3(20f + (18f * (info.cardClass - 1)), -4f);
            for (int i = 1; i <= 6; i++)
            {
                tf.FindChild("Star").FindChild("SprStar" + i).gameObject.SetActive(false);
            }
            for (int i = 1; i <= info.cardClass; i++)
            {
                tf.FindChild("Star").FindChild("SprStar" + i).gameObject.SetActive(true);
                string starStr = "star_bronze";
                if (info.cardClass > 4)
                {
                    starStr = "star_gold";
                }
                else if (info.cardClass > 2)
                {
                    starStr = "star_silver";
                }
                tf.FindChild("Star").FindChild("SprStar" + i).GetComponent <UISprite>().spriteName = starStr;
            }

            tf.FindChild("Level").localPosition = new Vector3(-124f + (18f * (info.cardClass - 1)), -40f);
            tf.FindChild("Level").FindChild("LblLevel").FindChild("LevelV").GetComponent <UILabel>().text = info.cardLevel + "";
            tf.FindChild("LblFPPG").FindChild("LblFPPGV").GetComponent <UILabel>().text   = info.fppg;
            tf.FindChild("LblSkill").FindChild("LblSkillV").GetComponent <UILabel>().text = "1";
//			if(UtilMgr.IsMLB()){
//				tf.FindChild("MLB").gameObject.SetActive(true);
//				tf.FindChild("KBO").gameObject.SetActive(false);
//
//				tf = item.Target.transform.FindChild("ItemCard").FindChild("MLB");
//
//				if((info.injuryYN != null) && (info.injuryYN.Equals("Y"))){
//					tf.FindChild("BtnPhoto").FindChild("SprInjury").gameObject.SetActive(true);
//				} else
//					tf.FindChild("BtnPhoto").FindChild("SprInjury").gameObject.SetActive(false);
//
//				if(info.useYn > 0){
//					tf.FindChild("BtnPhoto").FindChild("Panel").FindChild("Inuse").gameObject.SetActive(true);
//					tf.FindChild("BtnPhoto").FindChild("Panel").GetComponent<UIPanel>().baseClipRegion
//						= new Vector4(0, 0, 156f, 130f);
//				} else{
//					tf.FindChild("BtnPhoto").FindChild("Panel").FindChild("Inuse").gameObject.SetActive(false);
//					tf.FindChild("BtnPhoto").FindChild("Panel").GetComponent<UIPanel>().baseClipRegion
//						= new Vector4(0, 0, 152f, 108f);
//				}
//			} else{
            tf.FindChild("MLB").gameObject.SetActive(false);
            tf.FindChild("KBO").gameObject.SetActive(true);

            tf = item.Target.transform.FindChild("ItemCard").FindChild("KBO");

            if ((info.injuryYN != null) && (info.injuryYN.Equals("Y")))
            {
                tf.FindChild("BtnPhoto").FindChild("Panel").FindChild("SprInjury").gameObject.SetActive(true);
            }
            else
            {
                tf.FindChild("BtnPhoto").FindChild("Panel").FindChild("SprInjury").gameObject.SetActive(false);
            }

            tf.FindChild("BtnPhoto").FindChild("Panel").FindChild("Inuse").gameObject.SetActive(false);
            tf.FindChild("BtnPhoto").FindChild("Panel").GetComponent <UIPanel>().baseClipRegion
                = new Vector4(0, 0, 152f, 186f);

            if (info.useYn > 0)
            {
                tf.FindChild("BtnPhoto").FindChild("Panel").FindChild("Inuse").gameObject.SetActive(true);
                tf.FindChild("BtnPhoto").FindChild("Panel").GetComponent <UIPanel>().baseClipRegion
                    = new Vector4(0, 0, 156f, 130f);
            }
            else
            {
                tf.FindChild("BtnPhoto").FindChild("Panel").FindChild("Inuse").gameObject.SetActive(false);
                tf.FindChild("BtnPhoto").FindChild("Panel").GetComponent <UIPanel>().baseClipRegion
                    = new Vector4(0, 0, 152f, 108f);
            }
//			}



            tf.FindChild("BtnPhoto").FindChild("Panel").FindChild("Texture").GetComponent <UITexture>().mainTexture
                = UtilMgr.GetTextureDefault();

            tf.FindChild("BtnPhoto").FindChild("Panel").FindChild("Texture").GetComponent <UITexture>().color
                = new Color(1f, 1f, 1f, 50f / 255f);

            UtilMgr.LoadImage(info.playerFK,
                              tf.FindChild("BtnPhoto").FindChild("Panel").FindChild("Texture").GetComponent <UITexture>());
        }
        else if (info.mType == CardInfo.INVEN_TYPE.PACK)
        {
            item.Target.transform.FindChild("ItemCardPack").gameObject.SetActive(true);
            item.Target.transform.FindChild("ItemCard").gameObject.SetActive(false);
            item.Target.transform.FindChild("ItemExpand").gameObject.SetActive(false);

            item.Target.transform.FindChild("ItemCardPack").FindChild("LblName").GetComponent <UILabel>().text
                = item.Target.GetComponent <ItemInvenCard>().mCardInfo.mMailinfo.mail_title;
            item.Target.transform.FindChild("ItemCardPack").FindChild("LblDesc").GetComponent <UILabel>().text
                = item.Target.GetComponent <ItemInvenCard>().mCardInfo.mMailinfo.mail_desc;
        }
        else if (info.mType == CardInfo.INVEN_TYPE.EXPAND)
        {
            item.Target.transform.FindChild("ItemCardPack").gameObject.SetActive(false);
            item.Target.transform.FindChild("ItemCard").gameObject.SetActive(false);
            item.Target.transform.FindChild("ItemExpand").gameObject.SetActive(true);
            item.Target.transform.FindChild("ItemExpand").FindChild("LblMoreCards1").GetComponent <UILabel>()
            .text = string.Format(UtilMgr.GetLocalText("LblMoreCards1"),
                                  mCardEvent.Response.data.Count - UserMgr.LobbyInfo.userInvenOfCard - 1);
        }
    }