/// <summary> /// 乐平翻宝 /// </summary> /// <param name="poker"></param> /// <returns></returns> public MaJiangCtrl HoldLuckPoker(Poker poker) { MaJiangCtrl ctrl = m_ListWallInverse[34]; m_ListWall.Remove(ctrl); m_ListWallInverse.Remove(ctrl); m_LuckPoker = SpawnMaJiang(1, poker, "Hand"); m_LuckPoker.Init(poker, false); m_LuckPoker.transform.position = ctrl.transform.position; m_LuckPoker.transform.rotation = ctrl.transform.rotation; m_LuckPoker.transform.localScale = ctrl.transform.lossyScale; DespawnMaJiang(ctrl); return(m_LuckPoker); }
public MaJiangCtrl GetWall(Poker poker, int index, bool isLast) { List <MaJiangCtrl> wall = isLast ? m_ListWallInverse : m_ListWall; MaJiangCtrl majiang = wall[index]; m_ListWall.Remove(majiang); m_ListWallInverse.Remove(majiang); MaJiangCtrl ret = SpawnMaJiang(1, poker, "Hand"); ret.Init(poker, false); ret.transform.position = majiang.transform.position; ret.transform.rotation = majiang.transform.rotation; ret.transform.localScale = majiang.transform.lossyScale; DespawnMaJiang(majiang); return(ret); }
/// <summary> /// 生成麻将 /// </summary> /// <param name="seatPos">座位号</param> /// <param name="poker">牌</param> /// <param name="layer">层级</param> /// <returns></returns> public MaJiangCtrl SpawnMaJiang(int seatPos, Poker poker, string layer) { MaJiangCtrl ctrl = m_WallPool.Spawn((poker == null || poker.color == 0) ? Poker.DefaultName : poker.ToString()).gameObject.GetOrCreatComponent <MaJiangCtrl>(); ctrl.Color = m_CurrentColor; SeatEntity seat = RoomMaJiangProxy.Instance.GetSeatBySeatId(seatPos); bool isUniversal = false; if (seat != null) { isUniversal = MahJongHelper.CheckUniversal(poker, seat.UniversalList); } ctrl.Init(poker, isUniversal); ctrl.gameObject.SetLayer(LayerMask.NameToLayer(layer)); m_AllPoker.Add(ctrl); return(ctrl); }
/// <summary> /// 泰来翻宝 /// </summary> /// <param name="poker"></param> /// <param name="dice"></param> /// <returns></returns> public MaJiangCtrl HoldLuckPoker_TaiLai(Poker poker, int dice) { int index = dice * 2 - 2; MaJiangCtrl ctrl = m_ListWallInverse[index]; while (m_TaiLaiLuckPokerIndexList.Contains(index)) { ++index; ctrl = m_ListWallInverse[index]; } m_TaiLaiLuckPokerIndexList.Add(index); m_LuckPoker = SpawnMaJiang(1, poker, "Hand"); m_LuckPoker.Init(poker, false); m_LuckPoker.transform.position = ctrl.transform.position; m_LuckPoker.transform.rotation = ctrl.transform.rotation; m_LuckPoker.transform.localScale = ctrl.transform.lossyScale; DespawnMaJiang(ctrl); return(m_LuckPoker); }