Skip to content

Commit b2aee2d

Browse files
author
Pim De Witte
committed
Destroy the game object to avoid multiple creations
1 parent 17d5d0c commit b2aee2d

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

UnityMainThreadDispatcher.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ void Awake() {
6666
if (_instance == null) {
6767
_instance = this;
6868
DontDestroyOnLoad(this.gameObject);
69-
}
69+
} else {
70+
Destroy (this.gameObject);
71+
}
7072
}
7173

7274
void OnDestroy() {

0 commit comments

Comments
 (0)