internal UnresolvedToken(string name, int line, DialogTopic topic) { Name = name; Line = line; State = topic; InsertPosition = Mathf.Max(0, topic.Items.Count - 1); }
private bool ParseMenu(string arguments) { // menu MenuName LastTopic = null; if (string.IsNullOrEmpty(arguments)) { return(false); } if (DialogObject.States.Dictionary.ContainsKey(arguments)) { Error(string.Format("Menu '{0}' defined twice", arguments)); return(false); } LastMenu = Create <DialogMenu>(arguments); DialogObject.States.Dictionary[arguments] = LastMenu; return(true); }
private bool ParseTopic(string arguments) { // topic TopicName LastMenu = null; if (string.IsNullOrEmpty(arguments)) { return(false); } if (DialogObject.States.Dictionary.ContainsKey(arguments)) { Error(string.Format("Topic '{0}' defined twice", arguments)); return(false); } LastTopic = ScriptableObject.CreateInstance <DialogTopic>(); LastTopic.name = arguments; DialogObject.States.Dictionary[arguments] = LastTopic; AddToAsset(LastTopic); return(true); }