本文整理汇总了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);
}
}