Exemplo n.º 1
0
    // Update is called once per frame
    void Update()
    {
        Mousepos();

        if (Input.GetMouseButtonDown(0))
        {
            fieldSelection.Click();
        }
    }
Exemplo n.º 2
0
 void Keyboard()
 {
     if (Input.anyKeyDown)
     {
         fieldSelection.Movepoint(new Vector3(Input.GetAxisRaw("KeyboardX"), Input.GetAxisRaw("KeyboardY"), 0));
     }
     if (Input.GetButtonDown("Jump"))
     {
         fieldSelection.Click();
     }
 }
Exemplo n.º 3
0
    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;
            }
        }
    }