public static void InitializeNearby(Action<INearbyConnectionClient> callback)
        {
            Debug.Log("Calling InitializeNearby!");
            if (sNearbyConnectionClient == null)
            {
#if UNITY_ANDROID && !UNITY_EDITOR
                NearbyConnectionClientFactory.Create(client => {
                    Debug.Log("Nearby Client Created!!");
                    sNearbyConnectionClient = client;
                    if (callback != null) {
                        callback.Invoke(client);
                    }
                    else {
                        Debug.Log("Initialize Nearby callback is null");
                    }
                });
#else
                sNearbyConnectionClient = new DummyNearbyConnectionClient();
                if (callback != null)
                {
                    callback.Invoke(sNearbyConnectionClient);
                }

#endif
            }
            else if (callback != null)
            {
                Debug.Log("Nearby Already initialized: calling callback directly");
                callback.Invoke(sNearbyConnectionClient);
            }
            else
            {
                Debug.Log("Nearby Already initialized");
            }
        }
예제 #2
0
 public static void InitializeNearby(Action <INearbyConnectionClient> callback)
 {
     Debug.Log((object)"Calling InitializeNearby!");
     if (PlayGamesPlatform.sNearbyConnectionClient == null)
     {
         NearbyConnectionClientFactory.Create((Action <INearbyConnectionClient>)(client =>
         {
             Debug.Log((object)"Nearby Client Created!!");
             PlayGamesPlatform.sNearbyConnectionClient = client;
             if (callback != null)
             {
                 callback(client);
             }
             else
             {
                 Debug.Log((object)"Initialize Nearby callback is null");
             }
         }));
     }
     else if (callback != null)
     {
         Debug.Log((object)"Nearby Already initialized: calling callback directly");
         callback(PlayGamesPlatform.sNearbyConnectionClient);
     }
     else
     {
         Debug.Log((object)"Nearby Already initialized");
     }
 }
 public static void InitializeNearby(Action <INearbyConnectionClient> callback)
 {
     Debug.Log((object)"Calling InitializeNearby!");
     if (sNearbyConnectionClient == null)
     {
         NearbyConnectionClientFactory.Create(delegate(INearbyConnectionClient client)
         {
             Debug.Log((object)"Nearby Client Created!!");
             sNearbyConnectionClient = client;
             if (callback != null)
             {
                 callback(client);
             }
             else
             {
                 Debug.Log((object)"Initialize Nearby callback is null");
             }
         });
     }
     else if (callback != null)
     {
         Debug.Log((object)"Nearby Already initialized: calling callback directly");
         callback(sNearbyConnectionClient);
     }
     else
     {
         Debug.Log((object)"Nearby Already initialized");
     }
 }