public override void SetLastCardPos(int value) { if (value == UtilDef.NullMj || MahjongList.Find(item => item.Value == value) == null)//当前不是抓牌 是吃碰杠后的 { base.SetLastCardPos(value); return; } if (MahjongList.Count > 1) { MahjongItem findItem = MahjongList.Find((item) => { return(item.Value == value); }); if (findItem != null) { MahjongList.Remove(findItem); } MahjongList.Add(findItem); SetMahjongPos(); findItem.transform.localPosition = GetHardLastMjPos(); } }
//当抢杠胡 public virtual void OnQiangganghu(int value) { MahjongItem findItem = MahjongList.Find((item) => { return(item.Value == value); }); MahjongManager.Instance.Recycle(findItem); MahjongList.Remove(findItem); SortMahjongForHand(); findItem.gameObject.SetActive(false); }
public virtual void RemoveMahjongByValue(int value, bool sort = true) { MahjongItem temp = MahjongList.Find((a) => { return(a.Value == value); }); if (temp != null) { MahjongList.Remove(temp); MahjongManager.Instance.Recycle(temp); } else { MahjongItem item = GetMahjongItemByValue(value); if (item != null) { MahjongList.Remove(item); MahjongManager.Instance.Recycle(item); } } if (sort) { SetMahjongPos(); } }