Example #1
0
        protected virtual void SetZhuaGang(CpgData data)
        {
            for (int i = 0; i < CpgList.Count; i++)
            {
                MahjongCpg cpgPeng    = CpgList[i];
                int        arrowIndex = cpgPeng.ArrowCrossIndex;
                if (cpgPeng.Data.Type == EnGroupType.Peng && cpgPeng.Data.Card == data.Card)
                {
                    //保存碰的位子
                    Vector3 pengPos = cpgPeng.transform.localPosition;
                    cpgPeng.Delete();

                    MahjongCpg cpgZhuaGang = CpgMahjongCreater.CreateCpg(data, cpgPeng.AcrossIndex, arrowIndex);

                    cpgZhuaGang.transform.parent        = transform;
                    cpgZhuaGang.transform.localPosition = pengPos;
                    cpgZhuaGang.transform.localRotation = Quaternion.Euler(Vector3.zero);

                    CpgList[i] = cpgZhuaGang;

                    ////保存到本地
                    //CpgLocalSave.Instance.ChangeToZhuaGangType(Chair, data.Card);
                    break;
                }
            }
        }
Example #2
0
        protected virtual void AddCpg(CpgData data, int index = UtilDef.DefInt)
        {
            MahjongCpg cpg = CpgMahjongCreater.CreateCpg(data, index);

            CpgList.Add(cpg);
            cpg.transform.parent        = transform;
            cpg.transform.localPosition = Vector3.zero;
            cpg.transform.localRotation = Quaternion.Euler(Vector3.zero);
        }