// Start is called before the first frame update
    void Start()
    {
        if (Application.platform == RuntimePlatform.OSXEditor || Application.platform == RuntimePlatform.OSXPlayer)
        {
            Debug.Log("You're running " + SystemInfo.operatingSystem +
                      ". Aborting MonkeyLogicController.cs");
            return; // LSL crashes OSX
        }

        // These need to be MonoBehavior so leave unchanged
        _resolver   = gameObject.AddComponent <MonkeyLogicResolver>();
        _trialInlet = gameObject.AddComponent <MonkeyLogicInlet>();
        outlets     = gameObject.AddComponent <MonkeyLogicOutlet>();

        // Configure

        _trialInlet.Configure(_trialInletName, _trialInletType, _trialInletID, _resolver);

        trialOutlet = outlets.Configure(_trialOutletName,
                                        _trialOutletType,
                                        1,
                                        liblsl.IRREGULAR_RATE,
                                        liblsl.channel_format_t.cf_string,
                                        _trialOutletID,
                                        GenerateXMLMetaData());

        // add listener for Streams delegates
        _trialInlet.OnTrialParamReceived    += ForwardTrialParam;
        _trialInlet.OnTrialDataReceived     += ForwardTrialData;
        _trialInlet.OnPlaybackStartReceived += ForwardStartPlayback;
        _trialInlet.OnCalibrationReceived   += ForwardEyecalibration;
    }
    // Start is called before the first frame update
    void Start()
    {
        if (Application.platform == RuntimePlatform.OSXEditor || Application.platform == RuntimePlatform.OSXPlayer)
        {
            Debug.Log("You're running " + SystemInfo.operatingSystem +
                      ". Aborting MonkeyLogicController.cs");
            return; // LSL crashes OSX
        }

        // Create stream descriptors
        outlets = gameObject.AddComponent <MonkeyLogicOutlet>();

        // These need to be MonoBehavior so leave unchanged
        _resolver = gameObject.AddComponent <MonkeyLogicResolver>();
        inlet     = gameObject.AddComponent <MonkeyLogicInlet>();

        // Configure
        frameOutlet = outlets.Configure(_frameOutletName,
                                        _frameOutletType,
                                        22,
                                        liblsl.IRREGULAR_RATE,
                                        liblsl.channel_format_t.cf_double64,
                                        _frameOutletID,
                                        GenerateXMLMetaData());

        trialOutlet = outlets.Configure(_trialOutletName,
                                        _trialOutletType,
                                        1,
                                        liblsl.IRREGULAR_RATE,
                                        liblsl.channel_format_t.cf_string,
                                        _trialOutletID,
                                        GenerateXMLMetaData());

        inlet.Configure(_controlInletName, _controlInletType, _controlInletID, _resolver);

        // add listener for Streams delegates
        inlet.OnCalibrationReceived += ForwardEyecalibration;
        inlet.OnCommand             += ForwardCommand;

        EventsController.OnPublishFrame += PublishFrame;
        EventsController.OnPublishTrial += PublishTrial;
    }