public void Initialize(
            IMessageReceiver receiver,
            KeyboardProvider keyboard,
            TouchPadProvider touchPad,
            MidiControllerProvider midiController,
            ParticleStore particleStore
            )
        {
            _keyboard                 = keyboard;
            _touchPad                 = touchPad;
            _midiController           = midiController;
            _particleStore            = particleStore;
            _keyboardVisibility       = keyboard.GetComponent <KeyboardVisibility>();
            _touchPadVisibility       = touchPad.GetComponent <TouchpadVisibility>();
            _midiControllerVisibility = midiController.GetComponent <MidiControllerVisibility>();

            receiver.AssignCommandHandler(
                VmmCommands.HidVisibility,
                message => SetHidVisibility(message.ToBoolean())
                );
            receiver.AssignCommandHandler(
                VmmCommands.MidiControllerVisibility,
                message => SetMidiVisibility(message.ToBoolean())
                );
        }
Esempio n. 2
0
        private void Start()
        {
            _receiver = GetComponent <DeviceTransformControlReceiver>();

            _keyboardControl = _receiver.KeyboardControl;
            _touchPadControl = _receiver.TouchPadControl;
            _gamePadControl  = _receiver.GamepadControl;
            _midiControl     = _receiver.MidiControl;

            _keyboardVisibility       = _keyboardControl.GetComponent <KeyboardVisibility>();
            _touchPadVisibility       = _touchPadControl.GetComponent <TouchpadVisibility>();
            _gamepadVisibility        = _gamePadControl.GetComponent <GamepadVisibilityReceiver>();
            _midiControllerVisibility = _midiControl.GetComponent <MidiControllerVisibility>();
        }
Esempio n. 3
0
        private void Start()
        {
            _keyboardVisibility       = keyboard.GetComponent <KeyboardVisibility>();
            _touchpadVisibility       = touchpad.GetComponent <TouchpadVisibility>();
            _midiControllerVisibility = midiController.GetComponent <MidiControllerVisibility>();

            handler.Commands.Subscribe(message =>
            {
                switch (message.Command)
                {
                case MessageCommandNames.HidVisibility:
                    SetHidVisibility(message.ToBoolean());
                    break;

                case MessageCommandNames.MidiControllerVisibility:
                    SetMidiVisibility(message.ToBoolean());
                    break;
                }
            });
        }