googleanalytics / google-analytics-plugin-for-unity

Google Analytics plugin for the Unity game creation system

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Missing handling for duplicate GAv4 instances

AdriaandeJongh opened this issue · comments

Hey there!

It would be more than convenient to add the following code to the top of the Awake() function in the GoogleAnalyticsV4 class, to avoid duplicate instances of the Google Analytics GameObject:

if(instance != null && instance != this)
{
    Destroy(this.gameObject);
    return;
}