當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。