• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# OuyaSDK类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中OuyaSDK的典型用法代码示例。如果您正苦于以下问题:C# OuyaSDK类的具体用法?C# OuyaSDK怎么用?C# OuyaSDK使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



OuyaSDK类属于命名空间,在下文中一共展示了OuyaSDK类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: GetAxis

 public static float GetAxis(string ouyaMapping, OuyaSDK.OuyaPlayer player)
 {
     switch (ouyaMapping)
     {
         case "LB":
             return GetAxis(OuyaSDK.KeyEnum.BUTTON_LB, player);
         case "LT":
             return GetAxis(OuyaSDK.KeyEnum.BUTTON_LT, player);
         case "LX":
             return GetAxis(OuyaSDK.KeyEnum.AXIS_LSTICK_X, player);
         case "LY":
             return GetAxis(OuyaSDK.KeyEnum.AXIS_LSTICK_Y, player);
         case "RB":
             return GetAxis(OuyaSDK.KeyEnum.BUTTON_RB, player);
         case "RT":
             return GetAxis(OuyaSDK.KeyEnum.BUTTON_RT, player);
         case "RX":
             return GetAxis(OuyaSDK.KeyEnum.AXIS_RSTICK_X, player);
         case "RY":
             return GetAxis(OuyaSDK.KeyEnum.AXIS_RSTICK_Y, player);
         case "DL":
             return GetAxis(OuyaSDK.KeyEnum.BUTTON_DPAD_LEFT, player);
         case "DR":
             return GetAxis(OuyaSDK.KeyEnum.BUTTON_DPAD_RIGHT, player);
         case "DU":
             return GetAxis(OuyaSDK.KeyEnum.BUTTON_DPAD_UP, player);
         case "DD":
             return GetAxis(OuyaSDK.KeyEnum.BUTTON_DPAD_DOWN, player);
         default:
             return 0f;
     }
 }
开发者ID:hassanLastborn,项目名称:Tether,代码行数:32,代码来源:OuyaExampleCommon.cs


示例2: HandleButtonEvents

    private void HandleButtonEvents(OuyaSDK.OuyaPlayer p, OuyaSDK.KeyEnum b, OuyaSDK.InputAction bs)
    {
        if (enabled && NGUITools.GetActive(gameObject))
        {
            // Ignoring P to allow any player to use the menu
            if (bs.Equals(OuyaSDK.InputAction.KeyDown))
            {
                switch (b)
                {
                    case OuyaSDK.KeyEnum.BUTTON_DPAD_UP:
                        OnKey(KeyCode.UpArrow);
                        break;
                    case OuyaSDK.KeyEnum.BUTTON_DPAD_DOWN:
                        OnKey(KeyCode.DownArrow);
                        break;
                    case OuyaSDK.KeyEnum.BUTTON_DPAD_LEFT:
                        OnKey(KeyCode.LeftArrow);
                        break;
                    case OuyaSDK.KeyEnum.BUTTON_DPAD_RIGHT:
                        OnKey(KeyCode.RightArrow);
                        break;
                }
            }

            if (b == activateButton && gameObject == UICamera.selectedObject)
            {
                SendMessage("OnPress", bs.Equals(OuyaSDK.InputAction.KeyDown), SendMessageOptions.DontRequireReceiver);
            }
        }
    }
开发者ID:danielkinjerski,项目名称:Jump_Switch,代码行数:30,代码来源:OuyaUIButtonKeys.cs


示例3: CommonGetKeyString

 protected string CommonGetKeyString(int buttonNum, OuyaSDK.OuyaPlayer player)
 {
     switch (player)
     {
         case OuyaSDK.OuyaPlayer.none:
             return string.Format("JoystickButton{0}", buttonNum);
         default:
             return string.Format("Joystick{0}Button{1}", ((int)player), buttonNum);
     }
 }
开发者ID:BattleJenkins,项目名称:ouya-sdk-examples,代码行数:10,代码来源:OuyaControllerCommon.cs


示例4: CommonGetUnityKeyCode

 protected KeyCode CommonGetUnityKeyCode(int buttonNum, OuyaSDK.OuyaPlayer player)
 {
     string keyCode = CommonGetKeyString(buttonNum, player);
     if (string.IsNullOrEmpty(keyCode))
     {
         return (KeyCode)(-1);
     }
     OuyaKeyCode key = (OuyaKeyCode)Enum.Parse(typeof(OuyaKeyCode), keyCode);
     return (KeyCode)(int)key;
 }
开发者ID:BattleJenkins,项目名称:ouya-sdk-examples,代码行数:10,代码来源:OuyaControllerCommon.cs


示例5: HasKeyCode

 protected bool HasKeyCode(OuyaSDK.KeyEnum[] supportedCodes, OuyaSDK.KeyEnum keyCode)
 {
     foreach (OuyaSDK.KeyEnum item in supportedCodes)
     {
         if (item == keyCode)
         {
             return true;
         }
     }
     return false;
 }
开发者ID:BattleJenkins,项目名称:ouya-sdk-examples,代码行数:11,代码来源:OuyaControllerCommon.cs


示例6: GetAxisRaw

 public static float GetAxisRaw(OuyaSDK.KeyEnum keyCode, OuyaSDK.OuyaPlayer player)
 {
     if (OuyaSDK.m_EnableUnityInput)
     {
         return GetAxisWithDelegate(keyCode, player, Input.GetAxisRaw);
     }
     else
     {
         return 0f;
     }
 }
开发者ID:joaokucera,项目名称:ouya-unity-plugin,代码行数:11,代码来源:OuyaExampleCommon.cs


示例7: GetAxis

    /// <summary>
    /// Wrap Unity's method
    /// </summary>
    /// <param name="inputName"></param>
    /// <returns></returns>
    public static float GetAxis(string inputName, OuyaSDK.OuyaPlayer player)
    {
        #if !UNITY_EDITOR && !UNITY_STANDALONE_OSX && !UNITY_STANDALONE_WIN && !UNITY_STANDALONE_LINUX
        switch (inputName)
        {
            case "LT":
                return OuyaInputManager.getPlayerKeyState(player).m_axisLeftTrigger;
            case "RT":
                return OuyaInputManager.getPlayerKeyState(player).m_axisRightTrigger;
            case "RX":
                return OuyaInputManager.getPlayerKeyState(player).m_axisRightStickX;
            case "RY":
                return OuyaInputManager.getPlayerKeyState(player).m_axisRightStickY;
            case "LX":
                return OuyaInputManager.getPlayerKeyState(player).m_axisLeftStickX;
            case "LY":
                return -OuyaInputManager.getPlayerKeyState(player).m_axisLeftStickY;
        }
        return 0f;
        #else
        string axisName = string.Empty;
        int invertFactor = GetInvertedFactor(GetControllerType(player), inputName);
        switch (inputName)
        {
            case "LT":
                axisName = OuyaInputManager.GetInput(player, AxisTypes.Horizontal, AnalogTypes.LTRT);
                break;
            case "RT":
                axisName = OuyaInputManager.GetInput(player, AxisTypes.Vertical, AnalogTypes.LTRT);
                break;
            case "RX":
                axisName = OuyaInputManager.GetInput(player, AxisTypes.Horizontal, AnalogTypes.Right);
                break;
            case "RY":
                axisName = OuyaInputManager.GetInput(player, AxisTypes.Vertical, AnalogTypes.Right);
                break;
            case "LX":
                axisName = OuyaInputManager.GetInput(player, AxisTypes.Horizontal, AnalogTypes.Left);
                break;
            case "LY":
                axisName = OuyaInputManager.GetInput(player, AxisTypes.Vertical, AnalogTypes.Left);
                break;
        }
        if (!string.IsNullOrEmpty(axisName))
        {
            return invertFactor * Input.GetAxis(axisName);
        }
        return 0f;

        #endif
    }
开发者ID:danielkinjerski,项目名称:Jump_Switch,代码行数:56,代码来源:OuyaInputManager.cs


示例8: GetAxis

    public static float GetAxis(OuyaSDK.KeyEnum keyCode)
    {
        float axisValue = 0f;
        axisValue = GreaterValue(axisValue, SuperInputMapper.GetAxis(keyCode, OuyaSDK.OuyaPlayer.player1) );
        axisValue = GreaterValue(axisValue, SuperInputMapper.GetAxis(keyCode, OuyaSDK.OuyaPlayer.player2) );
        axisValue = GreaterValue(axisValue, SuperInputMapper.GetAxis(keyCode, OuyaSDK.OuyaPlayer.player3) );
        axisValue = GreaterValue(axisValue, SuperInputMapper.GetAxis(keyCode, OuyaSDK.OuyaPlayer.player4) );
        axisValue = GreaterValue(axisValue, SuperInputMapper.GetAxis(keyCode, OuyaSDK.OuyaPlayer.player5) );
        axisValue = GreaterValue(axisValue, SuperInputMapper.GetAxis(keyCode, OuyaSDK.OuyaPlayer.player6) );
        axisValue = GreaterValue(axisValue, SuperInputMapper.GetAxis(keyCode, OuyaSDK.OuyaPlayer.player7) );
        axisValue = GreaterValue(axisValue, SuperInputMapper.GetAxis(keyCode, OuyaSDK.OuyaPlayer.player8) );
        axisValue = GreaterValue(axisValue, SuperInputMapper.GetAxis(keyCode, OuyaSDK.OuyaPlayer.player9) );
        axisValue = GreaterValue(axisValue, SuperInputMapper.GetAxis(keyCode, OuyaSDK.OuyaPlayer.player10) );
        axisValue = GreaterValue(axisValue, SuperInputMapper.GetAxis(keyCode, OuyaSDK.OuyaPlayer.player11) );

        return axisValue;
    }
开发者ID:hiyijia,项目名称:InControl,代码行数:17,代码来源:SuperInputManager.cs


示例9: GetAxisInverted

 public bool GetAxisInverted(OuyaSDK.KeyEnum keyCode)
 {
     #if !UNITY_EDITOR && UNITY_ANDROID
     switch (keyCode)
     {
         case OuyaSDK.KeyEnum.AXIS_LSTICK_X:
             return false;
         case OuyaSDK.KeyEnum.AXIS_LSTICK_Y:
             return false;
         case OuyaSDK.KeyEnum.AXIS_RSTICK_X:
             return false;
         case OuyaSDK.KeyEnum.AXIS_RSTICK_Y:
             return false;
         case OuyaSDK.KeyEnum.BUTTON_LT:
             return false;
         case OuyaSDK.KeyEnum.BUTTON_RT:
             return false;
         default:
             return false;
     }
     #else
     switch (keyCode)
     {
         case OuyaSDK.KeyEnum.AXIS_LSTICK_X:
             return false;
         case OuyaSDK.KeyEnum.AXIS_LSTICK_Y:
             return true;
         case OuyaSDK.KeyEnum.AXIS_RSTICK_X:
             return true;
         case OuyaSDK.KeyEnum.AXIS_RSTICK_Y:
             return false;
         case OuyaSDK.KeyEnum.BUTTON_LT:
             return false;
         case OuyaSDK.KeyEnum.BUTTON_RT:
             return false;
         default:
             return false;
     }
     #endif
 }
开发者ID:JhonH3avy,项目名称:ouya-sdk-examples,代码行数:40,代码来源:PS2Controller.cs


示例10: GetButton

    /// <summary>
    /// Wrap Unity's method
    /// </summary>
    /// <param name="inputName"></param>
    /// <returns></returns>
    public static bool GetButton(string inputName, OuyaSDK.OuyaPlayer player)
    {
        switch (inputName)
        {
            case "SYS": //arbitrary name and mapping
                return OuyaInputManager.getPlayerKeyState(player).m_buttonSystem;
            case "DPC": //arbitrary name and mapping
                return OuyaInputManager.getPlayerKeyState(player).m_buttonDPadCenter;
            case "DPD": //arbitrary name and mapping
                return OuyaInputManager.getPlayerKeyState(player).m_buttonDPadDown;
            case "DPL": //arbitrary name and mapping
                return OuyaInputManager.getPlayerKeyState(player).m_buttonDPadLeft;
            case "DPR": //arbitrary name and mapping
                return OuyaInputManager.getPlayerKeyState(player).m_buttonDPadRight;
            case "DPU": //arbitrary name and mapping
                return OuyaInputManager.getPlayerKeyState(player).m_buttonDPadUp;
            case "O": //arbitrary name and mapping
                return OuyaInputManager.getPlayerKeyState(player).m_buttonO;
            case "U": //arbitrary name and mapping
                return OuyaInputManager.getPlayerKeyState(player).m_buttonU;
            case "Y": //arbitrary name and mapping
                return OuyaInputManager.getPlayerKeyState(player).m_buttonY;
            case "A": //arbitrary name and mapping
                return OuyaInputManager.getPlayerKeyState(player).m_buttonA;
            case "LT": //arbitrary name and mapping
                return OuyaInputManager.getPlayerKeyState(player).m_buttonLT;
            case "RT": //arbitrary name and mapping
                return OuyaInputManager.getPlayerKeyState(player).m_buttonRT;
            case "LB": //arbitrary name and mapping
                return OuyaInputManager.getPlayerKeyState(player).m_buttonLB;
            case "RB": //arbitrary name and mapping
                return OuyaInputManager.getPlayerKeyState(player).m_buttonRB;
            case "L3":
                return OuyaInputManager.getPlayerKeyState(player).m_buttonL3;
            case "R3":
                return OuyaInputManager.getPlayerKeyState(player).m_buttonR3;
        }

        return false;
    }
开发者ID:danielkinjerski,项目名称:Jump_Switch,代码行数:45,代码来源:OuyaInputManager.cs


示例11: InvokeOuyaPurchaseOnSuccess

 public void InvokeOuyaPurchaseOnSuccess(OuyaSDK.Product product)
 {
     foreach (OuyaSDK.IPurchaseListener listener in OuyaSDK.getPurchaseListeners())
     {
         if (null != listener)
         {
             listener.OuyaPurchaseOnSuccess(product);
         }
     }
 }
开发者ID:Glavin001,项目名称:HalKart,代码行数:10,代码来源:OuyaGameObject.cs


示例12: CheckInput

    /// <summary>
    /// This needs to be setup for each joystick type being supported.  I have not setup the USB controller or the I:Droid:CON  
    /// For the most part you won't need to modify this section.
    /// </summary>
    /// <param name="player"></param>
    /// <param name="axis"></param>
    /// <param name="joystick"></param>
    /// <param name="atype"></param>
    /// <returns></returns>
    private static string CheckInput(OuyaSDK.OuyaPlayer player, AxisTypes axis, JoystickType joystick, AnalogTypes atype)
    {
        //Debug.Log(string.Format("Player:{0} Axis:{1} Joystick:{2} AnalogType:{3}",player,axis,joystick,atype));
        //REF: player1, DPadH, PS3, Dpad

        //Note:  It is your responsibility to make sure that  Unity Inputs are setup correctly or you will get an error on your controller.

        int axisNumber=0;

        switch (joystick)
        {
            case JoystickType.ps3:
                //Get The Joystick name from  Project Settings --> Input for Controllers
                #region PS3 Controller
                if (atype.Equals(AnalogTypes.Left))
                {
                    ControllerType cType = OuyaControllerMapping.getController("ps3");
                    if (axis.Equals(AxisTypes.Horizontal)) { axisNumber = cType.leftAnalogH; } else { axisNumber = cType.leftAnalogV; }
                    return "Joy" + (int)player + " Axis " + axisNumber.ToString();
                }
                else if (atype.Equals(AnalogTypes.Right))
                {
                    ControllerType cType = OuyaControllerMapping.getController("ps3");
                    if (axis.Equals(AxisTypes.Horizontal)) { axisNumber = cType.rightAnalogH; } else { axisNumber = cType.rightAnalogV; }
                    return "Joy" + (int)player + " Axis " + axisNumber.ToString();
                }
                else if (atype.Equals(AnalogTypes.DPad))
                {
                    ControllerType cType = OuyaControllerMapping.getController("ps3");
                    if (axis.Equals(AxisTypes.DPadH)) { axisNumber = cType.dpadH; } else { axisNumber = cType.dpadV; }
                    return "Joy" + (int)player + " Axis " + axisNumber.ToString();
                }
                #endregion
                break;

            case JoystickType.xbox:
                #region xbox ( usually 360 / untested with normal xbox )
                if (atype.Equals(AnalogTypes.Left))
                {
                    ControllerType cType = OuyaControllerMapping.getController("xbox360");
                    if (axis.Equals(AxisTypes.Horizontal)) { axisNumber = cType.leftAnalogH; } else { axisNumber = cType.leftAnalogV; }
                    return "Joy" + (int)player + " Axis " + axisNumber.ToString();
                }
                else if (atype.Equals(AnalogTypes.Right))
                {
                    ControllerType cType = OuyaControllerMapping.getController("xbox360");
                    if (axis.Equals(AxisTypes.Horizontal)) { axisNumber = cType.rightAnalogH; } else { axisNumber = cType.rightAnalogV; }
                    return "Joy" + (int)player + " Axis " + axisNumber.ToString();
                }
                else if (atype.Equals(AnalogTypes.DPad))
                {
                    ControllerType cType = OuyaControllerMapping.getController("xbox360");
                    if (axis.Equals(AxisTypes.DPadH)) { axisNumber = cType.dpadH; } else { axisNumber = cType.dpadV; }
                    return "Joy" + (int)player + " Axis " + axisNumber.ToString();
                }
                else if (atype.Equals(AnalogTypes.LTRT))
                {
                    ControllerType cType = OuyaControllerMapping.getController("xbox360");
                    axisNumber = cType.triggers;
                    return "Joy" + (int)player + " Axis " + axisNumber.ToString();
                }
                #endregion
                break;

            case JoystickType.ouya:
                #region OUYA - Not Tested until I get a bluetooth dongle
                if (atype.Equals(AnalogTypes.Left))
                {
                    ControllerType cType = OuyaControllerMapping.getController("ouya");
                    if (axis.Equals(AxisTypes.Horizontal)) { axisNumber = cType.leftAnalogH; } else { axisNumber = cType.leftAnalogV; }
                    return "Joy" + (int)player + " Axis " + axisNumber.ToString();
                }
                else if (atype.Equals(AnalogTypes.Right))
                {
                    ControllerType cType = OuyaControllerMapping.getController("ouya");
                    if (axis.Equals(AxisTypes.Horizontal)) { axisNumber = cType.rightAnalogH; } else { axisNumber = cType.rightAnalogV; }
                    return "Joy" + (int)player + " Axis " + axisNumber.ToString();
                }
                else if (atype.Equals(AnalogTypes.DPad))
                {
                    ControllerType cType = OuyaControllerMapping.getController("ouya");
                    if (axis.Equals(AxisTypes.DPadH)) { axisNumber = cType.dpadH; } else { axisNumber = cType.dpadV; }
                    return "Joy" + (int)player + " Axis " + axisNumber.ToString();
                }
                #endregion
                break;
        }

        //most likely we will never reach here, but If we do Return basic Horizontal Axis
        return "Horizontal";
    }
开发者ID:danielkinjerski,项目名称:Jump_Switch,代码行数:100,代码来源:OuyaInputManager.cs


示例13: buttonPressEvent

 //Call this event ( trigger )
 public static void buttonPressEvent(OuyaSDK.OuyaPlayer player, OuyaSDK.KeyEnum button, OuyaSDK.InputAction buttonState)
 {
     if (ButtonsEvent != null)
     {
         ButtonsEvent(player, button, buttonState);
     }
 }
开发者ID:danielkinjerski,项目名称:Jump_Switch,代码行数:8,代码来源:OuyaInputManager.cs


示例14: GetButtonDown

 public static bool GetButtonDown(OuyaSDK.KeyEnum keyCode, OuyaSDK.OuyaPlayer player)
 {
     return GetButtonWithDelegate(keyCode, player, Input.GetKeyDown);
 }
开发者ID:BattleJenkins,项目名称:ouya-sdk-examples,代码行数:4,代码来源:OuyaExampleCommon.cs


示例15: SetButton

    public static void SetButton(string inputName, OuyaSDK.OuyaPlayer player, bool state)
    {
        switch (inputName)
        {
            case "SYS": //arbitrary name and mapping
                OuyaInputManager.getPlayerKeyState(player).m_buttonSystem = state;
                break;
            case "DPC": //arbitrary name and mapping
                OuyaInputManager.getPlayerKeyState(player).m_buttonDPadCenter = state;
                break;
            case "DPD": //arbitrary name and mapping
                OuyaInputManager.getPlayerKeyState(player).m_buttonDPadDown = state;
                break;
            case "DPL": //arbitrary name and mapping
                OuyaInputManager.getPlayerKeyState(player).m_buttonDPadLeft = state;
                break;
            case "DPR": //arbitrary name and mapping
                OuyaInputManager.getPlayerKeyState(player).m_buttonDPadRight = state;
                break;
            case "DPU": //arbitrary name and mapping
                OuyaInputManager.getPlayerKeyState(player).m_buttonDPadUp = state;
                break;
            case "O": //arbitrary name and mapping
                OuyaInputManager.getPlayerKeyState(player).m_buttonO = state;
                break;
            case "U": //arbitrary name and mapping
                OuyaInputManager.getPlayerKeyState(player).m_buttonU = state;
                break;
            case "Y": //arbitrary name and mapping
                OuyaInputManager.getPlayerKeyState(player).m_buttonY = state;
                break;
            case "A": //arbitrary name and mapping
                OuyaInputManager.getPlayerKeyState(player).m_buttonA = state;
                break;
            case "LT": //arbitrary name and mapping
                OuyaInputManager.getPlayerKeyState(player).m_buttonLT = state;
                break;
            case "RT": //arbitrary name and mapping
                OuyaInputManager.getPlayerKeyState(player).m_buttonRT = state;
                break;
            case "LB": //arbitrary name and mapping
                OuyaInputManager.getPlayerKeyState(player).m_buttonLB = state;
                break;
            case "RB": //arbitrary name and mapping
                OuyaInputManager.getPlayerKeyState(player).m_buttonRB = state;
                break;
            case "L3": //arbitrary name and mapping
                OuyaInputManager.getPlayerKeyState(player).m_buttonL3 = state;
                break;
            case "R3": //arbitrary name and mapping
                OuyaInputManager.getPlayerKeyState(player).m_buttonR3 = state;
                break;

        }
    }
开发者ID:danielkinjerski,项目名称:Jump_Switch,代码行数:55,代码来源:OuyaInputManager.cs


示例16: GetButton

 public static bool GetButton(int buttonNum, OuyaSDK.OuyaPlayer player)
 {
     string keyCode = GetKeyCode(buttonNum, player);
     if (string.IsNullOrEmpty(keyCode))
     {
         return false;
     }
     OuyaKeyCode key = (OuyaKeyCode)Enum.Parse(typeof(OuyaKeyCode), keyCode);
     return Input.GetKey((KeyCode)(int)key);
 }
开发者ID:hassanLastborn,项目名称:Tether,代码行数:10,代码来源:OuyaExampleCommon.cs


示例17: GetInput

    /// <summary>
    /// Builds a string to get the controller by player.
    /// </summary>
    /// <param name="player"></param>
    /// <param name="axis"></param>
    /// <param name="type"></param>
    /// <param name="atype"></param>
    /// <returns></returns>
    public static string GetInput(OuyaSDK.OuyaPlayer player, AxisTypes axis, AnalogTypes atype)
    {
        Vector2 point;
        JoystickType joystickType = GetControllerType(player);
        switch (joystickType)
        {
            case JoystickType.ps3:
                //Note We don't care if the axis is X or Y,  we just want to check for input from normalized.
                #region PS3 Controller
                point = new Vector2(Input.GetAxis(CheckInput(player, axis, JoystickType.ps3, AnalogTypes.Left)), Input.GetAxis(CheckInput(player, axis, JoystickType.ps3, AnalogTypes.Right)));
                if (point.x != 0f || point.y != 0f)
                {
                    return CheckInput(player, axis, JoystickType.ps3, atype);
                }
                if (atype.Equals(AnalogTypes.DPad)){
                    return CheckInput(player, axis, JoystickType.ps3, atype);
                }
                #endregion
                return string.Empty;

            case JoystickType.xbox:
                #region xbox360
                point = new Vector2(Input.GetAxis(CheckInput(player, axis, JoystickType.xbox, AnalogTypes.Left)), Input.GetAxis(CheckInput(player, axis, JoystickType.xbox, AnalogTypes.Right)));
                if (point.x != 0f || point.y != 0f)
                {
                    return CheckInput(player, axis, JoystickType.xbox, atype);
                }
                if (atype.Equals(AnalogTypes.DPad))
                {
                    return CheckInput(player, axis, JoystickType.xbox, atype);
                }
                if (atype.Equals(AnalogTypes.LTRT))
                {
                    return CheckInput(player, axis, JoystickType.xbox, atype);
                }
                #endregion
                return string.Empty;

            case JoystickType.ouya:
                point = new Vector2(Input.GetAxis(CheckInput(player, axis, JoystickType.ouya, AnalogTypes.Left)), Input.GetAxis(CheckInput(player, axis, JoystickType.ouya, AnalogTypes.Right)));
                if (point.x != 0f || point.y != 0f)
                {
                    return CheckInput(player, axis, JoystickType.ouya, atype);
                }
                if (atype.Equals(AnalogTypes.DPad))
                {
                    return CheckInput(player, axis, JoystickType.ouya, atype);
                }
                if (atype.Equals(AnalogTypes.LTRT))
                {
                    return CheckInput(player, axis, JoystickType.ouya, atype);
                }
                return string.Empty;

            default:
                return "Horizontal";
        }
    }
开发者ID:danielkinjerski,项目名称:Jump_Switch,代码行数:66,代码来源:OuyaInputManager.cs


示例18: GetKeyCode

 public static string GetKeyCode(int buttonNum, OuyaSDK.OuyaPlayer player)
 {
     switch (player)
     {
         case OuyaSDK.OuyaPlayer.none:
             return string.Format("JoystickButton{0}", buttonNum);
         default:
             return string.Format("Joystick{0}Button{1}", ((int)player), buttonNum);
     }
 }
开发者ID:hassanLastborn,项目名称:Tether,代码行数:10,代码来源:OuyaExampleCommon.cs


示例19: GetControllerType

 public static JoystickType GetControllerType(OuyaSDK.OuyaPlayer player)
 {
     // check the player to see what joystick type they have
     OuyaGameObject.Device device = OuyaGameObject.devices.Find(delegate(OuyaGameObject.Device d) { return (null == d) ? false : (d.player == player); });
     if (null == device)
     {
         return JoystickType.none;
     }
     return GetControllerType(device.name);
 }
开发者ID:danielkinjerski,项目名称:Jump_Switch,代码行数:10,代码来源:OuyaInputManager.cs


示例20: GetButtonUp

 /// <summary>
 /// Wrap Unity's method
 /// </summary>
 /// <param name="inputName"></param>
 /// <returns></returns>
 public static bool GetButtonUp(string inputName, OuyaSDK.OuyaPlayer player)
 {
     // these will map to the Unity game's existing button names
     // the text cases are placeholders
     return !OuyaInputManager.GetButton(inputName, player);
 }
开发者ID:danielkinjerski,项目名称:Jump_Switch,代码行数:11,代码来源:OuyaInputManager.cs



注:本文中的OuyaSDK类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Overflow类代码示例发布时间:2022-05-24
下一篇:
C# OutputWindowPane类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap