예제 #1
0
파일: main.cs 프로젝트: houjianjun/MaJiang
    /// <summary>
    /// 跳出
    /// </summary>
    /// <returns></returns>
    private List <Hashtable> JumpOut(GameObject plane)
    {
        List <Hashtable> list  = new List <Hashtable>();
        Color            color = Color.magenta;

        for (int i = 16; i > 10; i = i - 4)
        {
            if (i < 16)
            {
                color = Color.green;
            }
            Hashtable ht = new Hashtable();
            ht.Add("First", listMajiangAuto[i - 1]);
            ht.Add("Second", listMajiangAuto[i - 3]);

            ShowContent.changeColor(i - 1, color, plane);
            ShowContent.changeColor(i - 3, color, plane);
            list.Add(ht);
        }

        color = Color.yellow;
        for (int i = 8; i > 2; i = i - 4)
        {
            if (i < 8)
            {
                color = Color.cyan;
            }
            Hashtable ht = new Hashtable();
            ht.Add("First", listMajiangAuto[i - 1]);
            ht.Add("Second", listMajiangAuto[i - 3]);

            ShowContent.changeColor(i - 1, color, plane);
            ShowContent.changeColor(i - 3, color, plane);
            list.Add(ht);
        }

        foreach (var item in list)
        {
            Debug.Log(Environment.NewLine + item["First"] + ":" + item["Second"]);
        }
        return(list);
    }
예제 #2
0
파일: main.cs 프로젝트: houjianjun/MaJiang
    /// <summary>
    /// 蹲出
    /// </summary>
    private List <Hashtable> SquatOut(GameObject plane)
    {
        List <Hashtable> listSquat = new List <Hashtable>();
        int count = 0;

        if (chkInput.isOn)
        {
            count = listMajiangAuto.Count;
        }
        else
        {
            count = listMajiangAuto.Count - 2;
        }

        Color color = Color.yellow;

        //第一行
        for (int i = 1; i <= 4; i++)
        {
            if (i % 2 == 0)
            {
                color = Color.green;
            }
            else
            {
                color = Color.yellow;
            }
            Hashtable ht = new Hashtable();
            ht.Add("First", listMajiangAuto[(count) / 2 - i]);
            ht.Add("Second", listMajiangAuto[(count) - i]);

            ShowContent.changeColor((count) / 2 - i, color, plane);
            ShowContent.changeColor((count) - i, color, plane);
            listSquat.Add(ht);
        }

        return(listSquat);
    }