コード例 #1
0
 public void Build(GameObject parent, FieldType type, Sprite sprite)
 {
     obj = new GraphickObject();
     obj.Build(parent, "Field");
     fieldtype = type;
     obj.setImage(sprite);
 }
コード例 #2
0
ファイル: Dice.cs プロジェクト: Olehadash/Monoppoly
    public void Build(GameObject parent)
    {
        dice        = parent.transform.parent.GetComponent <FieldBuilder>().GetSprite(2);
        dicesNum[0] = parent.transform.parent.GetComponent <FieldBuilder>().GetSprite(3);
        dicesNum[1] = parent.transform.parent.GetComponent <FieldBuilder>().GetSprite(4);
        dicesNum[2] = parent.transform.parent.GetComponent <FieldBuilder>().GetSprite(5);
        dicesNum[3] = parent.transform.parent.GetComponent <FieldBuilder>().GetSprite(6);
        dicesNum[4] = parent.transform.parent.GetComponent <FieldBuilder>().GetSprite(7);
        dicesNum[5] = parent.transform.parent.GetComponent <FieldBuilder>().GetSprite(8);

        back = new GraphickObject();
        back.Build(parent, "Dice");
        back.setImage(dice);
        back.SetLayer(3);
        back.setPosion(new Vector3(0, 2.15f, 0));
        back.setScale(new Vector3(0.1f, 0.1f, 0));
        back.AddCollider();



        num.Build(back.GetGameObject(), "DiceNum");
        num.setImage(dicesNum[3]);
        num.SetLayer(4);
        num.setPosion(new Vector3(0, 2.15f, 0));
        num.setScale(new Vector3(1f, 1f, 0));
        Debug.Log("Rbefore " + num);
        back.AddDiceComponent().ResetParametrs(dice, dicesNum, back, num);
    }
コード例 #3
0
    /*
     * Build Popup Elements
     * */
    public void Build(GameObject parent)
    {
        backGround = new GraphickObject();
        backGround.Build(parent, "Popup");
        backGround.setImage(parent.GetComponent <FieldBuilder>().GetSprite(11));
        backGround.setScale(new Vector3(0.5f, 0.5f, 0));
        backGround.SetLayer(5);

        button = new GraphickObject();
        button.Build(backGround.GetGameObject(), "PopupButton");
        button.setImage(parent.GetComponent <FieldBuilder>().GetSprite(12));
        button.setPosion(new Vector3(0, -1, 0));
        button.setScale(new Vector3(0.8f, 0.8f, 0));
        button.SetBoxCollider();
        button.SetLayer(5);
        button.SetActive(false);

        NoBut = new GraphickObject();
        NoBut.Build(backGround.GetGameObject(), "PopupNoButton");
        NoBut.setImage(parent.GetComponent <FieldBuilder>().GetSprite(13));
        NoBut.setPosion(new Vector3(-1.5f, -1, 0));
        NoBut.setScale(new Vector3(2f, 2f, 0));
        NoBut.SetBoxCollider();
        NoBut.SetLayer(5);
        NoBut.SetActive(false);

        YesBut = new GraphickObject();
        YesBut.Build(backGround.GetGameObject(), "PopupYesButton");
        YesBut.setImage(parent.GetComponent <FieldBuilder>().GetSprite(13));
        YesBut.setPosion(new Vector3(1.5f, -1, 0));
        YesBut.setScale(new Vector3(2f, 2f, 0));
        YesBut.SetBoxCollider();
        YesBut.SetLayer(5);
        YesBut.SetActive(false);

        text = new GraphickObject();
        text.BuildText(parent, "Message");
        text.SetText("Message", 0.2f, 6);
        text.SetTextColor(Color.black);
        text.SetTextAlgment(TextAlignment.Center);

        noButTxt = new GraphickObject();
        noButTxt.BuildText(NoBut.GetGameObject(), "NO");
        noButTxt.SetText("NO", 0.1f, 6);
        noButTxt.SetTextColor(Color.black);
        noButTxt.SetTextAlgment(TextAlignment.Center);
        noButTxt.setPosion(new Vector3(-1.7f, -0.85f, 0));
        noButTxt.setScale(new Vector3(2f, 2f, 0));

        yesButTxt = new GraphickObject();
        yesButTxt.BuildText(YesBut.GetGameObject(), "YES");
        yesButTxt.SetText("YES", 0.1f, 6);
        yesButTxt.SetTextColor(Color.black);
        yesButTxt.SetTextAlgment(TextAlignment.Center);
        yesButTxt.setPosion(new Vector3(1.25f, -0.85f, 0));
        yesButTxt.setScale(new Vector3(2f, 2f, 0));

        backGround.AddPopupViewComponent().ResetPArametr(this.backGround, this.button, this.text, this.YesBut, this.NoBut);
    }
コード例 #4
0
 /*
  * Resrt parametrs for inserting This Component inside Gameobject
  * */
 public void ResetPArametr(GraphickObject back, GraphickObject button, GraphickObject text, GraphickObject yes, GraphickObject no)
 {
     this.backGround = back;
     this.button     = button;
     this.text       = text;
     this.YesBut     = yes;
     this.NoBut      = no;
 }
コード例 #5
0
ファイル: Dice.cs プロジェクト: Olehadash/Monoppoly
 public void ResetParametrs(Sprite dice, Sprite[] dicesNum, GraphickObject back, GraphickObject num)
 {
     Debug.Log("ResetParametrs " + num);
     this.dice     = dice;
     this.dicesNum = dicesNum;
     this.back     = back;
     this.num      = num;
 }
コード例 #6
0
    IEnumerator ShowAnimation(Vector3 position, GraphickObject animateText)
    {
        OneStepAnimation(animateText.GetGameObject(), position + new Vector3(0, 0.5f, 0));
        yield return(new WaitForSeconds(.5f));

        animateText.SetActive(false);
        Destroy(animateText.GetGameObject());
    }
コード例 #7
0
    /*Show Text with pluss position
     * position - from what position we start animation
     * text - message of ANimation
     * */
    public void TextAnimation(Vector3 position, string text)
    {
        GraphickObject animateText = new GraphickObject();

        animateText.BuildText(this.gameObject, "AnimateText");

        animateText.setPosion(position);
        animateText.SetText(text, 0.2f, 10);
        animateText.SetActive(true);
        StartCoroutine(ShowAnimation(position, animateText));
    }
コード例 #8
0
ファイル: InfoPanel.cs プロジェクト: Olehadash/Monoppoly
    public void Build(GameObject parent)
    {
        player_amounts = parent.transform.parent.GetComponent <FieldBuilder>().GetSprite(0);
        active_player  = parent.transform.parent.GetComponent <FieldBuilder>().GetSprite(1);

        mainBg = new GraphickObject();
        mainBg.Build(parent, "player_amount");
        mainBg.setImage(player_amounts);
        mainBg.SetLayer(2);
        mainBg.setScale(new Vector3(0.1015f, 0.096f, 0));
        mainBg.setPosion(new Vector3(0, 2.99f, 0));

        activate = new GraphickObject();
        activate.Build(parent, "Turn");
        activate.setImage(active_player);
        activate.SetLayer(2);
        activate.setScale(new Vector3(0.1f, 0.1f, 0));
        activate.setPosion(redposit);

        activeText = new GraphickObject();
        activeText.BuildText(parent, "NOW TURN");
        activeText.SetText("NOW PLAYING", 0.2f);
        activeText.SetTextColor(activeColor);
        activeText.setPosion(redTXTposit);

        playerName1 = new GraphickObject();
        playerName1.BuildText(mainBg.GetGameObject(), "PlayerName(1)");
        playerName1.SetText("Player Name", 0.12f);
        playerName1.setPosion(new Vector3(-3.4f, 3.4f, 0));

        playerName2 = new GraphickObject();
        playerName2.BuildText(mainBg.GetGameObject(), "PlayerName(2)");
        playerName2.SetText("Player Name", 0.12f);
        playerName2.SetTextAlgment(TextAlignment.Left);
        playerName2.setPosion(new Vector3(2.45f, 3.4f, 0));


        playerMoney1 = new GraphickObject();
        playerMoney1.BuildText(mainBg.GetGameObject(), "PlayerName(1)");
        playerMoney1.SetText("3500 $", 0.2f);
        playerMoney1.setPosion(new Vector3(-3.4f, 3.0f, 0));

        playerMoney2 = new GraphickObject();
        playerMoney2.BuildText(mainBg.GetGameObject(), "PlayerName(2)");
        playerMoney2.SetText("3500 $", 0.2f);
        playerMoney2.SetTextAlgment(TextAlignment.Left);
        playerMoney2.setPosion(new Vector3(2.6f, 3.0f, 0));
    }
コード例 #9
0
ファイル: PlayerView.cs プロジェクト: Olehadash/Monoppoly
    public void Build(GameObject parent, PlayerModel model)
    {
        switch (model.GetPlayerType)
        {
        case PlayerType.Player:
            sprite = parent.GetComponent <FieldBuilder>().GetSprite(10);
            break;

        case PlayerType.AI:
            sprite = parent.GetComponent <FieldBuilder>().GetSprite(9);
            break;
        }

        viewer = new GraphickObject();
        viewer.Build(parent, "Player");
        viewer.setImage(sprite);
        viewer.setScale(new Vector3(0.35f, 0.35f, 0));
        viewer.SetLayer(4);
        this.model = model;
    }
コード例 #10
0
    /*
     * Build BackGround Elemnts, Info Panel, Dice -  and Add it all on gameplay
     * */
    void BuildBAckGround()
    {
        backGround = new GraphickObject();
        backGround.Build(this.gameObject, "BackGround");
        backGround.setImage(blackSquare);
        backGround.setScale(new Vector3(7, 7, 0));

        whiteCenter = new GraphickObject();
        whiteCenter.Build(this.gameObject, "WhiteCenter");
        whiteCenter.setImage(WhiteSquare);
        whiteCenter.setScale(new Vector3(4.75f, 4.75f, 0));
        whiteCenter.SetLayer(1);

        panel.Build(whiteCenter.GetGameObject());
        panel.ActiviteActivate(false);
        panel.SetPlayerInfo(player_model);
        panel.SetPlayerInfo(ai_model);
        dicer.Build(whiteCenter.GetGameObject());
        dicer = dicer.GetDice;
    }