/// <summary> /// Executes this node on the specified dialogue state. /// </summary> public override void PerformNode(DialoguePlayer state) { int value; if (state.IntVariables.TryGetValue(VariableName, out value)) { switch (OperationType) { case VariableOperationType.Set: state.IntVariables[VariableName] = Value; break; case VariableOperationType.Add: state.IntVariables[VariableName] += Value; break; case VariableOperationType.Subtract: state.IntVariables[VariableName] -= Value; break; default: throw new NotImplementedException(string.Format("VariableOperationType.{0}", OperationType.ToString())); } } else { Debug.LogWarningFormat("Set Local Variable: node {0} has no int-typed variable '{1}'.", GetDebugName(), VariableName); } base.PerformNode(state); }
/// <summary> /// Performs a user choice on this node, moving to the appropriate next node. /// </summary> public override void PerformChoice(DialoguePlayer state, int choice) { if (choice < 0 || choice >= Choices.Length) { throw new ArgumentOutOfRangeException("choice"); } Choice choiceData = Choices[choice]; state.MoveToNode(choiceData.Next); }
/// <summary> /// Executes this node on the specified dialogue state. /// </summary> public override void PerformNode(DialoguePlayer state) { if (state.RandomFloat() < Chance1) { state.MoveToNode(Branch1); } else { state.MoveToNode(Branch2); } }
/// <summary> /// Executes this node on the specified dialogue state. /// </summary> public override void PerformNode(DialoguePlayer state) { if (state.EvaluateCondition(Text)) { state.MoveToNode(BranchTrueNext); } else { state.MoveToNode(BranchFalseNext); } }
/// <summary> /// Executes this node on the specified dialogue state. /// </summary> public override void PerformNode(DialoguePlayer state) { if (state.StringVariables.ContainsKey(VariableName)) { state.StringVariables[VariableName] = Value; } else { Debug.LogWarningFormat("Set Local Variable: node {0} has no string-typed variable '{1}'.", GetDebugName(), VariableName); } base.PerformNode(state); }
/// <summary> /// Executes this node on the specified dialogue state. /// </summary> public override void PerformNode(DialoguePlayer state) { bool value; if (state.BoolVariables.TryGetValue(VariableName, out value)) { if (Toggle) { state.BoolVariables[VariableName] = !value; } else { state.BoolVariables[VariableName] = Value; } } else { Debug.LogWarningFormat("Set Local Variable: node {0} has no bool-typed variable '{1}'.", GetDebugName(), VariableName); } base.PerformNode(state); }
/// <summary> /// Executes this node on the specified dialogue state. /// </summary> public override void PerformNode(DialoguePlayer state) { state.ExecuteScript(Text); base.PerformNode(state); }
/// <summary> /// Executes this node on the specified dialogue state. /// </summary> public override void PerformNode(DialoguePlayer state) { state.MoveToNode(Next); }
/// <summary> /// Executes this node on the specified dialogue state. /// </summary> public override void PerformNode(DialoguePlayer state) { // handled by DialoguePlayer.Update }
/// <summary> /// Executes this node on the specified dialogue state. /// </summary> public override void PerformNode(DialoguePlayer state) { state.PushRepeatNode(this); }
/// <summary> /// Performs a user choice on this node, moving to the appropriate next node. /// </summary> public abstract void PerformChoice(DialoguePlayer state, int choice);
/// <summary> /// Returns true if this choice is enabled. /// </summary> public bool IsEnabled(DialoguePlayer state) { return(!IsCondition || state.EvaluateCondition(Condition)); }
/// <summary> /// Performs a user choice on this node, moving to the appropriate next node. /// </summary> public override void PerformChoice(DialoguePlayer state, int choice) { state.MoveToNode(Next); }
/// <summary> /// Executes this node on the specified dialogue state. /// </summary> public override void PerformNode(DialoguePlayer state) { int randomIndex = state.RandomInt(Branches.Length); state.MoveToNode(Branches[randomIndex]); }
/// <summary> /// Executes this node on the specified dialogue state. /// </summary> public override void PerformNode(DialoguePlayer state) { state.EvaluateCondition(Text); }
/// <summary> /// Executes this node on the specified dialogue state. /// </summary> public override void PerformNode(DialoguePlayer state) { state.ShowMessage(this); }
/// <summary> /// Executes this node on the specified dialogue state. /// </summary> public abstract void PerformNode(DialoguePlayer state);
/// <summary> /// Returns true if this choice is enabled. /// </summary> public bool IsEnabled(DialoguePlayer state) { return(!IsCondition || state.EvaluateCondition(Condition).GetValueOrDefault(false)); }