Skip to content
This repository was archived by the owner on Feb 19, 2020. It is now read-only.

Commit 8aedf13

Browse files
author
Benjamin Scholtysik (Reimold)
authored
Merge pull request #27 from KojiNakamaru/fix/initialization
Fix/initialization
2 parents 28b3797 + 8c4c97f commit 8aedf13

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Plugin/HockeyAppUnityIOS/HockeyAppUnity-Scripts/HockeyAppIOS.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ public class HockeyAppIOS : MonoBehaviour
1212
protected const string HOCKEYAPP_CRASHESPATH = "api/2/apps/[APPID]/crashes/upload";
1313
protected const string LOG_FILE_DIR = "/logs/";
1414
protected const int MAX_CHARS = 199800;
15+
private static HockeyAppIOS instance;
1516

1617
public enum AuthenticatorType
1718
{
@@ -63,6 +64,12 @@ void Awake ()
6364
{
6465

6566
#if (UNITY_IPHONE && !UNITY_EDITOR)
67+
if (instance != null) {
68+
Destroy(gameObject);
69+
return;
70+
}
71+
instance = this;
72+
6673
DontDestroyOnLoad(gameObject);
6774
CreateLogDirectory();
6875

@@ -73,6 +80,7 @@ void Awake ()
7380
StartCoroutine(SendLogs(logFileDirs));
7481
}
7582
}
83+
StartHockeyManager();
7684
#endif
7785
}
7886

@@ -97,6 +105,10 @@ void OnDisable ()
97105
}
98106

99107
void GameViewLoaded (string message)
108+
{
109+
}
110+
111+
void StartHockeyManager ()
100112
{
101113
#if (UNITY_IPHONE && !UNITY_EDITOR)
102114
string urlString = GetBaseURL();

0 commit comments

Comments
 (0)