Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class PlayerInputMobile : MonoBehaviour {
- public CNAbstractController movejoystick;
- public CNAbstractController attackjoystick;
- private Camera mainCamera;
- PlayerInput pI;
- void Start () {
- pI = GetComponent<PlayerInput>();
- if(movejoystick==null)
- movejoystick = GameObject.FindWithTag("MovementJoystick").GetComponent<CNAbstractController>();
- if(attackjoystick==null)
- attackjoystick = GameObject.FindWithTag("AttackJoystick").GetComponent<CNAbstractController>();
- }
- void Update () {
- pI.mobileH = movejoystick.GetAxis("HorizontalA");
- pI.mobileV = movejoystick.GetAxis("VerticalA");
- pI.mobileHAttack = attackjoystick.GetAxis("HorizontalArrow");
- pI.mobileVAttack = attackjoystick.GetAxis("VerticalArrow");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement