private List <AIOption> GetOptions(AIBrainGraph aiBrain) { List <AIOption> aiOptions = new List <AIOption>(); foreach (ICacheable cacheable in aiBrain.GetNodes <ICacheable>()) { cacheable.ClearCache(); } foreach (OptionNode optionNode in aiBrain.GetNodes <OptionNode>()) { aiOptions.AddRange(optionNode.GetOptions()); } return(aiOptions); }
private void Start() { foreach (AIBrainGraph aiBrain in AIBrains) { // Create a copy AIBrainGraph localAIBrain = (AIBrainGraph)aiBrain.Copy(); localAIBrain.name = aiBrain.name + "Of" + gameObject.name; // Setup Contexts foreach (IContextual contextual in localAIBrain.GetNodes <IContextual>()) { contextual.Context = this; } LocalAIBrains.Add(localAIBrain); } }