private void InitialiseBanks(GameObject g, GameObject d, GameObject e, GameObject p, GameObject y) { goldB = g.GetComponent <BankScript>(); dollarsB = d.GetComponent <BankScript>(); eurosB = e.GetComponent <BankScript>(); poundsB = p.GetComponent <BankScript>(); yensB = y.GetComponent <BankScript>(); SetInitialAmount(goldB, dollarsB, eurosB, poundsB, yensB); }
private void OnEnable() { GetComponent <RectTransform>().localScale = Vector3.zero; LeanTween.scale(GetComponent <RectTransform>(), new Vector3(0.5f, 0.5f, 1), 0.2f); if (_bankScript == null) { _bankScript = GameObject.Find("Bank").GetComponent <BankScript>(); GameManager.GetEventHandler().onLightShardsStoredInBank.AddListener(OnLightShardsChanged); } shardsOnPlayer.text = GameManager.GetPlayerScript().GetPlayerInventory().GetLightShardAmount().ToString(); shardsInBank.text = _bankScript.GetStoredLightShards().ToString(); }
private void SetInitialAmount(BankScript g, BankScript d, BankScript e, BankScript p, BankScript y) { g.amount = INITIAL_GOLD * playerCount; d.amount = e.amount = p.amount = y.amount = INITIAL_CURRENCIES * playerCount; SetTextAndInitialProperty(g.amount, d.amount, e.amount, p.amount, y.amount, myPlayer.IsMasterClient); }