Skip to content

Commit db5b52f

Browse files
author
lawwong
committed
Update to v1.10.0
* New Features - SteamVR Plugin v2.0/v2.1 support - [SteamVR New Input System support](https://github.com/ViveSoftware/ViveInputUtility-Unity/wiki/SteamVR-Input-System-Support) * Improvement - Now compatible with Google VR SDK v1.170.0 - Add ControllerAxis.Joystick for Windows Mixed Reality Motion Controller - Extend ControllerButton alias - BKey (Menu) - BkeyTouch (MenuTouch) - Bumper (Axis3) - BumperTouch (Axis3Touch) - Add ControllerButton.DPadXXX virtual buttons (simulated from trackpad/thumbstick values) - DPadLeft - DPadLeftTouch - DPadUp - DPadUpTouch - DPadRight - DPadRightTouch - DPadDown - DPadDownTouch - DPadUpperLeft - DPadUpperLeftTouch - DPadUpperRight - DPadUpperRightTouch - DPadLowerRight - DPadLowerRightTouch - DPadLowerLeft - DPadLowerLeftTouch * Known Issues - When working with SteamVR Plugin v2, VIU can get poses or send vibration pulses for all connected devices, but only able to connect button inputs from up to 2 Vive Controllers or 10 Vive Trackers (due to the limitation of SteamVR input sources). If you know how to work around, please let us know.
2 parents 3c56e13 + fadb710 commit db5b52f

File tree

79 files changed

+6765
-1037
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+6765
-1037
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ Assets/HTC.UnityPlugin/ViveInputUtility/Scripts/Editor/VIUProjectSettings.asset.
2323

2424
*.cfg
2525
*.log
26+
*.json
27+
*.vrmanifest
2628

2729
# Autogenerated VS/MD/Consulo solution and project files
2830
ExportedObj/

Assets/HTC.UnityPlugin/VRModule/Editor/VRModuleManagerEditor.cs

Lines changed: 49 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public class ReqMethodInfo
3636

3737
public string symbol = string.Empty;
3838
public string[] reqTypeNames = null;
39+
public string[] reqAnyTypeNames = null;
3940
public string[] reqFileNames = null;
4041
public ReqFieldInfo[] reqFields = null;
4142
public ReqMethodInfo[] reqMethods = null;
@@ -61,6 +62,14 @@ public void FindRequiredTypesInAssembly(Assembly assembly)
6162
}
6263
}
6364

65+
if (reqAnyTypeNames != null)
66+
{
67+
foreach (var name in reqAnyTypeNames)
68+
{
69+
TryAddTypeFromAssembly(name, assembly);
70+
}
71+
}
72+
6473
if (reqFields != null)
6574
{
6675
foreach (var field in reqFields)
@@ -113,6 +122,22 @@ public bool Validate()
113122
}
114123
}
115124

125+
if (reqAnyTypeNames != null)
126+
{
127+
var found = false;
128+
129+
foreach (var name in reqAnyTypeNames)
130+
{
131+
if (s_foundTypes.ContainsKey(name))
132+
{
133+
found = true;
134+
break;
135+
}
136+
}
137+
138+
if (!found) { return false; }
139+
}
140+
116141
if (reqFields != null)
117142
{
118143
foreach (var field in reqFields)
@@ -174,8 +199,8 @@ static VRModuleManagerEditor()
174199
s_symbolReqList.Add(new SymbolRequirement()
175200
{
176201
symbol = "VIU_STEAMVR",
177-
reqTypeNames = new string[] { "SteamVR" },
178-
reqFileNames = new string[] { "SteamVR.cs" },
202+
reqTypeNames = new string[] { "Valve.VR.OpenVR" },
203+
reqFileNames = new string[] { "openvr_api.cs" },
179204
});
180205

181206
s_symbolReqList.Add(new SymbolRequirement()
@@ -238,6 +263,18 @@ static VRModuleManagerEditor()
238263
reqFileNames = new string[] { "openvr_api.cs" },
239264
});
240265

266+
s_symbolReqList.Add(new SymbolRequirement()
267+
{
268+
symbol = "VIU_STEAMVR_2_0_0_OR_NEWER",
269+
reqTypeNames = new string[] { "Valve.VR.SteamVR" },
270+
});
271+
272+
s_symbolReqList.Add(new SymbolRequirement()
273+
{
274+
symbol = "VIU_STEAMVR_2_1_0_OR_NEWER",
275+
reqTypeNames = new string[] { "Valve.VR.SteamVR_ActionSet_Manager" },
276+
});
277+
241278
s_symbolReqList.Add(new SymbolRequirement()
242279
{
243280
symbol = "VIU_OCULUSVR",
@@ -252,6 +289,13 @@ static VRModuleManagerEditor()
252289
reqFileNames = new string[] { "GvrUnitySdkVersion.cs" },
253290
});
254291

292+
s_symbolReqList.Add(new SymbolRequirement()
293+
{
294+
symbol = "VIU_GOOGLEVR_1_150_0_NEWER",
295+
reqTypeNames = new string[] { "GvrControllerInputDevice" },
296+
reqFileNames = new string[] { "GvrControllerInputDevice.cs" },
297+
});
298+
255299
s_symbolReqList.Add(new SymbolRequirement()
256300
{
257301
symbol = "VIU_WAVEVR",
@@ -282,7 +326,7 @@ static VRModuleManagerEditor()
282326
},
283327
reqFileNames = new string[] { "wvr.cs" },
284328
});
285-
329+
286330
s_symbolReqList.Add(new SymbolRequirement()
287331
{
288332
symbol = "VIU_WAVEVR_2_1_0_OR_NEWER",
@@ -395,6 +439,8 @@ public static AssetDeleteResult OnWillDeleteAsset(string assetPath, RemoveAssetO
395439

396440
foreach (var symbolReq in s_symbolReqList)
397441
{
442+
if (symbolReq == null || symbolReq.reqFileNames == null) { continue; }
443+
398444
foreach (var reqFileName in symbolReq.reqFileNames)
399445
{
400446
if (isDir)

Assets/HTC.UnityPlugin/VRModule/Modules/Editor/UnityEngineVRModuleEditor.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,10 @@ private static void EnforceInputManagerBindings()
1818
try
1919
{
2020
var axisObj = new Axis();
21-
for (int i = 0; i < UnityEngineVRModule.ButtonAxisID.Count; ++i)
21+
for (int i = 0, imax = UnityEngineVRModule.GetUnityAxisCount(); i < imax; ++i)
2222
{
23-
axisObj.name = UnityEngineVRModule.ButtonAxisName.Index(i);
24-
axisObj.axis = UnityEngineVRModule.ButtonAxisID.Index(i);
25-
axisObj.invert = axisObj.axis == UnityEngineVRModule.ButtonAxisID.LPadY || axisObj.axis == UnityEngineVRModule.ButtonAxisID.RPadY;
23+
axisObj.name = UnityEngineVRModule.GetUnityAxisNameByIndex(i);
24+
axisObj.axis = UnityEngineVRModule.GetUnityAxisIdByIndex(i) - 1;
2625
BindAxis(axisObj);
2726
}
2827
}

0 commit comments

Comments
 (0)