// Update is called once per frame void Update() { Mousepos(); if (Input.GetMouseButtonDown(0)) { fieldSelection.Click(); } }
void Keyboard() { if (Input.anyKeyDown) { fieldSelection.Movepoint(new Vector3(Input.GetAxisRaw("KeyboardX"), Input.GetAxisRaw("KeyboardY"), 0)); } if (Input.GetButtonDown("Jump")) { fieldSelection.Click(); } }
void Joy() { if (Input.GetButtonDown(ControllerName + "Jump")) { fieldSelection.Click(); } if (clicked) { if ((Mathf.RoundToInt(Input.GetAxisRaw(ControllerName + "X")) == 0) && (Mathf.RoundToInt(Input.GetAxisRaw(ControllerName + "Y")) == 0)) { clicked = false; } } if (clicked == false) { if ((Mathf.RoundToInt(Input.GetAxisRaw(ControllerName + "X")) != 0) || (Mathf.RoundToInt(Input.GetAxisRaw(ControllerName + "Y")) != 0)) { fieldSelection.Movepoint(new Vector3(Mathf.RoundToInt(Input.GetAxisRaw(ControllerName + "X")), Mathf.RoundToInt(Input.GetAxisRaw(ControllerName + "Y")), 0)); clicked = true; } } }