Ejemplo n.º 1
0
    public Puyo TrashCreate(int x, int y)
    {
        Puyo puyo = player.puyoArr[x, y];

        if (puyo != null)
        {
            Destroy(puyo.getPuyoObj());
            puyo = null;
        }
        puyo.setColor(5);
        puyo.setLinkStatus(ImageController.NORMAL);

        GameObject newPuyoObj = Instantiate(greyPuyoGameObject);

        newPuyoObj.transform.localPosition = new Vector3(x, y, 0);
        newPuyoObj.transform.localScale    = new Vector3(1, 1, 1);
        puyo.setPuyoObj(newPuyoObj);

        List <Puyo> puyoList = new List <Puyo>();

        puyoList.Add(puyo);
        puyo.setLinkPuyoList(puyoList);

        return(puyo);
    }
Ejemplo n.º 2
0
    public static void setPuyoImage(Puyo puyo, string imgKey)
    {
        Image puyoImage = puyo.getPuyoObj().GetComponent <Image>();

        switch (puyo.getColor())
        {
        case 0:
            puyoImage.sprite = bluePuyoImgDic[imgKey];
            break;

        case 1:
            puyoImage.sprite = greenPuyoImgDic[imgKey];
            break;

        case 2:
            puyoImage.sprite = purplePuyoImgDic[imgKey];
            break;

        case 3:
            puyoImage.sprite = redPuyoImgDic[imgKey];
            break;

        case 4:
            puyoImage.sprite = yellowPuyoImgDic[imgKey];
            break;
        }
    }