/// <summary> /// 删除第几个item的数据,一次删除一个 /// </summary> /// <param name="itemDataIndex"></param> public void DeleteItemByIdx(int itemDataIndex) { if (_ProcessDeleteItem != null && m_Table) { //get first dataindex int firstDataIndex = int.MaxValue; //itempool中第一个(可见) int itemMax = 0; ///itempool中最后一个可见的 InfiniteItemBehavior[] behs = m_Table.GetComponentsInChildren <InfiniteItemBehavior>(); foreach (InfiniteItemBehavior bb in behs) { if (bb.itemDataIndex < firstDataIndex) { firstDataIndex = bb.itemDataIndex; } if (bb.itemDataIndex > itemMax) { itemMax = bb.itemDataIndex; } } //删除itemdataindex后,数据会上移动一位,这样最后一个和可见的item要设为不可见 Transform ItemMaxObj = itemsPool[(int)(dataTracker[itemMax])]; if (ItemMaxObj) { ItemMaxObj.gameObject.SetActive(false);//后面的item } _ProcessDeleteItem(itemDataIndex); RefreshVisualItem(firstDataIndex, m_nTotalDataCount - 1); } }
public void MoveDataInit() { Transform[] Objs = BetTable.GetComponentsInChildren <Transform>(); int Len = Objs.Length; for (int i = 0; i < Len; i++) { if (Objs[i].name != "BankerTable" && Objs[i].name != "PlayerTable" && Objs[i].name != "DrawTable" && Objs[i].name != "BankerPairTable" && Objs[i].name != "PlayerPairTable") { Destroy(Objs[i].gameObject); } } if (BetTable_Control.TableAllBetMoneySeat[0] != 0 || BetTable_Control.TableAllBetMoneySeat[1] != 0 || BetTable_Control.TableAllBetMoneySeat[2] != 0 || BetTable_Control.TableAllBetMoneySeat[3] != 0 || BetTable_Control.TableAllBetMoneySeat[4] != 0) { GameSound.CashBack_Bool = true; } MainGame_Control.StopModeState = ENUM_STOPMODE_STATE.EndShow; MyBetCashTip_Control.TipCashInitBool = true; EndWindow_Control.EndWindowOpenBool = true; MoveBool = false; CoinTweenPosition.enabled = false; Money_Control.CoinInitBool = true; History_Control.HistorySaveOkBool = true; FourCardHistory_Control.FCHistorySaveOkBool = true; CoinTweenPosition.ResetToBeginning(); }
public void ClearPlayerListUI() { if (playerList == null) { playerList = GameObject.Find("PlayerList").GetComponent <UITable>(); } var players = playerList.GetComponentsInChildren <UILabel>(); foreach (var player in players) { Destroy(player.transform.parent.gameObject); } }
public void FCMoveDataInit() { Transform[] Objs = FCBetTable.GetComponentsInChildren <Transform>(); int Len = Objs.Length; for (int i = 0; i < Len; i++) { if (Objs[i].name != "FCBankerTable" && Objs[i].name != "FCPlayerTable") { Destroy(Objs[i].gameObject); } } MainGame_Control.StopModeState = ENUM_STOPMODE_STATE.FourCardEnd; FCMoveBool = false; FourCard_Control.FourCardBetShow = true; FCCoinTweenPosition.ResetToBeginning(); }