Skip to content

Commit 5fb6319

Browse files
author
ChengNan Yang
committed
Fix apply action set button not working properly with SteamVR Plugin v2.4.5
1 parent 1c8ebf7 commit 5fb6319

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,24 @@ public SteamVRSymbolRequirementCollection()
133133
}
134134
},
135135
});
136+
137+
Add(new SymbolRequirement()
138+
{
139+
symbol = "VIU_STEAMVR_2_4_0_OR_NEWER",
140+
reqMethods = new SymbolRequirement.ReqMethodInfo[]
141+
{
142+
new SymbolRequirement.ReqMethodInfo()
143+
{
144+
typeName = "Valve.VR.SteamVR_Input",
145+
name = "GetActionsFilePath",
146+
argTypeNames = new string[]
147+
{
148+
"System.Boolean",
149+
},
150+
bindingAttr = BindingFlags.Public | BindingFlags.Static,
151+
}
152+
},
153+
});
136154
}
137155
}
138156
}

Assets/HTC.UnityPlugin/ViveInputUtility/Scripts/Editor/VRPlatformSettings/OpenVRSettings.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@ private string exampleDirPath
4141

4242
public RecommendedSteamVRInputFileSettings()
4343
{
44+
#if VIU_STEAMVR_2_4_0_OR_NEWER
45+
m_mainDirPath = Path.GetDirectoryName(SteamVR_Input.GetActionsFilePath());
46+
#else
4447
m_mainDirPath = Path.GetFullPath(Application.dataPath + "/../");
48+
#endif
4549
m_partialDirPath = VIUProjectSettings.partialActionDirPath;
4650
m_partialFileName = VIUProjectSettings.partialActionFileName;
4751

@@ -77,6 +81,11 @@ private void Merge(bool value)
7781
{
7882
if (!value) { return; }
7983

84+
if (!Directory.Exists(m_mainDirPath))
85+
{
86+
Directory.CreateDirectory(m_mainDirPath);
87+
}
88+
8089
VIUSteamVRActionFile mainFile;
8190
VIUSteamVRActionFile exampleFile;
8291
VIUSteamVRActionFile partialFile;

Assets/HTC.UnityPlugin/ViveInputUtility/Scripts/Misc/SteamVRExtension/Editor/VIUSteamVRLoadJsonFileBase.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ public void Save(string dirPath)
8585

8686
var json = JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
8787
File.WriteAllText(Path.Combine(dirPath, fileName), json);
88-
8988
}
9089
catch (Exception e)
9190
{

0 commit comments

Comments
 (0)