public IEnumerator InstantiateModels()
        {
            for (int i = 0; i < localFiles.Count; i += 1)
            {
                int menuIndex = i;

                var model = modelData.models[i];
                VerifyModelData(model);

                yield return(loader.TryLoadLocalFile(localFiles[i].location, localFiles[i].name, localFiles[i].size, progressDisplay, gObject =>
                {
                    //Debug.Log($"instantiating model #{menuIndex}");
                    //Debug.Log($"{modelData.name}");
                    //WebGLMemoryStats.LogMoreStats($"ModelImportPostProcessor.SetUpGameObject {model.name} BEFORE");
                    //set up gameObject properties for a Komodo session
                    GameObject komodoImportedModel = ModelImportPostProcessor.SetUpGameObject(menuIndex, model, gObject, settings ?? null);
                    //WebGLMemoryStats.LogMoreStats($"ModelImportPostProcessor.SetUpGameObject {model.name} AFTER");

                    //   Debug.Log(komodoImportedModel.name);
                    //set it as a child of the imported models list
                    komodoImportedModel.transform.SetParent(list.transform, true);

                    modelsToInstantiate -= 1;
                }));
            }
        }
Ejemplo n.º 2
0
        public IEnumerator InstantiateModels()
        {
            for (int i = 0; i < localFiles.Count; i += 1)
            {
                int menuIndex = i;

                var model = modelData.models[i];
                VerifyModelData(model);

                yield return(loader.TryLoadLocalFile(localFiles[i].location, localFiles[i].name, localFiles[i].size, progressDisplay, gObject =>
                {
                    //WebGLMemoryStats.LogMoreStats($"ModelImportPostProcessor.SetUpGameObject {model.name} BEFORE");

                    GameObject komodoImportedModel = ModelImportPostProcessor.SetUpGameObject(menuIndex, model, gObject, settings ?? null);

                    //WebGLMemoryStats.LogMoreStats($"ModelImportPostProcessor.SetUpGameObject {model.name} AFTER");

                    komodoImportedModel.transform.SetParent(list.transform, false);

                    modelsToInstantiate -= 1;
                }));
            }
        }