}     /* OnHandleActivationRequested() */

        // unregistration
        public override void OnHandleDeactivationRequested(object sender, ApollonBackendManager.EngineHandleEventArgs arg)
        {
            // check
            if (this.ID == arg.HandleID)
            {
                // log
                UnityEngine.Debug.Log(
                    "<color=Blue>Info: </color> ApollonMotionSystemPS6TM550Handle.OnHandleDeactivationRequested() : requesting deactivation "
                    );

                if (this.Initialized)
                {
                    // log
                    UnityEngine.Debug.Log(
                        "<color=Blue>Info: </color> ApollonMotionSystemPS6TM550Handle.OnHandleDeactivationRequested() : finalize motion system API"
                        );

                    // ForceSeatMI - BEGIN
                    this.m_FSMI_UnityAPI.Pause(true);
                    this.m_FSMI_UnityAPI.End();
                    // ForceSeatMI - END

                    // mark as init
                    this.Initialized = false;
                } /* if() */

                // pull-up
                base.OnHandleDeactivationRequested(sender, arg);
            } /* if() */
        }     /* OnHandleDeactivationRequested() */
Пример #2
0
        } /* Dispose(bool) */

        #region event handling 

        public override void OnHandleActivationRequested(object sender, ApollonBackendManager.EngineHandleEventArgs arg)
        {

            // check
            if (this.ID == arg.HandleID)
            {
                
                // Load native library
                if (!this.LoadNativeLibrary())
                {

                    // log
                    UnityEngine.Debug.LogError(
                        "<color=Red>Error: </color> ApollonAbstractNativeHandle.OnHandleActivationRequested() : failed to load library. "
                        + Marshal.GetLastWin32Error()
                    );

                    // fail 
                    return;

                } /* if() */

                // bind delegate(s) 
                if (!this.BindNativeLibrary())
                {

                    // log
                    UnityEngine.Debug.LogError(
                        "<color=Red>Error: </color> ApollonAbstractNativeHandle.OnHandleActivationRequested() : failed to bind library entries to delegates. "
                        + Marshal.GetLastWin32Error()
                    );

                    // fail 
                    return;

                } /* if() */

                // construct internal
                if (!this.ConstructNativeLibrary())
                {

                    // log
                    UnityEngine.Debug.LogError(
                        "<color=Red>Error: </color> ApollonAbstractNativeHandle.OnHandleActivationRequested() : failed to construct library. "
                        + Marshal.GetLastWin32Error()
                    );

                    // fail 
                    return;

                } /* if() */

                // pull-up
                base.OnHandleActivationRequested(sender, arg);

            } /* if() */

        } /* OnHandleActivationRequested() */
Пример #3
0
        } /* OnHandleActivationRequested() */

        // unregistration
        public override void OnHandleDeactivationRequested(object sender, ApollonBackendManager.EngineHandleEventArgs arg)
        {

            // check
            if (this.ID == arg.HandleID)
            {

                // pull-up
                base.OnHandleDeactivationRequested(sender, arg);

            } /* if() */

        } /* OnHandleDeactivationRequested() */
Пример #4
0
        public virtual void OnHandleActivationRequested(object sender, ApollonBackendManager.EngineHandleEventArgs arg)
        {

            // check
            if (this.ID == arg.HandleID)
            {

                // validate
                ApollonBackendManager.Instance.ValidateHandle(this.ID, this);

            } /* if() */

        } /* OnHandleActivationRequested() */
        } /* Dispose(bool) */

        public override void OnHandleActivationRequested(object sender, ApollonBackendManager.EngineHandleEventArgs arg)
        {
            // check
            if (this.ID == arg.HandleID)
            {
                // log
                UnityEngine.Debug.Log(
                    "<color=Blue>Info: </color> ApollonMotionSystemPS6TM550Handle.OnHandleActivationRequested() : requesting activation"
                    );

                if (!this.Initialized)
                {
                    // log
                    UnityEngine.Debug.Log(
                        "<color=Blue>Info: </color> ApollonMotionSystemPS6TM550Handle.OnHandleActivationRequested() : initialize motion system API"
                        );

                    // ForceSeatMI - BEGIN
                    this.m_FSMI_UnityAPI = new MotionSystems.ForceSeatMI_Unity();
                    this.m_FSMI_CommandExtraParameters = new MotionSystems.ForceSeatMI_Unity.ExtraParameters();
                    this.m_FSMI_Command
                        = new ApollonMotionSystemPS6TM550Command(
                              gameplay.ApollonGameplayManager.Instance.getBridge(
                                  gameplay.ApollonGameplayManager.GameplayIDType.MotionSystemCommand
                                  ).Behaviour.gameObject
                              );
                    this.m_FSMI_Sensor
                        = new ApollonMotionSystemPS6TM550Sensor(
                              gameplay.ApollonGameplayManager.Instance.getBridge(
                                  gameplay.ApollonGameplayManager.GameplayIDType.MotionSystemSensor
                                  ).Behaviour.gameObject
                              );
                    this.m_FSMI_Updater = new ApollonMotionSystemPS6TM550Updater(this);

                    this.m_FSMI_UnityAPI.SetAppID(""); // If you have dedicated app id, remove ActivateProfile calls from your code
                    this.m_FSMI_UnityAPI.ActivateProfile("APOLLON - " + experiment.ApollonExperimentManager.Instance.getActiveProfile());
                    this.m_FSMI_UnityAPI.SetPositioningObject(this.m_FSMI_Command);
                    this.m_FSMI_UnityAPI.SetPlatformInfoObject(this.m_FSMI_Sensor);
                    this.m_FSMI_UnityAPI.Pause(false);
                    this.m_FSMI_UnityAPI.Begin();
                    // ForceSeatMI - END

                    // mark as init
                    this.Initialized = true;
                } /* if() */

                // pull-up
                base.OnHandleActivationRequested(sender, arg);
            } /* if() */
        }     /* OnHandleActivationRequested() */
Пример #6
0
        } /* OnHandleActivationRequested() */

        // unregistration
        public virtual void OnHandleDeactivationRequested(object sender, ApollonBackendManager.EngineHandleEventArgs arg)
        {

            // check
            if (this.ID == arg.HandleID)
            {

                // unplug - comment: it let the system doing it's job
                //this.Dispose();

                // unvalidate
                ApollonBackendManager.Instance.InvalidateHandle(this.ID, this);

            } /* if() */

        } /* OnHandleDeactivationRequested() */