Exemple #1
0
    public void Show()
    {
        Hai[] init_hais = new Hai[4] {
            new Hai(Hai.ID_TON), new Hai(Hai.ID_NAN),
            new Hai(Hai.ID_SYA), new Hai(Hai.ID_PE),
        };

        Hai temp;

        for (int i = 0; i < init_hais.Length; i++)
        {
            int index = Random.Range(0, init_hais.Length);

            temp             = init_hais[i];
            init_hais[i]     = init_hais[index];
            init_hais[index] = temp;
        }

        gameObject.SetActive(true);

        for (int i = 0; i < init_hais.Length; i++)
        {
            MahjongPai pai = PlayerUI.CreateMahjongPai(transform, new Vector3(leftPosX + i * offset, posY, 0), init_hais[i], false);
            pai.SetOnClick(OnClickMahjong);
            pai.EnableInput();

            kazePaiList.Add(pai);
        }
    }