Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class PS4Script : MonoBehaviour {
- public Transform player;
- public float speed = 5;
- void Start()
- {
- player = this.gameObject.transform;
- }
- void Update ()
- {
- if (Input.GetButtonDown("Square_PS4"))
- {
- Debug.Log("Square Pressed");
- }
- if (Input.GetButtonDown("Cross_PS4"))
- {
- Debug.Log("Cross Pressed");
- }
- if (Input.GetButtonDown("Circle_PS4"))
- {
- Debug.Log("Circle Pressed");
- }
- if (Input.GetButtonDown("Triangle_PS4"))
- {
- Debug.Log("Triangle Pressed");
- }
- if (Input.GetButtonDown("L1_PS4"))
- {
- Debug.Log("L1 Pressed");
- }
- if (Input.GetButtonDown("L2_PS4"))
- {
- Debug.Log("L2 Pressed");
- }
- if (Input.GetButtonDown("L3_PS4"))
- {
- Debug.Log("L3 Pressed");
- }
- if (Input.GetButtonDown("R1_PS4"))
- {
- Debug.Log("R1 Pressed");
- }
- if (Input.GetButtonDown("R2_PS4"))
- {
- Debug.Log("R2 Pressed");
- }
- if (Input.GetButtonDown("R3_PS4"))
- {
- Debug.Log("R3 Pressed");
- }
- if (Input.GetButtonDown("Options_PS4"))
- {
- Debug.Log("Options Button Pressed");
- }
- if (Input.GetButtonDown("Share_PS4"))
- {
- Debug.Log("Share Button Pressed");
- }
- if (Input.GetButtonDown("Playstation_PS4"))
- {
- Debug.Log("Playstation Button Pressed");
- }
- Vector3 LeftJoystickDir = new Vector3(Input.GetAxisRaw("Horizontal"), 0, Input.GetAxisRaw("Vertical"));
- Debug.DrawRay(player.position, LeftJoystickDir, Color.green, 0.5f);
- Vector3 RightJoystickDir = new Vector3(Input.GetAxisRaw("PS4_HorizontalR"), 0, Input.GetAxisRaw("PS4_VerticalR"));
- Debug.DrawRay(player.position, RightJoystickDir, Color.cyan, 0.5f);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement