using UnityEngine;
using System.Collections;

public class InputTopDown : MonoBehaviour {

    private TopDownMovementController moveCtrl;

    void Start()
    {
        moveCtrl = gameObject.GetComponent<TopDownMovementController>();
    }

    void Update()
    {
        float x = 0, y = 0;
        if (Input.GetKey(KeyCode.W) || Input.GetKey(KeyCode.UpArrow))
        {
            y = 1;
        }
        else if (Input.GetKey(KeyCode.S) || Input.GetKey(KeyCode.DownArrow))
        {
            y = -1;
        }

        if (Input.GetKey(KeyCode.D) || Input.GetKey(KeyCode.RightArrow))
        {
            x = 1;
        }
        else if (Input.GetKey(KeyCode.A) || Input.GetKey(KeyCode.LeftArrow))
        {
            x = -1;
        }

        moveCtrl.MoveAim = new Vector2(x, y);
    }
}
