Skip to content

Commit

Permalink
Improve code
Browse files Browse the repository at this point in the history
  • Loading branch information
shiena committed Aug 2, 2021
1 parent faae128 commit 34c881c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions Runtime/OpenXRRuntimeJson.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ namespace OpenXRRuntimeJsons
{
public static class OpenXRRuntimeJson
{
private static readonly IEnumerable<IOpenXRRuntimeJson> OpenXRRuntimeJsons;
private static readonly IDictionary<OpenXRRuntimeType, string> openXRRuntimeJsons;

static OpenXRRuntimeJson()
{
OpenXRRuntimeJsons = new List<IOpenXRRuntimeJson>
var runtimeJsons = new List<IOpenXRRuntimeJson>
{
new EnvironmentVariableRuntimeJson(),
new SystemDefaultRuntimeJson(),
Expand All @@ -24,13 +24,14 @@ static OpenXRRuntimeJson()
new ViveVRRuntimeJson(),
new VarjoRuntimeJson(),
};
openXRRuntimeJsons = runtimeJsons
.Where(e => !string.IsNullOrWhiteSpace(e.JsonPath.Value))
.ToDictionary(e => e.Name, e => e.JsonPath.Value);
}

public static IDictionary<OpenXRRuntimeType, string> GetRuntimeJsonPaths()
{
return OpenXRRuntimeJsons
.Where(e => !string.IsNullOrWhiteSpace(e.JsonPath.Value))
.ToDictionary(e => e.Name, e => e.JsonPath.Value);
return openXRRuntimeJsons;
}

public static void SetRuntimeJsonPath(string jsonPath)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "com.shiena.openxrruntimejson",
"version": "0.0.1",
"version": "0.0.2",
"displayName": "OpenXR Runtime Selector",
"description": "Runtime Selector for OpenXR",
"unity": "2020.2",
Expand Down

0 comments on commit 34c881c

Please sign in to comment.