public bool IsMatchCurrentTree(Merchant.ActionType _mode) { MerchantBehaviorTree merchantBehaviorTree = (MerchantBehaviorTree)null; this.behaviorTreeTable.TryGetValue(_mode, out merchantBehaviorTree); return(Object.op_Equality((Object)this.currentTree, (Object)merchantBehaviorTree)); }
public void ChangeMode(Merchant.ActionType _mode) { MerchantBehaviorTree merchantBehaviorTree = (MerchantBehaviorTree)null; if (!this.behaviorTreeTable.TryGetValue(_mode, out merchantBehaviorTree) || Object.op_Equality((Object)merchantBehaviorTree, (Object)null)) { return; } this.Mode = _mode; if (this.currentTree != null) { this.currentTree.DisableBehavior(false); } merchantBehaviorTree.DisableBehavior(false); this.currentTree = merchantBehaviorTree; ObservableExtensions.Subscribe <Unit>(Observable.Where <Unit>((IObservable <M0>)Observable.NextFrame((FrameCountType)0), (Func <M0, bool>)(_ => ((Behaviour)this).get_isActiveAndEnabled())), (System.Action <M0>)(_ => this.currentTree.EnableBehavior())); }
public MerchantBehaviorTree GetBehaviorTree(Merchant.ActionType _mode) { MerchantBehaviorTree merchantBehaviorTree = (MerchantBehaviorTree)null; return(this.behaviorTreeTable.TryGetValue(_mode, out merchantBehaviorTree) ? merchantBehaviorTree : (MerchantBehaviorTree)null); }