Example #1
0
    public void ChangeGameFieldPosition(Vector2Int newPosition)
    {
        //Erase old position
        if (gameField.CheckSquareState(GameFieldPosition, FieldSquareState.Fruit))
        {
            gameField.ChangeSquareOfField(GameFieldPosition, FieldSquareState.Empty, ActorID);
        }

        //Draw new position
        gameField.ChangeSquareOfField(newPosition, FieldSquareState.Fruit, ActorID);

        //Save new position
        GameFieldPosition = newPosition;
    }
Example #2
0
    void Start()
    {
        gameField = GameObject.FindWithTag("GameField").GetComponent <GameField>();

        //Set default position
        GameFieldPosition = gameField.Center;
        gameField.ChangeSquareOfField(GameFieldPosition, FieldSquareState.Fruit, ActorID);

        //Registration
        GameplayManager.RegisterFruit(this);
    }