private bool GetInputSourceHandle(string path, ref ulong handle) { var e = input.GetInputSourceHandle(path, ref handle); if (e != EVRInputError.None) { Debug.LogError($"Failed: 'GetInputSourceHandle' with path '{path}': {e}"); return(false); } return(true); }
//InputSourceを登録してハンドルを格納 public void RegisterInputSource(string path) { ReadyCheck(); //実行可能な状態かチェック EVRInputError inputError = EVRInputError.None; ulong handle = InvalidInputHandle; //ハンドルが存在しない場合登録。すでにある場合は無視 if (!InputSourceHandles.ContainsKey(path)) { inputError = vrinput.GetInputSourceHandle(path, ref handle); if (inputError != EVRInputError.None) { //だいたいハンドル名が間違っている。いずれにせよ致命的エラー throw new IOException(inputError.ToString()); } InputSourceHandles.Add(path, handle); } return; }