本文整理匯總了C#中BehaviorNode類的典型用法代碼示例。如果您正苦於以下問題:C# BehaviorNode類的具體用法?C# BehaviorNode怎麽用?C# BehaviorNode使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
BehaviorNode類屬於命名空間,在下文中一共展示了BehaviorNode類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: BeginNode
/**
* Begins a node and attaches the coroutine to this object
* If you use this method you MUST call the node.OnComplete method
* after it yields
*/
public Coroutine BeginNode(BehaviorNode node)
{
node.mReturnValue = BehaviorReturn.Running;
//process
return StartCoroutine(node.Process(this));
}
示例2: ExporterCpp
public ExporterCpp(BehaviorNode node, string outputFolder, string filename, List<string> includedFilenames = null)
: base(node, outputFolder, filename, includedFilenames)
{
//automatically create an extra level of path
_outputFolder = Path.Combine(Path.GetFullPath(_outputFolder), "behaviac_generated");
_filename = "behaviors/generated_behaviors.h";
}
示例3: CreateNodeViewData
public override NodeViewData CreateNodeViewData(NodeViewData parent, BehaviorNode rootBehavior)
{
NodeViewData nvd = base.CreateNodeViewData(parent, rootBehavior);
nvd.ChangeShape(this.IsEndState ? NodeShape.RoundedRectangle : NodeShape.Rectangle);
return nvd;
}
示例4: CheckForErrors
public override void CheckForErrors(BehaviorNode rootBehavior, List<ErrorCheck> result)
{
if(_genericChildren.ChildCount <1)
result.Add( new Node.ErrorCheck(this, ErrorCheckLevel.Error, Resources.DecoratorHasNoChildError) );
base.CheckForErrors(rootBehavior, result);
}
示例5: CreateNodeViewData
public override NodeViewData CreateNodeViewData(NodeViewData parent, BehaviorNode rootBehavior)
{
NodeViewData nvd = base.CreateNodeViewData(parent, rootBehavior);
nvd.ChangeShape(NodeShape.Ellipse);
return nvd;
}
示例6: CheckForErrors
public override void CheckForErrors(BehaviorNode rootBehavior, List<ErrorCheck> result)
{
if(_genericChildren.ChildCount <2)
result.Add( new Node.ErrorCheck(this, ErrorCheckLevel.Warning, Resources.SelectorOnlyOneChildError) );
else if(_genericChildren.ChildCount <1)
result.Add( new Node.ErrorCheck(this, ErrorCheckLevel.Error, Resources.SelectorNoChildrenError) );
base.CheckForErrors(rootBehavior, result);
}
示例7: CheckForErrors
public override void CheckForErrors(BehaviorNode rootBehavior, List<ErrorCheck> result)
{
if (this._signal.ChildCount == 0)
{
result.Add(new Node.ErrorCheck(this, ErrorCheckLevel.Error, Resources.ImpulseWithoutEventError));
}
base.CheckForErrors(rootBehavior, result);
}
示例8: CheckForErrors
public override void CheckForErrors(BehaviorNode rootBehavior, List<ErrorCheck> result)
{
if (this.Children.Count < 2)
{
result.Add(new Node.ErrorCheck(this, ErrorCheckLevel.Error, "There should be at least 2 condition children."));
}
base.CheckForErrors(rootBehavior, result);
}
示例9: CheckForErrors
public override void CheckForErrors(BehaviorNode rootBehavior, List<ErrorCheck> result)
{
if (this._method == null)
{
result.Add(new Node.ErrorCheck(this, ErrorCheckLevel.Warning, Resources.RandomGeneratorNotSpecified));
}
base.CheckForErrors(rootBehavior, result);
}
示例10: SetProperty
internal static void SetProperty(BehaviorNode behavior, string agentTypename, string agentName, string valueName, string valueStr)
{
foreach(ParametersDock dock in _parameterDocks)
{
if (dock.AgentName == agentName)
{
dock.setProperty(behavior, valueName, valueStr);
break;
}
}
}
示例11: CheckForErrors
public override void CheckForErrors(BehaviorNode rootBehavior, List<ErrorCheck> result) {
if (_do_sequence_error_check) {
if (_genericChildren.EnableChildCount < 1)
{ result.Add(new Node.ErrorCheck(this, ErrorCheckLevel.Error, Resources.SequenceNoChildrenError)); }
else if (_genericChildren.EnableChildCount < 2)
{ result.Add(new Node.ErrorCheck(this, ErrorCheckLevel.Warning, Resources.SequenceOnlyOneChildError)); }
}
base.CheckForErrors(rootBehavior, result);
}
示例12: CheckForErrors
public override void CheckForErrors(BehaviorNode rootBehavior, List<ErrorCheck> result)
{
Type valueType = this._time.GetValueType();
if (valueType != typeof(float))
{
result.Add(new Node.ErrorCheck(this, ErrorCheckLevel.Error, "Time must be a float type!"));
}
base.CheckForErrors(rootBehavior, result);
}
示例13: PushToStack
/**
* Ctor
* @param stack The BehaviorVariable id of stack to push to
* @param item The BehaviorVariable id item variable
*/
public PushToStack(BehaviorNode parent, string stack, string item)
: base(parent)
{
mStack = stack;
mItem = item;
//make sure input is instantiated
if(input == null)
{
input = new object[1];
}
}
示例14: NodeViewDataStyled
public NodeViewDataStyled(NodeViewData parent, BehaviorNode rootBehavior, Node node, Pen borderPen, Brush backgroundBrush, Brush draggedBackgroundBrush, string label, string description, int minWidth = 120, int minHeight = 35) :
base(parent, rootBehavior, node,
NodeShape.RoundedRectangle,
new Style(backgroundBrush, null, Brushes.White),
new Style(null, DefaultCurrentBorderPen, null),
new Style(null, __defaultSelectedBorderPen, null),
new Style(draggedBackgroundBrush, null, null),
new Style(null, __highlightedBorderPen, null),
new Style(null, __updatedBorderPen, null),
new Style(null, __prefabBorderPen, null),
label, __defaultLabelFont, __profileLabelFont, __profileLabelBoldFont, minWidth, minHeight, description) {
}
示例15: BehaviorNode
public BehaviorReturn mReturnValue = BehaviorReturn.Invalid; /**< as process is ran in coroutines returning a BehaviorReturn type is not allowed. So we store it here and check it with ReturnValue property */
#endregion Fields
#region Constructors
public BehaviorNode(BehaviorNode parent)
{
Composite compNode = parent as Composite;
if (compNode != null)
compNode.AddChild(this);
else
{
Decorator decNode = parent as Decorator;
if (decNode != null)
decNode.AddChild(this);
}
}