Skip to content

Commit 487ac8d

Browse files
committed
Merge branch 'development' into feat/more-unit-tests
2 parents 076a81f + 6adade2 commit 487ac8d

File tree

3 files changed

+15
-14
lines changed

3 files changed

+15
-14
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -290,18 +290,18 @@ private async Task EnsureConfigFileExistsAsync()
290290
{
291291
bool fileExists = await FileSystemUtility.FileExistsAsync(FilePath);
292292

293-
#if UNITY_EDITOR
294293
if (!fileExists)
295294
{
295+
#if UNITY_EDITOR
296296
await WriteAsync();
297-
}
298297
#else
299-
// If the editor is not running, then the config file not
300-
// existing should throw an error.
301-
throw new FileNotFoundException(
298+
// If the editor is not running, then the config file not
299+
// existing should throw an error.
300+
throw new FileNotFoundException(
302301
$"Config file \"{FilePath}\" does not exist.");
303302
#endif
304-
}
303+
}
304+
}
305305

306306
// Functions declared below should only ever be utilized in the editor.
307307
// They are so divided to guarantee separation of concerns.

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,12 @@ public delegate void OnAuthLinkExternalAccountCallback(
136136
private static Dictionary<LogCategory, LogLevel> logLevels;
137137

138138
/// <summary>
139-
/// Boolean indicator of whether an EOSManager has already been created.
140-
/// This prevents having multiple EOSManagers doing extra work.
141-
/// Note: This does not track if you delete the object.
142-
/// It is presumed that EOSManager will have DontDestroyOnLoad marked on it, during Awake.
139+
/// A pointer to the active EOSManager instance.
140+
/// This is set when a EOSManager runs Awake, and this value is null.
141+
/// This value may be "null" if the EOSManager has its game object destroyed,
142+
/// for example between automated tests.
143143
/// </summary>
144-
private static bool s_EOSManagerHasBeenCreated = false;
144+
private static EOSManager s_EOSManagerInstance = null;
145145

146146
enum EOSState
147147
{
@@ -1809,15 +1809,15 @@ void Awake()
18091809
{
18101810
// If there's already been an EOSManager,
18111811
// disable this behaviour so that it doesn't fire Unity messages
1812-
if (s_EOSManagerHasBeenCreated)
1812+
if (s_EOSManagerInstance != null)
18131813
{
18141814
EOSSingleton.print($"{nameof(EOSManager)} {(nameof(Awake))}: An EOSManager instance already exists and is running, so this behaviour is marking as inactive to not perform duplicate work.");
18151815
enabled = false;
18161816
return;
18171817
}
18181818

18191819
// Indicate that a EOSManager has been created, and mark it to not be destroyed
1820-
s_EOSManagerHasBeenCreated = true;
1820+
s_EOSManagerInstance = this;
18211821
DontDestroyOnLoad(this.gameObject);
18221822

18231823
#if UNITY_PS5 && !UNITY_EDITOR

com.playeveryware.eos/Runtime/Core/Utility/FileSystemUtility.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,7 @@ await Task.Run(() =>
413413
}
414414
}
415415

416+
#if UNITY_EDITOR
416417
/// <summary>
417418
/// Returns the root of the Unity project.
418419
/// </summary>
@@ -433,7 +434,7 @@ public static string GetProjectPath()
433434
throw new DirectoryNotFoundException("Unable to locate the Assets folder from the current directory.");
434435
}
435436

436-
#if UNITY_EDITOR
437+
437438
#region Line Ending Manipulations
438439

439440
public static void ConvertDosToUnixLineEndings(string filename)

0 commit comments

Comments
 (0)