-
Notifications
You must be signed in to change notification settings - Fork 103
MetaioAndUnity
Matt Harley edited this page Jan 25, 2015
·
10 revisions
Version: metaioSDK-5.5.2
https://dev.metaio.com/webinars/metaio-sdk-unity-fundamentals/
- What's different?
- References http://docs.metaio.com/bin/login/Main/MobileGettingStartedUnity which I need a login for!
- Folders in Project tab under
Assets
: -
Resources
director no longer has image and tracking data - There's no
Scenes
directory - The stuff about making the tracking XML is no longer valid. Tracking assets are now under Assets > StreamingAssets > *.xml
- Register you app at http://my.metaio.com/index.php?state=portal (e.g. Unity Test, 'com.felixlab.unitytest'). This will give you a n
- Select your app in the top panel and then select the SDK Signature from the lower panel. (e.g. WYiJpNgSp5BSh1MzmaHxRggQFFzm3FpQ4ND9XCVjrk0=)
- In Unity, go to File > Build Settings and in both the iOS and Android under Other Settings, change the Bundle Identifier to your app identifier above (e.g. 'com.felixlab.unitytest')
- (optional) They also change the Default Orientation to Landscape Left
- In the Heirarchy tab, click metaioSDK. This should open the MetaioSDK properties in the Inspector tab
- There should be an SDK Signature box where you need to paste in your SDK Signature from above (e.g. WYiJpNgSp5BSh1MzmaHxRggQFFzm3FpQ4ND9XCVjrk0=). You can also access this from
Project
under Assets > StreamingAssets > MetaioSDKLicense.xml - You should be all good to go. Go back to File > Build Settings, select your app platform (iOS or Android) and click Build. I've exported mine as
ExampleApp
https://dev.metaio.com/storage-folder/getting-started/unity3d/creating-new-ar-application/
- Open
ExampleApp/Unity-iPhone.xcodeproj
- Drag the file
ExampleApp/Libraries/metaiosdk
into the root of your new Xcode project - You'll need to add some extra libraries
- Click on the root of your project (Unity-iPhone)
- Open the Unity-iPhone Target by clicking in the top-left corner of the Editor window and selecting Unity-iPhone under Targets rather than Projects
- Then click on Build Phases, expand Link Binaries with Libraries and add:
- libxml2.2dylib
- Security.framework
- CoreImage.framework
- You should be all good to go. Hit build and run!
http://dev.metaio.com/webinars/metaio-sdk-unity-advanced/
- What's different?
- There is no default ARScene included in the SDK unity package. You'll need to start a new scene, add the
metaioSDK
and metaioTracker` prefabs and then save the scene (as ARScene if you like)
- There is no default ARScene included in the SDK unity package. You'll need to start a new scene, add the
http://dev.metaio.com/webinars/metaio-sdk-unity-advanced-ii/ https://dev.metaio.com/webinars/unity-advance-interactions-with-the-metaio-sdk/
Creating a menu in Unity (starting from the example).
- For testing - you can either press the play button on the Unity GUI or use the desktop build option (File > Build Settings > PC, Mac, Linux Standalone)
- Can't use HTML to create menus!! (bummer)
- http://docs.unity3d.com/Manual/gui-Basics.html
- Declaring a
GUIStyle
creates a panel in the Unity Inspector which you can edit. (e.g.public GUIStyle TutorialHelloWorldPreview;
). To find this panel in Unity, go to the Hierarchy panel (left of screen) and select "GUI" - as opposed to "Main Camera" - Changing the main menu text colour: Headline Text Style > Normal > Text Color
- Changing the icon for each tutorial. I went to Tutorial Hello World Preview > Normal > Background and drag and dropped the image file from Assets down the bottom in the Project pane
- You can move objects around by changed the values given in the
Rect(left, top, width, height)
constructor inMainMenu.cs
- If you trying to open a level and get the error:
Level couldn't be loaded because it has not been added to the build settings
, you need to add the level to the build settings (obviously). But how? - Open the level under Project -> Assets and locate the .unity file (it has the Unity icon)
- Open File -> Build Settings and drag the unity file icon into the Scenes In Build panel
- Make sure you rename the video file to include
*.alpha.*
in the filename. E.g.myvideo.alpha.3g2
http://unitygems.com/debugging-game-monodevelop/
- Get a list of all files in the StreamingAssets folder:
$ cd blah/UnityProject/Assets/StreamingAssets
$ find . | grep -v 'meta'
./MainMenu
./MetaioSDKLicense.xml
./TutorialContentTypes
...
- Remove the leading
.
to make the paths like this:/MainMenu