private static void SetConversationStartCutsceneToNone(Conversation conversation) { DialogueEntry entry = conversation.GetFirstDialogueEntry(); if (entry == null) { if (DialogueDebug.logWarnings) { Debug.LogWarning(string.Format("{0}: Conversation '{1}' doesn't have a START dialogue entry.", new System.Object[] { DialogueDebug.Prefix, conversation.Title })); } } else { if (string.IsNullOrEmpty(entry.currentSequence)) { if (Field.FieldExists(entry.fields, DialogueSystemFields.Sequence)) { entry.currentSequence = SequencerKeywords.NoneCommand; } else { entry.fields.Add(new Field(DialogueSystemFields.Sequence, SequencerKeywords.NoneCommand, FieldType.Text)); } } } }
// Consider which actors are new and which must be removed private void PrepareActors(List <ActorState> actorStates, out bool mustChangeArrangement) { _removedActorsIndices.Clear(); mustChangeArrangement = false; foreach (var actorState in actorStates) { if (!Field.FieldExists(actorState.fields, ActorArrangementActionFieldName)) { continue; } string actionTypeString = Field.LookupValue(actorState.fields, ActorArrangementActionFieldName); ActorArrangementActionType actionType = (ActorArrangementActionType)Enum.Parse(typeof(ActorArrangementActionType), actionTypeString); // Manage actor infos switch (actionType) { case ActorArrangementActionType.None: break; case ActorArrangementActionType.ChangePosition: if (!_actorIdToIndex.ContainsKey(actorState.ActorID)) { AddActor(actorState.ActorID); mustChangeArrangement = true; } Assert.IsTrue(_actorIdToIndex.ContainsKey(actorState.ActorID), "Arrangement with type 'changePosition' is applied to the absent actor"); ActorInfo actorInfo = _allActors[_actorIdToIndex[actorState.ActorID]]; Assert.IsTrue(Field.FieldExists(actorState.fields, PositionTypeFieldName), "Actor state doesn't have Position Type field when it's needed"); string positionTypeString = Field.LookupValue(actorState.fields, PositionTypeFieldName); ActorScreenPositionType positionType = (ActorScreenPositionType)Enum.Parse(typeof(ActorScreenPositionType), positionTypeString); if (actorInfo.PositionType != positionType) { mustChangeArrangement = true; } // Update actorInfo actorInfo.PositionType = positionType; break; case ActorArrangementActionType.Leave: DeleteActor(actorState.ActorID); mustChangeArrangement = true; break; default: Assert.IsTrue(false); break; } } }
private void SetConversationStartCutsceneToNone(Conversation conversation) { DialogueEntry entry = conversation.GetFirstDialogueEntry(); if (entry == null) { Debug.LogWarning(string.Format("{0}: Conversation '{1}' doesn't have a START dialogue entry.", DialogueDebug.Prefix, conversation.Title)); } else { if (string.IsNullOrEmpty(entry.Sequence)) { if (Field.FieldExists(entry.fields, "Sequence")) { entry.Sequence = "None()"; } else { entry.fields.Add(new Field("Sequence", "None()", FieldType.Text)); } } } }
/// <summary> /// Indicates whether this entry has a response menu sequence. /// </summary> /// <returns><c>true</c> if it has a response menu sequence; otherwise, <c>false</c>.</returns> public bool HasResponseMenuSequence() { return(Field.FieldExists(fields, "Response Menu Sequence")); }
/// <summary> /// Checks whether a field exists. /// </summary> /// <returns> /// <c>true</c> if the field exists; otherwise <c>false</c>. /// </returns> /// <param name='title'> /// Title of the field. /// </param> public bool FieldExists(string title) { return(Field.FieldExists(fields, title)); }