コード例 #1
0
 /// <summary>
 /// Invoked by parent when parent's state changes.
 /// </summary>
 /// <param name="parent">Parent node whose state changed.</param>
 private void OnParentStateChange(QuestNode parent)
 {
     if (parent != null && parent.GetState() == QuestNodeState.True && quest != null && quest.GetState() == QuestState.Active && GetState() != QuestNodeState.True)
     {
         SetState(QuestNodeState.Active);
     }
 }
コード例 #2
0
        private static void WriteQuestNodeDataToStream(BinaryWriter binaryWriter, QuestNode node)
        {
            if (node == null)
            {
                return;
            }
            var state = node.GetState();

            binaryWriter.Write((byte)state);
            WriteConditionSetDataToStream(binaryWriter, node.conditionSet);
            WriteTagDictionaryToStream(binaryWriter, node.tagDictionary, StringField.GetStringValue(node.internalName));
        }
コード例 #3
0
        protected void OnParentStateChange(QuestNode parentNode)
        {
            if (QuestMachine.debug)
            {
                Debug.Log("Quest Machine: ParentCountQuestCondition.OnParentStateChange(" + ((parentNode != null) ? parentNode.GetEditorName() : "null") + ")", quest);
            }
            var parentIsTrue = (parentNode != null && parentNode.GetState() == QuestNodeState.True);

            if (parentIsTrue)
            {
                CheckTrueParentCount();
            }
        }
コード例 #4
0
 public void CopyFrom(QuestNode node)
 {
     if (node == null)
     {
         Debug.LogWarning("Quest Machine: QuestNodeProxy.CopyFrom source is null.");
         return;
     }
     id       = StringField.GetStringValue(node.id);
     intName  = StringField.GetStringValue(node.internalName);
     type     = node.nodeType;
     optional = node.isOptional;
     state    = node.GetState();
     speaker  = StringField.GetStringValue(node.speaker);
     states   = QuestStateInfoProxy.NewArray(node.stateInfoList);
     conds    = new QuestConditionSetProxy(node.conditionSet);
     tags     = new TagDictionary(node.tagDictionary);
     childIdx = node.childIndexList.ToArray();
     r        = QuestProxy.includeCanvasRect ? ((int)node.canvasRect.x + ";" + (int)node.canvasRect.y + ";" + (int)node.canvasRect.width + ";" + (int)node.canvasRect.height) : string.Empty;
 }