public static GPMPController GetInstance()
 {
     if (instance == null)
     {
         instance = new GPMPController();
     }
     return(instance);
 }
Esempio 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);
         }
     }
 }
Esempio 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;
    }