This recipe requires a lot of attention due to the number of files that we will need to handle. Overall, we will create a parent class DecisionTreeNode, from which we will derive the other ones. Finally, we will learn how to implement a couple of standard decision nodes:
- First, create the DecisionTreeNode parent class, as shown in the following code:
using UnityEngine; using System.Collections; public class DecisionTreeNode : MonoBehaviour { public virtual DecisionTreeNode MakeDecision() { return null; } }
- Next, create the Decision pseudo-abstract class, deriving from the parent class, DecisionTreeNode, as demonstrated in the following code:
using UnityEngine; using System.Collections; public class Decision : DecisionTreeNode ...