Skip to content

Commit 3f434d0

Browse files
committed
EOS Disable Fix
1 parent a176548 commit 3f434d0

File tree

3 files changed

+39
-26
lines changed

3 files changed

+39
-26
lines changed

Assets/Plugins/Source/Editor/EditorWindows/EncryptionKeyWindow.cs

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,16 @@ public EncryptionKeyWindow() : base("Client Credential Encryption Key", 600f, 50
4848
/// </param>
4949
public static void Show(string input, Action<string> onSubmitCallback)
5050
{
51-
ScheduleShow<EncryptionKeyWindow>(
52-
input,
53-
onSubmitCallback,
54-
EOSClientCredentials.IsEncryptionKeyValid,
55-
"Enter the encryption key for these client credentials here:",
56-
"Invalid encryption key. Encryption key must be 64 characters long and contain only alphanumeric characters.");
51+
#if !EOS_DISABLE
52+
ScheduleShow<EncryptionKeyWindow>(
53+
input,
54+
onSubmitCallback,
55+
EOSClientCredentials.IsEncryptionKeyValid,
56+
"Enter the encryption key for these client credentials here:",
57+
"Invalid encryption key. Encryption key must be 64 characters long and contain only alphanumeric characters.");
58+
#else
59+
Debug.LogWarning("EOS SDK is disabled. Encryption key window is not available.");
60+
#endif
5761
}
5862

5963
/// <summary>
@@ -63,16 +67,25 @@ protected override void RenderModalContents()
6367
{
6468
GUILayout.BeginHorizontal();
6569

66-
_input = GUILayout.TextField(_input, GUILayout.Width(GUIEditorUtility.MeasureLabelWidth(64)), GUILayout.Height(20));
70+
_input = GUILayout.TextField(
71+
_input,
72+
GUILayout.Width(EditorStyles.label.CalcSize(new GUIContent("Encryption Key")).x),
73+
GUILayout.Height(20));
6774

6875
GUILayout.Space(5f);
6976

70-
if (GUILayout.Button(
71-
new GUIContent(EditorGUIUtility.IconContent("Refresh").image,
72-
"Click here to generate a new encryption key."), GUILayout.Height(20), GUILayout.Width(50)))
73-
{
74-
_input = EOSClientCredentials.GenerateEncryptionKey();
75-
}
77+
#if !EOS_DISABLE
78+
if (GUILayout.Button(
79+
new GUIContent(EditorGUIUtility.IconContent("Refresh").image,
80+
"Click here to generate a new encryption key."),
81+
GUILayout.Height(20), GUILayout.Width(50)))
82+
{
83+
_input = EOSClientCredentials.GenerateEncryptionKey();
84+
}
85+
#else
86+
GUILayout.Label("EOS SDK is disabled.");
87+
#endif
88+
7689
GUILayout.EndHorizontal();
7790
}
7891
}

Assets/Plugins/Source/Editor/EditorWindows/ModalEOSEditorWindow.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,7 @@ protected override void RenderWindow()
189189
bool shouldClose = false;
190190

191191
// Render the prompt text
192-
EditorGUILayout.LabelField(_inputPrompt, GUILayout.Width(
193-
GUIEditorUtility.MeasureLabelWidth(_inputPrompt))
194-
);
192+
EditorGUILayout.LabelField(_inputPrompt, GUILayout.Width(EditorStyles.label.CalcSize(new GUIContent(_inputPrompt)).x));
195193

196194
// Display error if it needs to be displayed.
197195
if (_showError)

com.playeveryware.eos/Runtime/Core/EOSManager.cs

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -184,17 +184,7 @@ enum EOSState
184184
static private bool s_isConstrained = true;
185185
static public bool ApplicationIsConstrained { get => s_isConstrained; }
186186

187-
/// <summary>
188-
/// Actions that need to be executed on the main thread.
189-
/// Lazy allocated in <see cref="DispatchAsync"/>.
190-
/// </summary>
191-
private static List<Action> s_enqueuedTasks;
192187

193-
/// <summary>
194-
/// Locak object used for <see cref="s_enqueuedTasks"/>, such that it can
195-
/// be executed thread-safe way.
196-
/// </summary>
197-
private static System.Object s_enqueuedTasksLock = new System.Object();
198188
//private static List
199189

200190
//-------------------------------------------------------------------------
@@ -1844,6 +1834,18 @@ static public EOSSingleton Instance
18441834
}
18451835
}
18461836

1837+
/// <summary>
1838+
/// Actions that need to be executed on the main thread.
1839+
/// Lazy allocated in <see cref="DispatchAsync"/>.
1840+
/// </summary>
1841+
private static List<Action> s_enqueuedTasks;
1842+
1843+
/// <summary>
1844+
/// Locak object used for <see cref="s_enqueuedTasks"/>, such that it can
1845+
/// be executed thread-safe way.
1846+
/// </summary>
1847+
private static System.Object s_enqueuedTasksLock = new System.Object();
1848+
18471849
#if !EOS_DISABLE
18481850
//-------------------------------------------------------------------------
18491851
/// <summary>Unity [Awake](https://docs.unity3d.com/ScriptReference/MonoBehaviour.Awake.html) is called when script instance is being loaded.

0 commit comments

Comments
 (0)