public ConsoleLine.ECommandResult SetColor(string[] words) { int depth; ConsoleDictionnary.Command command = dico.FindLink(words, out depth); if (!command.discover || depth < words.Length) { foreach (VisualVariable visual in allVariables) { visual.ResetColor(); } if (!hideName) { objName.text = "<color=#ffffffff>" + owner.Name + "</color>"; } return(ConsoleLine.ECommandResult.Failed); } ConsoleDictionnary.Command t = command.FindValue(owner.Name, 1); if (!hideName) { if (t == null || !t.discover) { objName.text = "<color=#ffffffff>" + owner.Name + "</color>"; } else { objName.text = "<color=#" + ColorUtility.ToHtmlStringRGBA(command.color) + ">" + owner.Name + "</color>"; } } foreach (VisualVariable visual in allVariables) { visual.WriteCommand(command); } return(ConsoleLine.ECommandResult.Successed); }
public void WriteCommand(ConsoleDictionnary.Command cmd) { nameColor = ColorUtility.ToHtmlStringRGBA(Color.white); valueColor = ColorUtility.ToHtmlStringRGBA(Color.white); foreach (ConsoleDictionnary.Command link in cmd.linkCommand) { if (!link.discover) { continue; } if (string.Compare(link.value, variableName, true) == 0) { nameColor = ColorUtility.ToHtmlStringRGBA(cmd.color); } if (string.Compare(link.value, variableValue, true) == 0) { valueColor = ColorUtility.ToHtmlStringRGBA(cmd.color); } } UpdateVisual(); }