Esempio n. 1
0
    private void PrepareData(string modelType)
    {
        var inputConfig = new InputConfiguration();

        AssetDirs.CreateAssetDirectory(AssetDirs.TempAssetsDir);
        var assetBundleCreator = new AssetBundleCreator(inputConfig.OutputDir);
        var modelConverter     = new ModelConverter();

        Log.Info("Preprocessing started!");
        var  modelImporter = InitializeModelImporter(modelType, modelConverter, inputConfig.RootDirectory);
        bool loadModel     = true;

        try
        {
            while (loadModel)
            {
                modelImporter.GetModelData();
                assetBundleCreator.Create(modelImporter);
                if (Application.isBatchMode)
                {
                    loadModel = false;
                }
                else
                {
                    loadModel = EditorUtility.DisplayDialog("", "Do you want to load another model?", "Yes", "No");
                }
            }
        }
        finally
        {
            RecursiveDeleter.DeleteRecursivelyWithSleep(AssetDirs.TempAssetsDir);
            Log.Info("Preprocessing finished!");
        }
    }
Esempio n. 2
0
    private void OnGUI()
    {
        if (GUILayout.Button("Export"))
        {
            if (!Directory.Exists(Application.dataPath + "/MyExportedWeapon"))
            {
                Directory.CreateDirectory(Application.dataPath + "/MyExportedWeapon");
            }

            BuildAllAssetBundles();

            AssetBundleCreator window = (AssetBundleCreator)GetWindow(typeof(AssetBundleCreator));
            window.Close();
        }
    }
Esempio n. 3
0
    static void ShowWindow()
    {
        AssetBundleCreator window = (AssetBundleCreator)GetWindow(typeof(AssetBundleCreator));

        window.Show();
    }