Skip to content

Commit d9f3191

Browse files
author
lawwong
committed
Avoid refering PlayerSettings.productGUID in static contructor
1 parent dcbdfa5 commit d9f3191

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

Assets/HTC.UnityPlugin/ViveInputUtility/Scripts/Editor/VIUVersionCheck.cs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ public void DeleteIgnore()
104104
public const double versionCheckIntervalMinutes = 60.0;
105105

106106
// On Windows, PlaterSetting is stored at \HKEY_CURRENT_USER\Software\Unity Technologies\Unity Editor 5.x
107-
private static readonly string editorPrefsPrefix = "ViveInputUtility." + PlayerSettings.productGUID + ".";
108-
private static readonly string nextVersionCheckTimeKey = editorPrefsPrefix + "LastVersionCheckTime";
109-
private static readonly string fmtIgnoreUpdateKey = editorPrefsPrefix + "DoNotShowUpdate.v{0}";
107+
private static string editorPrefsPrefix;
108+
private static string nextVersionCheckTimeKey;
109+
private static string fmtIgnoreUpdateKey;
110110
private static string ignoreThisVersionKey;
111111

112112
private const string BIND_UI_SWITCH_TOOLTIP = "When enabled, pressing RightShift + B to open the binding interface in play mode.";
@@ -296,6 +296,13 @@ static VIUVersionCheck()
296296
// check vive input utility version on github
297297
private static void CheckVersionAndSettings()
298298
{
299+
if (string.IsNullOrEmpty(editorPrefsPrefix))
300+
{
301+
editorPrefsPrefix = "ViveInputUtility." + PlayerSettings.productGUID + ".";
302+
nextVersionCheckTimeKey = editorPrefsPrefix + "LastVersionCheckTime";
303+
fmtIgnoreUpdateKey = editorPrefsPrefix + "DoNotShowUpdate.v{0}";
304+
}
305+
299306
// fetch new version info from github release site
300307
if (!completeCheckVersionFlow)
301308
{

0 commit comments

Comments
 (0)