Esempio n. 1
0
 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);
     }
 }
Esempio n. 2
0
        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);
        }