/* * 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); }
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)); }