Hello I am facing problem when sending event.
Player auth is successful. But i can not send event
PlayGamesPlatform.Instance.Events.IncrementEvent gives error…
NullReferenceException: Object reference not set to an instance of an object
Why is the null PlayGamesPlatform variable?
version GooglePlayGamesPlugin-0.9.50
Unity 2017.3.1f1
void Start () {
// Create client configuration
PlayGamesClientConfiguration config = new
PlayGamesClientConfiguration.Builder()
.Build();
// Enable debugging output (recommended)
PlayGamesPlatform.DebugLogEnabled = true;
// Initialize and activate the platform
PlayGamesPlatform.InitializeInstance(config);
PlayGamesPlatform.Activate();
SignIn();
PlayGamesPlatform.Instance.Events.IncrementEvent(GPGSIds.event_openedxtimes, 1);
}
Also I tried this:
private static readonly PlayGamesClientConfiguration config = new
PlayGamesClientConfiguration.Builder()
.Build();
void Start () {
// Enable debugging output (recommended)
PlayGamesPlatform.DebugLogEnabled = true;
// Initialize and activate the platform
PlayGamesPlatform.InitializeInstance(config);
PlayGamesPlatform.Activate();
SignIn();
PlayGamesPlatform.Instance.Events.IncrementEvent(GPGSIds.event_openedxtimes, 1);
}
Regards.