private void MergeMeshData(GameObject gameObject, FeatureMesh featureMesh)
 {
     // Merge the mesh data from the feature for the game object
     if (gameObjectMeshData.ContainsKey(gameObject))
     {
         gameObjectMeshData[gameObject].Merge(featureMesh.Mesh);
     }
     else
     {
         MeshData data = new MeshData();
         data.Merge(featureMesh.Mesh);
         gameObjectMeshData.Add(gameObject, data);
     }
 }
        private void MergeMeshData(GameObject gameObject, FeatureMesh featureMesh)
        {
            // Merge the mesh data from the feature for the game object
            if (gameObjectMeshData.ContainsKey(gameObject))
            {
                gameObjectMeshData[gameObject].Merge(featureMesh.Mesh);
            }
            else
            {
                MeshData data = new MeshData();
                data.Merge(featureMesh.Mesh, true);
                gameObjectMeshData.Add(gameObject, data);

                Debug.Log("Game Object Created: " + gameObject.name);
                Debug.Log("         Its Vertices: " + data.MeshDataVerticesToString());
                Debug.Log("         Its UVs: " + data.MeshDataUVsToString());
                Debug.Log("         Its Submeshes: " + data.MeshDataSubmeshesToString());
            }
        }
        private GameObject AddGameObjectGroup(SceneGroupType groupType, GameObject parentGameObject, FeatureMesh featureMesh)
        {
            GameObject gameObject = null;

            string name = featureMesh.GetName(groupType);

            // No name for this group in the feature, use the parent name
            if (name.Length == 0)
            {
                name = parentGameObject.name;
            }

            Transform transform = parentGameObject.transform.Find(name);

            if (transform == null)
            {
                // No children for this name, create a new game object
                gameObject = new GameObject(name);
                gameObject.transform.parent = parentGameObject.transform;
            }
            else
            {
                // Reuse the game object found the the group name in the hierarchy
                gameObject = transform.gameObject;
            }


            return(gameObject);
        }