Exemplo n.º 1
0
    void Update()
    {
        UpdateAlert();
        var mouseOver = UpdateMouseOver();

        if (_ns.mode == GameMode.Bot)
        {
            _checkers.AiRealise();
        }

        int x = (int)mouseOver.x;
        int y = (int)mouseOver.y;

        if (Input.GetMouseButtonDown(0))
        {
            Debug.Log("SelectPiece!");
            SelectPiece(x, y);
        }
        else if (Input.GetMouseButtonUp(0))
        {
            Debug.Log("TryMove!");
            TryMove((int)_startDrag.x, (int)_startDrag.y, x, y);
            //Debug.Log(startDrag.x + " " + startDrag.y + " " + x + " " + y);
        }
        else if (_isSelected)
        {
            Debug.Log("UpdatePieceDrag!");
            UpdatePieceDrag(pieces[_checkers.GetPiece((int)_startDrag.x, (int)_startDrag.y)]);
        }
    }