public void SetLaiShow(mjCards laizi)
    {
        CardUnit cardUnit;

        cardUnit = Cardunits[(int)laizi];
        GameObject[] CardSameType = cardUnit.CardSameType;
        GameObject   mj;

        for (int i = 0; i < CardSameType.Length; i++)
        {
            mj = CardSameType[i];
            // SetLaiziState(mj,true);
        }
    }
    private void LoadFaxian(GameObject parmGameObject, string TabName, mjCards mj)
    {
        string res;
        int    num;

        if (mj != mjCards.Nodefine)
        {
            num = (int)mj;
            res = "InGame/Texture/" + num.ToString() + "n";
            parmGameObject.transform.Find(TabName).GetComponent <MeshRenderer>().materials[0].SetTexture("_BumpMap", Resources.Load(res) as Texture2D);
            parmGameObject.transform.Find(TabName).GetComponent <MeshRenderer>().materials[0].EnableKeyword("_NORMALMAP");
            //SetTexture("_BumpMap", Resources.Load(res) as Texture2D);
        }
    }
Esempio n. 3
0
    private static int CheckEvyTwo(List <Int64> list, mjCards state)
    {
        int          count    = 0;
        List <Int64> tempList = new List <Int64>(list);
        List <Int64> temp     = new List <Int64>(list);

        TakeOutThreeSame(temp);
        TakeOutShunzi(temp);
        if (temp.Count > 2)
        {
            return(2);
        }

        if (temp.Count == 2)
        {
            if (temp[1] == temp[0] || Math.Abs(temp[1] - temp[0]) == 1)
            {
                count++;
            }
            else
            {
                if (ChcekSandwich(temp[1], temp[0]))
                {
                    count++;
                }
                else
                {
                    // return 2;
                    if (CheckOneMJ(tempList, state))
                    {
                        count++;
                    }
                    else
                    {
                        return(2);
                    }
                }
            }
        }

        if (temp.Count == 1)
        {
            count++;
        }
        return(count);
    }
 public void initial(GameObject Card, mjCards parmCardType, int num)
 {
     CardType     = parmCardType;
     HasUseNums   = new List <int>();
     CardSameType = new GameObject[num];
     if (num <= 0)
     {
         return;
     }
     for (int i = 0; i < num; i++)
     {
         CardSameType[i] = GameObject.Instantiate(Card);
         //  SetLaiziState(CardSameType[i],false);
         CardData cardData = CardSameType[i].GetComponent <CardData>();
         cardData.CardType = parmCardType;
     }
 }
Esempio n. 5
0
    private static bool CheckOneMJ(List <Int64> arr, mjCards state)
    {
        if (arr.Count > 7)
        {
            List <Int64> tempList;
            int          start;
            int          end;
            if (state == mjCards.wan_Num)
            {
                start = 1;
                end   = 10;
            }
            else if (state == mjCards.tong_Num)
            {
                start = 11;
                end   = 20;
            }
            else
            {
                start = 21;
                end   = 30;
            }
            for (int i = start; i < end; i++)
            {
                tempList = new List <Int64>(arr);
                tempList.Add(i);
                tempList.Sort();
                if (CheckIsNeat(tempList))
                {
                    return(true);
                }
                tempList.Reverse();
                if (CheckIsNeat(tempList))
                {
                    return(true);
                }
            }
        }

        return(false);
    }
    public GameObject GetGameObjectByType(mjCards parmCardType)
    {
        GameObject mj;
        string     res;

        if ((int)parmCardType > Cardunits.Length)
        {
            return(null);
        }
        //if (parmCardType == mjCards.tiao_4)
        //{
        //    Debug.Log("");
        //}
        mj = Cardunits[(int)parmCardType].GetCard();
        if (parmCardType != mjCards.Nodefine)
        {
            if ((int)parmCardType == laiZi)
            {
                res = "InGame/Texture/lai";
                SetLaiziState(mj, true, res, RenderingMode.Transparent);
            }
            else if ((int)parmCardType == laiZiPi)
            {
                res = "InGame/Texture/laiziPi";
                SetLaiziState(mj, true, res, RenderingMode.Transparent);
            }
            else
            {
                SetLaiziState(mj, false, "", RenderingMode.Transparent);
            }
        }
        else
        {
            SetLaiziState(mj, false, "", RenderingMode.Transparent);
        }
        return(mj);
    }
 public void ReleaseByGameObject(mjCards parmCardType, GameObject gameObjectParm)
 {
     Cardunits[(int)parmCardType].ReleaseCard(gameObjectParm);
 }