Esempio n. 1
0
 /// <summary>
 /// 回收麻将
 /// </summary>
 public void PushMahjongToPool(MahjongContainer mahjong)
 {
     if (mahjong == null)
     {
         return;
     }
     mMahjongPool.Enqueue(mahjong);
     mahjong.transform.ExSetParent(transform);
     mahjong.OnReset();
 }
Esempio n. 2
0
        private void OnCreateMahjong(MahjongContainer obj, int aount)
        {
            MahjongContainer mahjongItem = null;

            for (int i = 0; i < aount; i++)
            {
                mahjongItem = Instantiate(obj);
                mahjongItem.transform.ExSetParent(transform);
                mahjongItem.OnInitalization();
                mahjongItem.OnReset();
                PushMahjongToPool(mahjongItem);
            }
        }