コード例 #1
0
    private void UpdateController()
    {
        UpdateHighlight(RendererAxisLeft, Mathf.Abs(OuyaInputManager.GetAxis("LX", player)) > 0.25f ||
                        Mathf.Abs(OuyaInputManager.GetAxis("LY", player)) > 0.25f);

        RendererAxisLeft.transform.localRotation = Quaternion.Euler(OuyaInputManager.GetAxis("LY", player) * 15, 0, OuyaInputManager.GetAxis("LX", player) * 15);

        UpdateHighlight(RendererAxisRight, Mathf.Abs(OuyaInputManager.GetAxis("RX", player)) > 0.25f ||
                        Mathf.Abs(OuyaInputManager.GetAxis("RY", player)) > 0.25f);

        RendererAxisRight.transform.localRotation = Quaternion.Euler(OuyaInputManager.GetAxis("RY", player) * 15, 0, OuyaInputManager.GetAxis("RX", player) * 15);

        if (OuyaInputManager.GetButtonDown("L3", player))
        {
            RendererAxisLeft.transform.localPosition = Vector3.Lerp(RendererAxisLeft.transform.localPosition,
                                                                    new Vector3(5.503977f, 0.75f, -3.344945f), Time.fixedDeltaTime);
        }
        else
        {
            RendererAxisLeft.transform.localPosition = Vector3.Lerp(RendererAxisLeft.transform.localPosition,
                                                                    new Vector3(5.503977f, 1.127527f, -3.344945f), Time.fixedDeltaTime);
        }

        if (OuyaInputManager.GetButtonDown("R3", player))
        {
            RendererAxisRight.transform.localPosition = Vector3.Lerp(RendererAxisRight.transform.localPosition,
                                                                     new Vector3(-2.707688f, 0.75f, -1.354063f), Time.fixedDeltaTime);
        }
        else
        {
            RendererAxisRight.transform.localPosition = Vector3.Lerp(RendererAxisRight.transform.localPosition,
                                                                     new Vector3(-2.707688f, 1.11295f, -1.354063f), Time.fixedDeltaTime);
        }
    }
コード例 #2
0
 public static bool GetPlayerInteractDown()
 {
     return(Input.GetKeyDown(KeyCode.L) ||
            OuyaInputManager.GetButtonDown("A", OuyaSDK.OuyaPlayer.player2));
 }
コード例 #3
0
 // Player Action
 public static bool GetPlayerInspectDown()
 {
     return(Input.GetKeyDown(KeyCode.K) ||
            OuyaInputManager.GetButtonDown("O", OuyaSDK.OuyaPlayer.player1));
 }