using UnityEngine; using System.Collections; public class InputManager : MonoBehaviour { // Singleton public static InputManager Instance; public float InputX = 0f; public float InputZ = 0f; public bool ClickMouse = false; public bool ClickSpace = false; // Use this for initialization void Start () { if (Instance == null) { Instance = this; } } // Update is called once per frame void Update () { InputAxis (); } private void InputAxis () { InputZ = Input.GetAxis ("Horizontal"); InputX = Input.GetAxis ("Vertical"); } public bool InputMouseButton () { return Input.GetMouseButton (0); } public bool InputSpace () { return Input.GetKeyDown (KeyCode.Space); } }