Skip to content

Instantly share code, notes, and snippets.

@ashblue
Created February 13, 2015 02:15
Show Gist options
  • Save ashblue/43332b61a8f86f19521d to your computer and use it in GitHub Desktop.
Save ashblue/43332b61a8f86f19521d to your computer and use it in GitHub Desktop.
using System;
using System.Linq;
namespace BehaviorDesigner.Runtime.Tasks
{
[HelpURL ("http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=53"), TaskDescription ("Behavior Reference allows you to run another behavior tree within the current behavior tree."), TaskIcon ("BehaviorTreeReferenceIcon.png")]
public abstract class BehaviorReference : Action
{
[Tooltip ("Should the shared variables automatically be inherited from the parent tree?")]
public bool autoInheritVariables = true;
[Tooltip ("External behavior array that this task should reference")]
public SharedObjectList externalBehaviors;
public virtual ExternalBehavior[] GetExternalBehaviors ()
{
return this.externalBehaviors.Value.Select(i => (ExternalBehavior)i).ToArray();
}
public override void OnReset ()
{
this.externalBehaviors = null;
this.autoInheritVariables = true;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment