public static bool CollectMahjongPai(MahjongPai pai) { if (pai == null) { return(false); } pai.Clear(); if (poolRoot == null) { poolRoot = new GameObject("MahjongPoolRoot").transform; } pai.transform.parent = poolRoot; pai.gameObject.SetActive(false); _mahjongPaiPool.Add(pai.gameObject); return(true); }
public static bool CollectMahjongPai(MahjongPai pai) { if (pai == null) { return(false); } pai.Clear(); if (poolRoot == null) { poolRoot = new GameObject("MahjongPoolRoot").transform; } pai.transform.parent = poolRoot; Utils.SetLayerRecursively(pai.gameObject, LayerMask.NameToLayer("Default")); pai.gameObject.SetActive(false); _mahjongPaiPool.Add(pai.gameObject); return(true); }