Ejemplo n.º 1
0
        void Awake()
        {
            if (Instance == null)
            {
                Instance = this;
            }
            else if (Instance != this)
            {
                Debug.LogError("There should only be one NSManager! Make sure there is only one NSManager prefab in the scene\n" +
                               "If there is no NSManager, one will be created for you!");
            }

            _imuCalibrator = new CalibratorWrapper(new MockImuCalibrator());

            //The plugin needs to load resources from your app's Streaming Assets folder
            _plugin = new NSVR.NSVR_Plugin();

            _trackingUpdateLoop = UpdateTracking();
            _suitStatusLoop     = CheckSuitConnection();

            DoDelayedAction(1.0f, delegate()
            {
                _suitStatus = ChangeSuitStatus(_plugin.PollStatus());
                StartCoroutine(_suitStatusLoop);
            });
        }
Ejemplo n.º 2
0
        void Start()
        {
            imus = NSManager.Instance.GetImuCalibrator();
            NSManager.Instance.SetImuCalibrator(GetComponent <DefaultImuCalibrator>());

            if (ParentObject != null)
            {
                ParentObject.SetActive(!DisableObject);
            }
        }
Ejemplo n.º 3
0
        void Awake()
        {
            if (Instance == null)
            {
                Instance = this;
            }
            else if (Instance != this)
            {
                Debug.LogError("There should only be one NSManager! Make sure there is only one NSManager prefab in the scene\n" +
                               "If there is no NSManager, one will be created for you!");
            }

            _imuCalibrator = new CalibratorWrapper(new MockImuCalibrator());

            //The plugin needs to load resources from your app's Streaming Assets folder
            _plugin = new NSVR.NSVR_Plugin();
        }
Ejemplo n.º 4
0
        void Awake()
        {
            if (Instance == null)
            {
                Instance = this;
            }
            else if (Instance != this)
            {
                Debug.LogError("There should only be one NSManager! Make sure there is only one NSManager prefab in the scene\n" +
                               "If there is no NSManager, one will be created for you!");
            }

            _trackingUpdateLoop          = UpdateTracking();
            _ServiceConnectionStatusLoop = CheckServiceConnection();

            _imuCalibrator = new CalibratorWrapper(new MockImuCalibrator());

            InitPlugin();
        }
Ejemplo n.º 5
0
        void Awake()
        {
            if (Instance == null)
            {
                Instance = this;
            }
            else if (Instance != this)
            {
                Debug.LogError("There should only be one NSManager! Make sure there is only one NSManager prefab in the scene\n" +
                               "If there is no NSManager, one will be created for you!");
            }

            _imuCalibrator = new CalibratorWrapper(new MockImuCalibrator());

            //The plugin needs to load resources from your app's Streaming Assets folder
            _plugin = new NSVR.NSVR_Plugin(Application.streamingAssetsPath + "/Haptics");

            _trackingUpdateLoop = UpdateTracking();
            _suitStatus         = SuitStatus.Disconnected;
        }
Ejemplo n.º 6
0
 public CalibratorWrapper(IImuCalibrator c)
 {
     _calibrator = c;
 }
Ejemplo n.º 7
0
 public void SetCalibrator(IImuCalibrator c)
 {
     _calibrator = c;
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Tell the manager to use a different IMU calibrator
 /// </summary>
 /// <param name="calibrator">A custom calibrator which will receive raw orientation data from the suit and calibrate it for your game</param>
 public void SetImuCalibrator(IImuCalibrator calibrator)
 {
     ((CalibratorWrapper)_imuCalibrator).SetCalibrator(calibrator);
 }