public new BehaviorArray Clone() { var behaviors = (Behavior[])_behaviors.Clone(); BehaviorArray clone = new BehaviorArray(behaviors, Name) { Criteria = this.Criteria, RunCondition = this.RunCondition, DisposalAction = this.DisposalAction, }; return(clone); }
public static void ResetBehavior(Behavior behavior, bool allParents = false) { if (behavior.Parent != null) { if (behavior.Parent.Parent != null) { BehaviorArray _currentParent = behavior.Parent.Parent; _currentParent.Dispose(); _currentParent.Initalize(); } behavior.Parent.Dispose(); behavior.Parent.Initalize(); } else { behavior.Dispose(); behavior.Initalize(); } }