Esempio n. 1
0
    public void Click()
    {
        if (operating || !active)
        {
            return;
        }

        controller.Confirm();
    }
Esempio n. 2
0
    // Start is called before the first frame update
    void Awake()
    {
        // register movement key
        KeyInput.Default.MoveVertical.performed   += ctx => MoveButtonClicked(new Vector2Int(0, (int)ctx.ReadValue <float>()));
        KeyInput.Default.MoveHorizontal.performed += ctx => MoveButtonClicked(new Vector2Int((int)ctx.ReadValue <float>(), 0));
        KeyInput.Default.MoveVertical.canceled    += _ => MoveButtonReleased();
        KeyInput.Default.MoveHorizontal.canceled  += _ => MoveButtonReleased();
        if (!debugMode)
        {
            KeyInput.Default.Confirm.performed += _ => controller.Confirm();
        }
        else
        {
            KeyInput.Default.DebugConfirm.performed += _ => controller.Confirm();  //c for confirm
        }
        KeyInput.Default.Cancel.performed += _ => controller.Cancel();

        if (!controlOn)
        {
            KeyInput.Disable();
        }

        controller = GetComponent <CursorController>();
    }