示例#1
0
 internal UnresolvedToken(string name, int line, DialogTopic topic)
 {
     Name           = name;
     Line           = line;
     State          = topic;
     InsertPosition = Mathf.Max(0, topic.Items.Count - 1);
 }
示例#2
0
        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);
        }
示例#3
0
        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);
        }