Esempio n. 1
0
    /// <summary>
    /// Verifica se o controle esta associado ao jogo de qualquer forma
    /// </summary>
    /// <returns><c>true</c> if this instance is joystick assigned to game the specified inputDevice_; otherwise, <c>false</c>.</returns>
    /// <param name="inputDevice_">Input device.</param>
    int IsJoystickAssignedToGame(InputDevice inputDevice_)
    {
        for (int i = 0; i < myInputDevicePlayers.Length; i++)
        {
            if (myInputDevicePlayers[i] != null && myInputDevicePlayers[i].myInputDevice.GetHashCode() == inputDevice_.GetHashCode())
                return i;
        }

        return -1;
    }
Esempio n. 2
0
    /// <summary>
    /// Verifica se o Device esta associado a algum jogador
    /// </summary>
    /// <returns><c>true</c> if this instance is joystick assigned to player the specified inputDevice_; otherwise, <c>false</c>.</returns>
    /// <param name="inputDevice_">Input device.</param>
    int IsJoystickAssignedToPlayer(InputDevice inputDevice_)
    {
        for (int i = 0; i < myPlayerAvatarList.Length; i++)
        {
            if (myPlayerAvatarList[i].gameObject.activeInHierarchy)
            {
                if (myPlayerAvatarList[i].PlayerInputController != null)
                {
                    if (myPlayerAvatarList[i].PlayerInputController.InputDeviceJoystick != null)
                    {
                        if (myPlayerAvatarList[i].PlayerInputController.InputDeviceJoystick.GetHashCode() == inputDevice_.GetHashCode())
							return (int)myPlayerAvatarList[i].PlayerClass;
                    }
                }
            }
        }
        return -1;
    }