コード例 #1
0
        public virtual void SetChooseCg(List <int[]> cgList, DVoidInt call, int outPutCard = UtilDef.NullMj)
        {
            gameObject.SetActive(true);
            CgGroup.Clear();

            for (int i = 0; i < cgList.Count; i++)
            {
                var valueList = new List <int>(cgList[i]);
                if (valueList.Count < 4 && outPutCard != UtilDef.NullMj)
                {
                    valueList.Add(outPutCard);
                }

                valueList.Sort((a, b) =>
                {
                    if (a > b)
                    {
                        return(1);
                    }
                    if ((a < b))
                    {
                        return(-1);
                    }
                    return(0);
                });

                UiCardGroup group = D2MahjongMng.Instance.GetGroup(valueList.ToArray(), EnD2MjType.Me, true);
                CgGroup.AddUiCdGroup(group);
                int i1 = i;
                group.SetClickCallFunc(() =>
                {
                    UtilFunc.OutPutArray(cgList[i1], "选着的牌");
                    call(i1);
                    gameObject.SetActive(false);
                });
            }

            CgGroup.Sort(1);
        }