private void Update() { uiObject.gameObject.SetActive(textField.text != ""); if (contents.Count > 0 && !showingText) { string text = ""; for (int i = 0; i < contents.Count; i++) { Potion p = contents[i]; text += p.FString(); if (contents.Count > 1) { text += ", "; } else { text += " "; } if (i == contents.Count - 1) { text += "and..."; } } textField.text = text; } }
private void Update() { if (contentsSprite != null) { if (contents != null) { contentsSprite.enabled = true; contentsSprite.color = contents.potionColor; } else { contentsSprite.enabled = false; } } if (textField != null) { if (contents != null) { hover.gameObject.SetActive(true); textField.text = contents.FString(); } else { hover.gameObject.SetActive(false); textField.text = "EMPTY"; } } }
private void CreateFromRecipe(Potion r) { FlaskContents newFlask = Instantiate(newPotionPrefab.gameObject).GetComponent <FlaskContents>(); newFlask.contents = r; newFlask.transform.parent = transform; newFlask.transform.position = transform.position; StartCoroutine(SpitToPoint(newFlask)); ShowMessage("WOO-HOO! We've made " + r.FString() + "!", 4.0f, delegate() { textField.text = "What shall we brew next?"; }); OnPotionMade.Invoke(); }