*
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
[RequireComponent(typeof(RectTransform))]
|
||||
public class Joystick : MonoBehaviour {
|
||||
public JoystickViewController view;
|
||||
|
||||
public string XAxis = "Yaw";
|
||||
public string YAxis = "Throlle";
|
||||
|
||||
private Vector2 _state;
|
||||
|
||||
public Vector2 State{
|
||||
get{ return _state;}
|
||||
}
|
||||
|
||||
// Use this for initialization
|
||||
void Start () {
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update () {
|
||||
_state.x = Input.GetAxis (XAxis);
|
||||
_state.y = Input.GetAxis (YAxis);
|
||||
view.SetAxis (_state.x, _state.y);
|
||||
}
|
||||
|
||||
void OnGUI(){
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user