コード例 #1
0
 public void CopyTo(QuestNode node)
 {
     if (node == null)
     {
         Debug.LogWarning("Quest Machine: QuestNodeProxy.CopyTo destination is null.");
         return;
     }
     node.id             = new StringField(id);
     node.internalName   = new StringField(intName);
     node.nodeType       = type;
     node.isOptional     = optional;
     node.speaker        = new StringField(speaker);
     node.stateInfoList  = QuestStateInfoProxy.CreateList(states);
     node.conditionSet   = conds.CreateConditionSet();
     node.tagDictionary  = new TagDictionary(tags);
     node.childIndexList = new List <int>(childIdx);
     if (QuestProxy.includeCanvasRect && !string.IsNullOrEmpty(r))
     {
         var fields = r.Split(';');
         if (fields.Length == 4)
         {
             node.canvasRect = new Rect(SafeConvert.ToFloat(fields[0]), SafeConvert.ToFloat(fields[1]), SafeConvert.ToFloat(fields[2]), SafeConvert.ToFloat(fields[3]));
         }
     }
 }
コード例 #2
0
 public void CopyFrom(Quest quest)
 {
     if (quest == null)
     {
         Debug.LogWarning("Quest Machine: QuestProxy.CopyFrom source quest is null.");
         return;
     }
     isInstance            = quest.isInstance;
     id                    = StringField.GetStringValue(quest.id);
     displayName           = StringField.GetStringValue(quest.title);
     iconPath              = QuestMachine.GetImagePath(quest.icon);
     group                 = StringField.GetStringValue(quest.group);
     labels                = StringFieldsToStrings(quest.labels);
     giver                 = StringField.GetStringValue(quest.questGiverID);
     isTrackable           = quest.isTrackable;
     track                 = quest.showInTrackHUD;
     isAbandonable         = quest.isAbandonable;
     rememberIfAbandoned   = quest.rememberIfAbandoned;
     autostartConditionSet = new QuestConditionSetProxy(quest.autostartConditionSet);
     offerConditionSet     = new QuestConditionSetProxy(quest.offerConditionSet);
     offerUnmetContentList = QuestContentProxy.NewArray(quest.offerConditionsUnmetContentList);
     offerContentList      = QuestContentProxy.NewArray(quest.offerContentList);
     maxTimes              = quest.maxTimes;
     timesAccepted         = quest.timesAccepted;
     cooldownSecs          = quest.cooldownSeconds;
     cooldownSecsRemain    = quest.cooldownSecondsRemaining;
     state                 = quest.GetState();
     stateInfoList         = QuestStateInfoProxy.NewArray(quest.stateInfoList);
     counterList           = QuestCounterProxy.NewArray(quest.counterList);
     nodeList              = QuestNodeProxy.NewArray(quest.nodeList);
     tags                  = new TagDictionary(quest.tagDictionary);
     indicators            = QuestIndicatorStateRecordProxy.NewArray(quest.indicatorStates);
     goalEntity            = quest.goalEntityTypeName;
 }
コード例 #3
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;
 }
コード例 #4
0
 public void CopyTo(Quest quest)
 {
     if (quest == null)
     {
         Debug.LogWarning("Quest Machine: QuestProxy.CopyTo destination quest is null.");
         return;
     }
     quest.isInstance                      = isInstance;
     quest.id                              = new StringField(id);
     quest.title                           = new StringField(displayName);
     quest.group                           = new StringField(group);
     quest.labels                          = StringsToStringFields(labels);
     quest.icon                            = QuestMachine.GetImage(iconPath);
     quest.questGiverID                    = new StringField(giver);
     quest.isTrackable                     = isTrackable;
     quest.showInTrackHUD                  = track;
     quest.isAbandonable                   = isAbandonable;
     quest.rememberIfAbandoned             = rememberIfAbandoned;
     quest.autostartConditionSet           = autostartConditionSet.CreateConditionSet();
     quest.offerConditionSet               = offerConditionSet.CreateConditionSet();
     quest.offerConditionsUnmetContentList = QuestContentProxy.CreateList(offerUnmetContentList);
     quest.offerContentList                = QuestContentProxy.CreateList(offerContentList);
     quest.maxTimes                        = maxTimes;
     quest.timesAccepted                   = timesAccepted;
     quest.UpdateCooldown();
     quest.cooldownSeconds          = cooldownSecs;
     quest.cooldownSecondsRemaining = cooldownSecsRemain;
     quest.stateInfoList            = QuestStateInfoProxy.CreateList(stateInfoList);
     quest.counterList        = QuestCounterProxy.CreateList(counterList);
     quest.nodeList           = QuestNodeProxy.CreateList(nodeList);
     quest.tagDictionary      = new TagDictionary(tags);
     quest.indicatorStates    = QuestIndicatorStateRecordProxy.ArrayToDictionary(indicators);
     quest.goalEntityTypeName = goalEntity;
     quest.SetRuntimeReferences();
     quest.SetState(state, false);
     QuestNodeProxy.CopyStatesTo(nodeList, quest);
 }