コード例 #1
0
 /// <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);
     }
 }
コード例 #2
0
 /// <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);
     }
 }
コード例 #3
0
        /// <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);
        }
コード例 #4
0
 /// <summary>
 /// Executes this node on the specified dialogue state.
 /// </summary>
 public override void PerformNode(DialoguePlayer state)
 {
     state.MoveToNode(Next);
 }
コード例 #5
0
 /// <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);
 }
コード例 #6
0
        /// <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]);
        }