Exemple #1
0
    /* Calls the ModelImport script to create a gameobject given a filePath
     * string filePath: The file path of the model to import
     */
    private void ImportModelFromPath(string filePath)
    {
        //Import new model
        DestroyPrevModel();
        GameObject importObject = modelImporter.LoadFileFromPath(filePath);

        importObject.transform.SetParent(container.transform);
        importObject.transform.localPosition = Vector3.zero;
        RestrictModelSize(importObject, container.transform.localScale.x);
    }
Exemple #2
0
    /* Calls the ModelImport script to create a gameobject given a filePath
     * string filePath: The file path of the model to import
     */
    private void ImportModelFromPath(string filePath)
    {
        //Destroy old model
        DestroyPrevModel();
        //Reset model container transform
        ResetModelContainer();
        //Import new model
        GameObject importObject = modelImporter.LoadFileFromPath(filePath);

        if (importObject == null)
        {
            Debug.Log("OVAL/aiImportManager/ImportModelFromPath: ModelImport/LoadFileFromPath did not return a GameObject.");
        }
        else
        {
            importObject.transform.SetParent(container.transform);
            importObject.transform.localPosition = Vector3.zero;
            RestrictModelSize(importObject, container.transform.localScale.x);
        }
    }