QuadTree.PrepareChild C# (CSharp) Method

PrepareChild() private method

private PrepareChild ( GameObject parent, Vector3 position, Vector3 size, int itemCounter, int depth ) : GameObject
parent GameObject
position Vector3
size Vector3
itemCounter int
depth int
return GameObject
    GameObject PrepareChild(GameObject parent, Vector3 position, Vector3 size, int itemCounter, int depth)
    {
        GameObject child = null;

            child = GameObject.CreatePrimitive(PrimitiveType.Cube);
            child.transform.position = position;
            child.AddComponent<QuadTreeItem>();
            child.name = "quadtree_child" + depth + "_" + itemCounter;
            child.GetComponent<MeshRenderer>().enabled = false;
            child.GetComponent<QuadTreeItem>().Position = position;
            child.GetComponent<QuadTreeItem>().Size = size;
            child.GetComponent<QuadTreeItem>().Parent = parent;
            child.GetComponent<QuadTreeItem>().Depth = depth;
            child.GetComponent<QuadTreeItem>().insideGameObject = child;
            child.GetComponent<BoxCollider>().enabled = false;
            child.transform.localScale = size;
            child.GetComponent<QuadTreeItem>().GameObjects.AddRange(DetermineGameObjectsInside(child));

            return child;
    }