Ejemplo n.º 1
0
    void BuilldGameField()
    {
        bg_fild.AddOject(BricksBlock, new Vector3(0, 0, 0));
        bg_fild.setScale(new Vector2(x_resolution, y_resolution));
        bg_fild.setName("bg_fild");
        bg_fild.getGameObject().transform.localPosition = new Vector3(0, 0, 1);
        bg_fild.setLayer("BoardLayer");

        r_board.AddOject(BricksBlock, new Vector3(0 - x_resolution * .61f, 0, 0));
        r_board.setScale(new Vector2(x_resolution * .5f, y_resolution * .9f));
        r_board.setName("r_board");
        r_board.setPArent(bg_fild.getGameObject());
        r_board.setColor(BoardColor);
        //r_board.getGameObject().AddComponent<BoxCollider2D>();
        r_board.setLayer("BoardLayer");

        l_board.AddOject(BricksBlock, new Vector3(0 + x_resolution * .61f, 0, 0));
        l_board.setScale(new Vector2(x_resolution * .5f, y_resolution * .9f));
        //l_board.setName("l_board");
        l_board.setPArent(bg_fild.getGameObject());
        l_board.setColor(BoardColor);
        l_board.getGameObject().AddComponent <BoxCollider2D>();
        l_board.setLayer("BoardLayer");

        SetAPlaces();
    }
Ejemplo n.º 2
0
    public void CreateDice(Vector2 position, Vector2 scale, List <Sprite> sprites)
    {
        for (int i = 0; i < sprites.Count; i++)
        {
            GameElement elem = new GameElement();
            elem.AddOject(sprites[i], position);
            elem.setScale(scale);
            if (i > 0)
            {
                elem.setPArent(Dises[0].getGameObject());
                elem.setLayer(4);
            }
            else
            {
                elem.setLayer(3);
            }
            Dises.Add(elem);
            Dises[i].setLayer("DiceLayer");
        }

        OnDiceNum(1);
    }