BlueGit

blue-star ggj-2020

Files

ggj-2020 / Assets / Oculus / Platform / Scripts / StandalonePlatformSettings.cs

StandalonePlatformSettings.cs

Project Import
timfa Tim Falken · pushed by timfa · 6 years ago
b77834a1 History
StandalonePlatformSettings.cs 1.7 KiB Download Raw
1namespace Oculus.Platform
2{
3
4 // This only exists for the Unity Editor
5 public sealed class StandalonePlatformSettings
6 {
7
8#if UNITY_EDITOR
9 private static string _OculusPlatformTestUserPassword = "";
10
11 private static void ClearOldStoredPassword()
12 {
13 // Ensure that we are not storing the old passwords anywhere on the machine
14 if (UnityEditor.EditorPrefs.HasKey("OculusStandaloneUserPassword"))
15 {
16 UnityEditor.EditorPrefs.SetString("OculusStandaloneUserPassword", "0000");
17 UnityEditor.EditorPrefs.DeleteKey("OculusStandaloneUserPassword");
18 }
19 }
20#endif
21
22 public static string OculusPlatformTestUserEmail
23 {
24 get
25 {
26#if UNITY_EDITOR
27 return UnityEditor.EditorPrefs.GetString("OculusStandaloneUserEmail");
28#else
29 return string.Empty;
30#endif
31 }
32 set
33 {
34#if UNITY_EDITOR
35 UnityEditor.EditorPrefs.SetString("OculusStandaloneUserEmail", value);
36#endif
37 }
38 }
39
40 public static string OculusPlatformTestUserPassword
41 {
42 get
43 {
44#if UNITY_EDITOR
45 ClearOldStoredPassword();
46 return _OculusPlatformTestUserPassword;
47#else
48 return string.Empty;
49#endif
50 }
51 set
52 {
53#if UNITY_EDITOR
54 ClearOldStoredPassword();
55 _OculusPlatformTestUserPassword = value;
56#endif
57 }
58 }
59 public static string OculusPlatformTestUserAccessToken
60 {
61 get
62 {
63#if UNITY_EDITOR
64 return UnityEditor.EditorPrefs.GetString("OculusStandaloneUserAccessToken");
65#else
66 return string.Empty;
67#endif
68 }
69 set
70 {
71#if UNITY_EDITOR
72 UnityEditor.EditorPrefs.SetString("OculusStandaloneUserAccessToken", value);
73#endif
74 }
75 }
76 }
77}