Exemple #1
0
    // INTERACTION
    public void Move(FieldScript newField)
    {
        FieldScript currentField = GameController.Instance.board.GetField(currentPos.x, currentPos.y);

        currentField.Free();
        newField.Occupy(this);

        currentPos = newField.pos;

        // animate movement
        transform.DOMove(newField.transform.position, 0.5f).SetEase(Ease.InOutCubic);

        GameController.Instance.NextTurn();
        Deselect();
    }
Exemple #2
0
    // INTERACTION
    public void Move(FieldScript newField)
    {
        FieldScript currentField = GameController.Instance.board.GetField(currentPos.x, currentPos.y);

        currentField.Free();
        newField.Occupy(this);

        currentPos = newField.pos;

        // animate movement
        transform.DOMove(newField.transform.position, 0.5f).SetEase(Ease.InOutCubic);

        GameController.Instance.NextTurn();
        Deselect();
    }