Skip to content

Commit f79d339

Browse files
committed
Now able to access initialized SingletonBehaviour.Instance in background thread
1 parent 543af1b commit f79d339

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Assets/HTC.UnityPlugin/Utility/SingletonBehaviour.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ public static T Instance
3232

3333
public static void Initialize()
3434
{
35-
if (!Application.isPlaying || s_isApplicationQuitting) { return; }
36-
3735
lock (s_lock)
3836
{
3937
if (s_instance != null) { return; }
4038

39+
if (!Application.isPlaying || s_isApplicationQuitting) { return; }
40+
4141
var instances = FindObjectsOfType<T>();
4242
if (instances.Length > 0)
4343
{

0 commit comments

Comments
 (0)