Esempio n. 1
0
    public void adjustTarget()
    {
        switch (gameSceneController.getRoomDirection())
        {
        case Directions.Up:
            targetPosition.x = transform.position.x;
            targetPosition.y = transform.position.y - gameSceneController.getBounds().height / 2 - getSize().y / 2;;
            break;

        case Directions.Down:
            targetPosition.x = transform.position.x;
            targetPosition.y = transform.position.y + gameSceneController.getBounds().height / 2 + getSize().y / 2;;
            break;

        case Directions.Left:
            targetPosition.y = transform.position.y;
            targetPosition.x = transform.position.x + gameSceneController.getBounds().width / 2 + getSize().x / 2;
            break;

        case Directions.Right:
            targetPosition.y = transform.position.y;
            targetPosition.x = transform.position.x - gameSceneController.getBounds().width / 2 - getSize().x / 2;
            break;
        }
    }