Adding 3D content to MARC-EDU:

1.Open Unity version 5.3.4f1 and create a new project.

2. Create a new folder called AssetBundle in the Assets folder. Follow the naming convention and casing strictly.

3. Copy the code before into a new .txt file and save as a .cs file:

 

using UnityEditor;

 

public class exportAssetBundleAndroid

{

[MenuItem(“Assets/Build Asset Bundles Android”)]

static void BuildAllAssetBundles()

{

BuildPipeline.BuildAssetBundles (“Assets/AssetBundle”, BuildAssetBundleOptions.None, BuildTarget.Android);

}

}

 

public class exportAssetBundleiOS

{

[MenuItem(“Assets/Build Asset Bundles iOS”)]

static void BuildAllAssetBundles()

{

BuildPipeline.BuildAssetBundles (“Assets/AssetBundle”, BuildAssetBundleOptions.None, BuildTarget.iOS);

}

}

4. Put the .cs script into the Assets folder.

5. Create a 400 units square 3D plane at the 0,0,0 position.

6. Create an empty game object in the scene at the 0,0,0 position by right-clicking within the Hierarchy panel and selecting Create Empty.

7.Import your 3D asset into your project, drag it into scene, and scale it accordingly. Use the previously created plane to gauge the scale and position of your 3D object.

8.Click and drag the 3D object into the empty game object.

9.Click and drag the game object containing the 3D object back into the Assets folder to create a prefab.

10. Select the prefab in the Assets folder and start building the android asset bundle by defining the name and extension of the exported asset bundle in the bottom right-hand corner.

11. Type in a filename that ends with the suffix _android,  and then press enter to confirm, e.g., mymodel_android. All letters are in lowercase.

12. Type in the extension name unity3d, and press enter to confirm. All letters are in lowercase.

13.Go to File/ Build Settings and select the Android platform, and then click Switch Platform.

14. Go to Assets / Build Asset Bundles Android

15. Repeat step 10 to 14 for the ios asset bundle. The suffix for the ios asset bundle should be _ios. The file extension is also unity3d. For when you reach step 14, click on Build Asset Bundles iOS instead.

16. Right-click the Assets folder and select Show in Explorer. Access the AssetBundle folder and upload the [filename]_android.unity3d and the [filename]_ios.unity3d files.