void Start() { trade = transform.parent.parent.GetComponentInChildren <Trade>(true); turn = GameObject.Find("players").GetComponent <Turn>(); firstLG = PlayerStuff.hud.tradeMenu.GetComponentsInChildren <VerticalLayoutGroup>()[0]; secondLG = PlayerStuff.hud.tradeMenu.GetComponentsInChildren <VerticalLayoutGroup>()[1]; hud = transform.parent.parent.GetComponent <hudChange>(); tradePrefab = hud.tradePrefab; button = GetComponent <Button>(); button.onClick.AddListener(() => { if (turn.player == player) // нажатие на себя { print(player + " is not null"); hud.EnableBancruptMenu(player); } else { hud.EnableTradeMenu(player); } }); added = new List <Card>(); }
private void Start() { player = GetComponent <PlayerStuff>(); hud = GameObject.Find("HUD").GetComponentInChildren <hudChange>(); dia = hud.GetComponentInChildren <DialogCentre>(true); if (cardMenu == null) { cardMenu = hud.GetComponentInChildren <CardMenu>(); } }
// Use this for initialization void Start() { trade = GameObject.Find("HUD").GetComponentInChildren <Trade>(true); turn = GameObject.Find("players").GetComponent <Turn>(); card = GetComponentInChildren <Card>(); if (card.canBuy) { anim = GetComponentInChildren <Animator>(); } hud = turn.hud; }
void Start() { buyButton = GetComponentsInChildren <Button>(true)[0]; payButton = GetComponentsInChildren <Button>(true)[1]; declineButton = GetComponentsInChildren <Button>(true)[2]; hud = GameObject.Find("HUD").GetComponentInChildren <hudChange>(); turn = GameObject.Find("players").GetComponent <Turn>(); Operations op = turn.GetComponent <Operations>(); buyButton.onClick.AddListener(op.Buy); payButton.onClick.AddListener(op.Pay); declineButton.onClick.AddListener(op.Decline); pay = payButton.GetComponentInChildren <Text>(); buy = buyButton.GetComponentInChildren <Text>(); }
// Use this for initialization void Start() { // TODO optimisation property = GetComponent <Property>(); cards = Cards.cards; _turns = 1; this.transform.position = cards[0].transform.position; currentCardIndex = 0; GetComponent <Renderer>().material.color = color; if (hud == null) { hud = GameObject.Find("HUD").GetComponentInChildren <hudChange>(); } turn = transform.parent.GetComponent <Turn>(); move = this.GetComponent <playerMove>(); }
private void Start() { owner = null; isMonopoly = false; hud = GameObject.Find("HUD").GetComponentInChildren <hudChange>(); upgLevel = GetComponentInChildren <TextMesh>(); if (canBuy) { costText = GetComponentsInChildren <TextMesh>()[1]; costText.text = _cost + "$"; labelText = GetComponentsInChildren <TextMesh>()[2]; labelText.text = label; Color tmpColor = labelText.color; tmpColor.a = 0f; labelText.color = tmpColor; } turn = GameObject.Find("players").GetComponent <Turn>(); // Индексы монополий List <int> monopolyInds = new List <int> { 0, 1, 2, 3, 4, 5, 6, 7, 15 }; if (monopolyInds.Contains(index)) { canBuy = true; } // try { anim = GetComponent <Animator>(); } catch (System.Exception) { anim = null; } trade = hud.GetComponentInChildren <Trade>(); }