本文整理汇总了C#中BehaviorNode类的典型用法代码示例。如果您正苦于以下问题:C# BehaviorNode类的具体用法?C# BehaviorNode怎么用?C# BehaviorNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BehaviorNode类属于命名空间,在下文中一共展示了BehaviorNode类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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));
}
开发者ID:NickCullen,项目名称:UnityBehaviorTrees,代码行数:12,代码来源:BehaviorTree.cs
示例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";
}
开发者ID:haolly,项目名称:behaviac,代码行数:7,代码来源:ExporterCpp.cs
示例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;
}
开发者ID:675492062,项目名称:behaviac,代码行数:7,代码来源:StateBase.cs
示例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);
}
开发者ID:drzo,项目名称:opensim4opencog,代码行数:7,代码来源:Decorator.cs
示例5: CreateNodeViewData
public override NodeViewData CreateNodeViewData(NodeViewData parent, BehaviorNode rootBehavior)
{
NodeViewData nvd = base.CreateNodeViewData(parent, rootBehavior);
nvd.ChangeShape(NodeShape.Ellipse);
return nvd;
}
开发者ID:Just4F,项目名称:behaviac,代码行数:7,代码来源:DecoratorWeight.cs
示例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);
}
开发者ID:drzo,项目名称:opensim4opencog,代码行数:9,代码来源:Selector.cs
示例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);
}
开发者ID:Just4F,项目名称:behaviac,代码行数:9,代码来源:WaitforSignal.cs
示例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);
}
开发者ID:nusus,项目名称:behaviac,代码行数:9,代码来源:Or.cs
示例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);
}
开发者ID:KeyleXiao,项目名称:behaviac,代码行数:9,代码来源:SelectorStochastic.cs
示例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;
}
}
}
开发者ID:Just4F,项目名称:behaviac,代码行数:11,代码来源:ParametersDock.cs
示例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);
}
开发者ID:XyzalZhang,项目名称:behaviac,代码行数:11,代码来源:Sequence.cs
示例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);
}
开发者ID:pra85,项目名称:behaviac,代码行数:11,代码来源:DecoratorTime.cs
示例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];
}
}
开发者ID:NickCullen,项目名称:UnityBehaviorTrees,代码行数:17,代码来源:PushToStack.cs
示例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) {
}
开发者ID:675492062,项目名称:behaviac,代码行数:12,代码来源:NodeViewDataStyled.cs
示例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);
}
}
开发者ID:NickCullen,项目名称:UnityBehaviorTrees,代码行数:18,代码来源:BehaviorNode.cs
示例16: CheckForErrors
public override void CheckForErrors(BehaviorNode rootBehavior, List<ErrorCheck> result)
{
foreach (BaseNode child in _genericChildren.Children)
{
if (!(child is WithPrecondition))
{
result.Add(new Node.ErrorCheck(this, ErrorCheckLevel.Error, Resources.SelectorLoopChildChildError));
}
}
base.CheckForErrors(rootBehavior, result);
}
开发者ID:675492062,项目名称:behaviac,代码行数:12,代码来源:SelectorLoop.cs
示例17: CheckForErrors
public override void CheckForErrors(BehaviorNode rootBehavior, List<ErrorCheck> result)
{
if (_Task.Child == null)
{
result.Add(new Node.ErrorCheck(this, ErrorCheckLevel.Error, Resources.NoMethosError));
}
if (!(this.Parent is Task))
{
result.Add(new Node.ErrorCheck(this, ErrorCheckLevel.Error, Resources.MethodParentError));
}
base.CheckForErrors(rootBehavior, result);
}
开发者ID:675492062,项目名称:behaviac,代码行数:14,代码来源:Method.cs
示例18: CheckForErrors
public override void CheckForErrors(BehaviorNode rootBehavior, List<ErrorCheck> result)
{
base.CheckForErrors(rootBehavior, result);
if (this._bDoneWithinFrame)
{
long count = this.GetCount();
if (count == -1)
{
result.Add(new Node.ErrorCheck(this, ErrorCheckLevel.Error, "when 'DoneWithinFrame' is selected, Count should not be -1 as an endless loop!"));
}
}
}
开发者ID:tachen,项目名称:behaviac,代码行数:14,代码来源:DecoratorLoop.cs
示例19: Coroutine_Execute
/**
* Coroutine to begin the BehaviorTree
* @param node The root node
* @return IEnumerator (see Unity Coroutine)
*/
private IEnumerator Coroutine_Execute(BehaviorNode node)
{
//set this to true as the behavior tree is running
mStatus = BehaviorReturn.Running;
mCurrent = node;
yield return BeginNode(mCurrent);
//the status of this tree will be whatever the value of the first node was
mStatus = mCurrent.mReturnValue;
Debug.Log("BEHAVIOR COMPLETE " + mStatus);
mCurrent = null;
}
开发者ID:NickCullen,项目名称:UnityBehaviorTrees,代码行数:20,代码来源:BehaviorTree.cs
示例20: CheckForErrors
public override void CheckForErrors(BehaviorNode rootBehavior, List<ErrorCheck> result)
{
Type valueType = (this._time != null) ? this._time.ValueType : null;
if (valueType == null)
{
result.Add(new Node.ErrorCheck(this, ErrorCheckLevel.Error, "Time is not set!"));
}
else if (!Plugin.IsIntergerType(valueType) && !Plugin.IsFloatType(valueType))
{
result.Add(new Node.ErrorCheck(this, ErrorCheckLevel.Error, "Time must be a float type!"));
}
base.CheckForErrors(rootBehavior, result);
}
开发者ID:wuzhen,项目名称:behaviac,代码行数:15,代码来源:DecoratorTime.cs
注:本文中的BehaviorNode类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论