Exemplo n.º 1
0
 // Start is called before the first frame update
 void Start()
 {
     // Get instance of logger.
     logger = FindObjectOfType <LoggerObject>();
     // Acquire gamepad if selected.
     if (settings.gamepadSettings.selectedGamepad > 0)
     {
         gamepad.Acquire(settings.gamepadSettings.selectedGamepad - 1);
     }
     // Setup MQTT Channels for button presses.
     gamepad.SetupChannels(settings.buttonTopics);
     stopwatch.Start();
     // Create smooth buffer
     smoothBuffer = new ValueBuffer(GetBufferSize(settings.inputSmooth), true);
     // Setup tracking of settings changes.
     logSettings = new KeySphericalSettings();
     LogSphericalSettings();
 }
Exemplo n.º 2
0
        void Start()
        {
            // Get instance of logger.
            logger = FindObjectOfType <LoggerObject>();
            // Setup Listener.
            MQTTChannel <MSG> channel = new MQTTChannel <MSG>(string.Format("{0}/Data", settings.deviceName));

            channel.Event.AddListener(OnMessage);
            // Start treadmill.
            statusChannel = new MQTTChannel <StatusMsg>(string.Format("{0}/Status", settings.deviceName), false);
            statusChannel.Send(new StatusMsg()
            {
                status = true
            });
            // Create smooth buffer
            smoothBuffer = new ValueBuffer(GetBufferSize(settings.inputSmooth), true);
            // Setup tracking of settings changes.
            logSettings = new KeySphericalSettings();
            LogSphericalSettings();
        }