예제 #1
0
 public void OnEndpointFound(EndpointDetails discoveredEndpoint)
 {
     PlayGamesHelperObject.RunOnGameThread(delegate
     {
         mListener.OnEndpointFound(discoveredEndpoint);
     });
 }
 public void onEndpointFound(string endpointId, AndroidJavaObject endpointInfo)
 {
     mListener.OnEndpointFound(CreateEndPointDetails(endpointId, endpointInfo));
 }
        private static NativeEndpointDiscoveryListenerHelper ToDiscoveryListener(IDiscoveryListener listener)
        {
            listener = (IDiscoveryListener) new NativeNearbyConnectionsClient.OnGameThreadDiscoveryListener(listener);
            NativeEndpointDiscoveryListenerHelper discoveryListenerHelper = new NativeEndpointDiscoveryListenerHelper();

            discoveryListenerHelper.SetOnEndpointFound((Action <long, NativeEndpointDetails>)((localClientId, endpoint) => listener.OnEndpointFound(endpoint.ToDetails())));
            discoveryListenerHelper.SetOnEndpointLostCallback((Action <long, string>)((localClientId, lostEndpointId) => listener.OnEndpointLost(lostEndpointId)));
            return(discoveryListenerHelper);
        }