void MIXCARDSELECT() { arrEachCard = new List <GameObject> (); arrCardMixItemSelect = new List <GameObject> (); TopCardCardPosInit(); GameObject BottomCardLine, KickerCard, GkCard; KickerCard = (GameObject)Resources.Load("prefab_General/KickerCard"); GkCard = (GameObject)Resources.Load("prefab_General/Gk_Card"); BottomCardLine = mRscrcMan.FindChild(dicMenuList["Ui_team"], "LPanel_cardmix/card_character/grid", true).gameObject; for (int i = 0; i < arrAllCard.Count; i++) { DestroyObject(arrAllCard [i]); } arrAllCard.Clear(); for (int i = 0; i < Ag.mySelf.arrCard.Count; i++) { if (Ag.mySelf.arrCard [i].WAS.kickOrder > -1) { continue; } //----------------------------------------------------------------- GameObject PlayerCard; if (Ag.mySelf.arrCard [i].WAS.isKicker) { PlayerCard = Instantiate(KickerCard) as GameObject; } else { PlayerCard = Instantiate(GkCard) as GameObject; } Debug.Log(Ag.mySelf.arrCard [i].mID + "id"); PlayerCard.GetComponent <PlayerCardInfo> ().mwas = Ag.mySelf.arrCard [i].WAS; PlayerCard.GetComponent <PlayerCardInfo> ().mCard = Ag.mySelf.arrCard [i]; //Debug.Log ("PlayerCardINfo" + PlayerCard.GetComponent<PlayerCardInfo> ().mCard.WAS.kickOrder + "WAS" + PlayerCard.GetComponent<PlayerCardInfo> ().mwas.kickOrder); PlayerCard.transform.parent = BottomCardLine.transform; PlayerCard.transform.localScale = new Vector3(1, 1, 1); PlayerCard.transform.localPosition = new Vector3(0, 0, -25f); PlayerCard.name = "BottomCard" + PlayerCard.GetComponent <PlayerCardInfo> ().mwas.ID; BottomCardLine.GetComponent <UIGrid> ().Reposition(); PlayerCard.AddComponent <UIButtonMessage> ().functionName = "SendMixCardInfo"; PlayerCard.GetComponent <UIButtonMessage> ().target = PlayerCard; mRscrcMan.AddComponentUISendMessage(mRscrcMan.FindChild(PlayerCard, "btn_playerinfo", true), PlayerCard, "PlayerDetail"); PlayerCard.GetComponent <PlayerCardInfo> ().CardInit(); } arrSelected = new List <GameObject> (); foreach (Transform child in BottomCardLine.transform) { arrAllCard.Add(child.gameObject); } StartCoroutine(RepositionCardMix()); }
void AllCardSelect() { TopCardPosInit(); arrEachCard = new List <GameObject> (); GameObject KickerCard, GkCard; KickerCard = (GameObject)Resources.Load("prefab_General/KickerCard"); GkCard = (GameObject)Resources.Load("prefab_General/Gk_Card"); for (int i = 0; i < arrAllCard.Count; i++) { DestroyObject(arrAllCard [i]); } arrAllCard.Clear(); for (int i = 0; i < Ag.mySelf.arrCard.Count; i++) { //Deleate /* * if (i < 6) * Ag.mySelf.arrCard [i].WAS.kickOrder = i; */ //----------------------------------------------------------------- GameObject PlayerCard; if (Ag.mySelf.arrCard [i].WAS.isKicker) { PlayerCard = Instantiate(KickerCard) as GameObject; } else { PlayerCard = Instantiate(GkCard) as GameObject; } //Debug.Log (Ag.mySelf.arrCard [i].mID + "id"); PlayerCard.GetComponent <PlayerCardInfo> ().mwas = Ag.mySelf.arrCard [i].WAS; PlayerCard.GetComponent <PlayerCardInfo> ().mCard = Ag.mySelf.arrCard [i]; if (PlayerCard.GetComponent <PlayerCardInfo> ().mCard.WAS.kickOrder > -1) { PlayerCard.transform.parent = dicMenuList ["TopCardLine"].transform; PlayerCard.transform.localScale = new Vector3(1, 1, 1); PlayerCard.transform.localPosition = arrTopCardVector [PlayerCard.GetComponent <PlayerCardInfo> ().mCard.WAS.kickOrder]; PlayerCard.name = "TopCard" + PlayerCard.GetComponent <PlayerCardInfo> ().mCard.WAS.kickOrder; } else { PlayerCard.transform.parent = dicMenuList ["BottomCardLine"].transform; PlayerCard.transform.localScale = new Vector3(1, 1, 1); PlayerCard.transform.localPosition = new Vector3(0, 0, -25f); PlayerCard.name = "BottomCard" + PlayerCard.GetComponent <PlayerCardInfo> ().mCard.WAS.ID; //mRscrcMan.FindGameObject ("Ui_camera/Camera/Ui_team/LPanel_lineup/card_character/grid", true).GetComponent<UIGrid> ().Reposition (); //PlayerCard.transform.localPosition = arrTopCardVector [PlayerCard.GetComponent<PlayerCardInfo> ().mwas.kickOrder]; } PlayerCard.AddComponent <UIButtonMessage> ().functionName = "SendCardInfo"; PlayerCard.GetComponent <UIButtonMessage> ().target = PlayerCard; mRscrcMan.AddComponentUISendMessage(mRscrcMan.FindChild(PlayerCard, "btn_playerinfo", true), PlayerCard, "PlayerDetail"); PlayerCard.GetComponent <PlayerCardInfo> ().CardInit(); arrAllCard.Add(PlayerCard); mRscrcMan.FindChild(arrAllCard [i], "btn_playerinfo", true); mRscrcMan.FindChild(arrAllCard [i], "cardselect", false); } StartCoroutine(CardRepositionNow(0.2f)); }