当前位置: 首页>>代码示例>>C#>>正文


C# BehaviorNode类代码示例

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


注:本文中的BehaviorNode类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。