<commit_before>﻿using UnityEditor;
using UnityEngine;

namespace Assets.Scripts
{
    public class Level : MonoBehaviour
    {
        public Transform Ground;

        public Rect GetLevelBounds()
        {
            var scale = CalculateTotalScale(Ground);
            return Rect.MinMaxRect(
                Ground.position.x - scale.x/2,
                Ground.position.z - scale.y/2,
                Ground.position.x + scale.x/2,
                Ground.position.z + scale.y/2);
        }

        private static Vector3 CalculateTotalScale(Transform transform)
        {
            if (transform == null)
            {
                return new Vector3(1f, 1f, 1f);
            }

            var scale = transform.localScale;
            var parentScale = CalculateTotalScale(transform.parent);
            return new Vector3(scale.x*parentScale.x, scale.y*parentScale.y, scale.z*parentScale.z);
        }
    }
}
<commit_msg>calculation of level bounds simplified<commit_after>﻿using UnityEngine;

namespace Assets.Scripts
{
    public class Level : MonoBehaviour
    {
        public Transform Ground;

        public Rect GetLevelBounds()
        {
            var bounds = Ground.GetComponent<Renderer>().bounds;

            return Rect.MinMaxRect(
                bounds.min.x,
                bounds.min.z,
                bounds.max.x,
                bounds.max.z);
        }
    }
}

{'fraction_non_alphanumeric': 0.08831908831908832, 'fraction_numerical': 0.007122507122507123, 'mean_word_length': 1.6459510357815443, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4517156', 'n_tokens_mistral': 397, 'n_tokens_neox': 376, 'n_words': 80}