本文整理汇总了C#中BehaviorNode.Clone方法的典型用法代码示例。如果您正苦于以下问题:C# BehaviorNode.Clone方法的具体用法?C# BehaviorNode.Clone怎么用?C# BehaviorNode.Clone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BehaviorNode
的用法示例。
在下文中一共展示了BehaviorNode.Clone方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetReferenceBehavior
private void SetReferenceBehavior(BehaviorNode referencedBehavior_) {
Debug.Check(referencedBehavior_ != null);
Behavior refTree = null;
bool bPlanningExpand = this.IsPlanningExpand();
if (bPlanningExpand) {
//set it first here as it might recursively point to itself
//otherwise in the following Clone, referencedBehavior_ will be null
this._referencedBehavior = referencedBehavior_;
refTree = (Behavior)referencedBehavior_.Clone();
refTree.ParentNode = this;
refTree.PlanningProcess = Plugin.PlanningProcess;
//TrimForPlanning_(refTree);
} else {
Behavior b = referencedBehavior_ as Behavior;
refTree = new Behavior(b);
}
this._referencedBehavior = refTree;
_referencedBehavior.WasModified += new WasModifiedEventDelegate(referencedBehavior_WasModified);
_referencedBehavior.WasRenamed += new WasRenamedEventDelegate(referencedBehavior_WasRenamed);
if (bPlanningExpand) {
// assign the connector of the behaviour
_genericChildren = _referencedBehavior.GenericChildren;
_children.SetConnector(_genericChildren);
this._planningProcess = Plugin.PlanningProcess;
ms_expanding++;
ExpandRefBehavior(refTree);
ms_expanding--;
}
//when expand planning process, don't update _task, as it will be set wrongly
if (Plugin.EditMode == EditModes.Design) {
Behavior refTree_ = referencedBehavior_ as Behavior;
if (refTree_.Children.Count > 0 && refTree_.Children[0] is Task) {
Task rootTask = refTree_.Children[0] as Task;
this._task = (MethodDef)rootTask.Prototype.Clone();
}
}
}