private void Start() { chest = FindObjectOfType <TrashChest>(); //Только одна мусорка selfText = GetComponent <Text>(); var timer = FindObjectOfType <Timer>(); selfText.text = chest.moneyInRound.ToString(); }
private void Start() { collector = FindObjectsOfType <Collector>()[collectorOrder]; trashChestMain = FindObjectsOfType <TrashChest>()[collectorOrder]; //Мусорка только одна! textScore = GetComponent <Text>(); foreach (var i in outputBehaviour) { i.Invoke(); } trashChestMain.onTrashChestUpdate += collector => { if (outputType == typeOutput.ItemCount) { textScore.text = $"0/{collector.maxPropCount}"; } }; }