/// <summary> /// Subtree to pickup an object from the given PropHolder, using the given InteractionObject /// for the IK. This subtree will not change state. Also, this subtree will not let the character /// approach the PropHolder, which should be done in another step. /// </summary> public Node ST_Pickup(PropHolder holder, InteractionObject pickup) { return new DecoratorCatch( () => { this.Character.StopInteraction(FullBodyBipedEffector.RightHand); this.Character.HeadLookStop(); }, new Sequence( this.ST_OrientAndReach(holder.transform.position, pickup), new LeafInvoke(() => this.HoldPropRightHand.Attach(holder.Release())), this.Node_StopInteraction(FullBodyBipedEffector.RightHand), this.Node_HeadLookStop())); }
protected Node ST_Drop(SmartCharacter user, StateName holdingState, PropHolder holder) { return new Sequence( user.Node_Require(StateName.RoleActor, holdingState, StateName.IsStanding), this.Node_Require(StateName.RoleContainer, ~StateName.IsOccupied), new LeafInvoke(() => this.Holder.Attach(holder.Release())), this.Node_Set(holdingState, StateName.IsOccupied), user.Node_Set(~holdingState)); }