LegacyGipGameControllerProvider.IsPilot(User, String) Método
Definición
Importante
Parte de la información hace referencia a la versión preliminar del producto, que puede haberse modificado sustancialmente antes de lanzar la versión definitiva. Microsoft no otorga ninguna garantía, explícita o implícita, con respecto a la información proporcionada aquí.
Recupera el identificador del controlador copiloto si este controlador es un piloto.
public:
static Platform::String ^ IsPilot(User ^ user, Platform::String ^ controllerProviderId);
static winrt::hstring IsPilot(User const& user, winrt::hstring const& controllerProviderId);
public static string IsPilot(User user, string controllerProviderId);
function isPilot(user, controllerProviderId)
Public Shared Function IsPilot (user As User, controllerProviderId As String) As String
Parámetros
- user
- User
Usuario para comprobar el emparejamiento.
- controllerProviderId
-
String
Platform::String
winrt::hstring
Identificador de proveedor para que el controlador compruebe si hay emparejamientos.
Devoluciones
Identificador del controlador copiloto si este controlador es piloto; de lo contrario, null.
Ejemplos
public void CopilotSample(GipGameControllerProvider pilotProvider,
GipGameControllerProvider copilotProvider)
{
// Establish a copilot pairing for the given pilot and copilot providers
string pilotId = GameControllerProviderInfo.GetProviderId(pilotProvider);
string copilotId = GameControllerProviderInfo.GetProviderId(copilotProvider);
User user = User.GetDefault();
LegacyGipGameControllerProvider.PairPilotToCopilot(user, pilotId,
copilotId);
// Read copilot properties
LegacyGipGameControllerProvider.IsPilot(user, pilotId); // Returns copilotId
LegacyGipGameControllerProvider.IsPilot(user, copilotId); // Returns null
LegacyGipGameControllerProvider.IsCopilot(user, pilotId); // Returns null
LegacyGipGameControllerProvider.IsCopilot(user, copilotId); // Returns pilotId
// Removes the pairing for both controllers
LegacyGipGameControllerProvider.ClearPairing(user, pilotId);
// Also removes the pairing for both controllers (unnecessary since the pairing was already removed)
LegacyGipGameControllerProvider.ClearPairing(user, copilotId);
}