public void Build(GameObject parent, FieldType type, Sprite sprite) { obj = new GraphickObject(); obj.Build(parent, "Field"); fieldtype = type; obj.setImage(sprite); }
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); }
/* * 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); }
/* * Buy Any Free GameField by Player * player model = the model with data obut player * info panel? for renw informatiom * */ public void Buy(PlayerModel pmodel) { int fone = pmodel.GetPlayerType == PlayerType.AI ? 14 : 15; fieldtype = pmodel.GetPlayerType == PlayerType.AI ? FieldType.Player1 : FieldType.Player2; pmodel.AddMoney(-model.cost); obj.setImage(obj.GetGameObject().transform.parent.GetComponent <FieldBuilder>().GetSprite(fone)); }
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)); }
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; }
/* * 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; }