void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } DontDestroyOnLoad(gameObject); }
private void Awake() { instance = this; PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder() // enables saving game progress. .EnableSavedGames() .Build(); PlayGamesPlatform.InitializeInstance(config); PlayGamesPlatform.Activate(); PlayGamesPlatform.DebugLogEnabled = true; ConnectToGooglePlayGames(); }