public void HighlightEndOfLoop() { string[] lines = originalFullText.Split(new string[] { "\n" }, StringSplitOptions.None); LevelManager.ActionsText text = new LevelManager.ActionsText(); text.line = lines.Length - 1; text.text = "}"; UpdateFullDisplayText(text); }
private void UpdateFullDisplayText(LevelManager.ActionsText actionsText) { // Unity refuses to call the Start function for // some reason so I have to do a workaround if (originalTextNotSet) { originalFullText = fullText.text; originalTextNotSet = false; } string textOriginal = originalFullText; string text = actionsText.text; int lineNum = actionsText.line; string[] lines = textOriginal.Split(new string[] { "\n" }, StringSplitOptions.None); string colorHex = ColorUtility.ToHtmlStringRGB(currentActionColor); string lineText = lines[lineNum]; lines[lineNum] = lineText.Replace(text, "<color=#" + colorHex + ">" + text + "</color>"); fullText.text = ReassembleString(lines); }
public void SetNewText(LevelManager.ActionsText text) { miniText.text = text.text; UpdateFullDisplayText(text); }