示例#1
0
        public MainWindow()
        {
            InitializeComponent();
            _player = new HapticPlayer();

            foreach (var s in arr)
            {
                try
                {
                    var readAllText = File.ReadAllText(s);

                    var hapticFeedbackFile = CommonUtils.ConvertJsonStringToTactosyFile(readAllText);
                    _player.Register(s, hapticFeedbackFile.Project);

                    var button = new Button();
                    button.Content = s;
                    button.Click  += (sender, args) =>
                    {
                        _player.SubmitRegisteredVestRotation(s, s, new RotationOption(0, 0), new ScaleOption(1, 1));
                    };
                    ButtonContainer.Children.Add(button);
                }
                catch (Exception e)
                {
                    Debug.WriteLine(e.Message + " " + e.StackTrace);
                }
            }
        }
示例#2
0
 void OnDestroy()
 {
     if (HapticPlayer != null)
     {
         HapticPlayer.Dispose();
     }
     _hapticPlayer = null;
 }
示例#3
0
        public MainWindow()
        {
            InitializeComponent();
            _player = new HapticPlayer();


            string sssss = "[\"Head\"]";

            var jsonNode = JSON.Parse(sssss);

            foreach (var keyValuePair in jsonNode.AsArray)
            {
                Debug.WriteLine(keyValuePair);

                var positionType = EnumParser.ToPositionType(keyValuePair.Value);

                Debug.WriteLine(positionType);
            }


            foreach (var s in arr)
            {
                try
                {
                    var readAllText = File.ReadAllText(s);

                    var hapticFeedbackFile = CommonUtils.ConvertJsonStringToTactosyFile(readAllText);
                    _player.Register(s, hapticFeedbackFile.Project);

                    var button = new Button();
                    button.Content = s;
                    button.Click  += (sender, args) =>
                    {
                        _player.SubmitRegisteredVestRotation(s, s, new RotationOption(0, 0), new ScaleOption(1, 1));
                    };
                    ButtonContainer.Children.Add(button);
                }
                catch (Exception e)
                {
                    Debug.WriteLine(e.Message + " " + e.StackTrace);
                }
            }
        }
示例#4
0
 void OnEnable()
 {
     player              = BhapticsManager.HapticPlayer;
     VestRotationAngleX  = 0;
     VestRotationOffsetY = 0;
 }