public BodyMotionManagerReceiver(IMessageReceiver receiver, BodyMotionManager bodyMotionManager) { _bodyMotionManager = bodyMotionManager; receiver.AssignCommandHandler( VmmCommands.EnableWaitMotion, message => EnableWaitMotion(message.ToBoolean()) ); receiver.AssignCommandHandler( VmmCommands.WaitMotionScale, message => SetWaitMotionScale(message.ParseAsPercentage()) ); receiver.AssignCommandHandler( VmmCommands.WaitMotionPeriod, message => SetWaitMotionDuration(message.ToInt()) ); receiver.AssignCommandHandler( VmmCommands.EnableBodyLeanZ, message => bodyMotionManager.EnableImageBaseBodyLeanZ(message.ToBoolean()) ); receiver.AssignCommandHandler( VmmCommands.EnableNoHandTrackMode, message => bodyMotionManager.SetNoHandTrackMode(message.ToBoolean()) ); _waitingMotionSize = _bodyMotionManager.WaitingBodyMotion.MotionSize; SetWaitMotionScale(1.25f); }
private void Start() { _waitingMotionSize = bodyMotionManager.WaitingBodyMotion.MotionSize; SetWaitMotionScale(1.25f); handler.Commands.Subscribe(message => { switch (message.Command) { case MessageCommandNames.EnableWaitMotion: EnableWaitMotion(message.ToBoolean()); break; case MessageCommandNames.WaitMotionScale: SetWaitMotionScale(message.ParseAsPercentage()); break; case MessageCommandNames.WaitMotionPeriod: SetWaitMotionDuration(message.ToInt()); break; case MessageCommandNames.EnableBodyLeanZ: bodyMotionManager.EnableImageBaseBodyLeanZ(message.ToBoolean()); break; default: break; } }); }