Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- public class UsageSample : MonoBehaviour
- {
- void Update()
- {
- //Empty input direction
- Vector2 direction = Vector2.zero;
- //Set direction base on when press key of action
- if(Input.GetKey(KeyManager.i.Up)) dir.y = 1;
- if(Input.GetKey(KeyManager.i.Down)) dir.y = -1;
- if(Input.GetKey(KeyManager.i.Left)) dir.x = -1;
- if(Input.GetKey(KeyManager.i.Right)) dir.x = 1;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement