public static GPMPController GetInstance()
 {
     if (instance == null)
     {
         instance = new GPMPController();
     }
     return(instance);
 }
Exemplo n.º 2
0
 void Update()
 {
     if (matchStarted)
     {
         //DebugMP.Log("Last acknowledgement from opponent was " + matchTimeOutCounter + " seconds ago.");
         matchTimeOutCounter += Time.deltaTime;
         if (matchTimeOutCounter >= matchTimeOut)
         {
             GPMPController.GetInstance().OnParticipantLeft(null);
         }
     }
 }
Exemplo n.º 3
0
    /// <summary>
    /// Initializes Google Play Service
    /// </summary>
    public void Init()
    {
        // Enables saving game progress.
        config = new PlayGamesClientConfiguration.Builder()
                 .EnableSavedGames()
                 .WithInvitationDelegate(GPMPController.GetInstance().OnInvitationReceived)
                 .Build();
        PlayGamesPlatform.InitializeInstance(config);

        PlayGamesPlatform.DebugLogEnabled = true;

        // Set Google Play Service as Social platform
        PlayGamesPlatform.Activate();

        isInitialized = true;
    }