Sie sind auf Seite 1von 15

HOME (../../../INDEX.

HTML)
APPUS
SHOWCASE
(../../../APP-SHOWCASE.HTML)
(exercise-2-creating-the-splash-scene.html#)
SAMSUNG
DEVELOPERS

(../../../INDEX.HTML)

(EXERCISE-2-CREATING-THE-SPLASH-SCENE.HTML#)
EVENTS (../../../EVENTS.HTML)

BLOG (../../../BLOG.HTML)

DEVELOPER RESOURCES (../../../DEVELOPER-RESOURCES.HTML)

SIGN UP (../../../SIGN-UP.HTML)

EXERCISE 2: CREATING THE SPLASH SC

Samsung Developers US (../../../index.html) > Developer Resources (../../../developerresources.html) > Gear VR (../../gear-vr.html) > Apps and Games (../apps-and-games.html) >
Exercise 2: Creating the Splash Scene

The 360 image viewer app will contain two scenesa splash scene and a main scene.
When the app is launched, the splash scene will display a 360 image along with a logo.
This scene will display for a few seconds, ultimately, allowing the app some time to load
the main content.

In this exercise, you will learn how to:


Create a scene in a Unity project
Add game objects to a scene
Apply materials to objects
Add a prefab to the scene
Manage scene lighting
Create an Oculus Signature File
Edit the player settings
Build and run the Unity project on a Gear VR device
Build the splash screen
1. Return to Unity.
2. From the menu, select File > Save Scene.
3. In the Save Scene dialog, name the le Splash.unity and save it to the /Assets
/Workshop/Scenes folder in your Unity project.
Note: In the /Scenes/CatchUpScenes directory, you will see multiple versions of the Splash
scene le with a number prexed to the le name. These numbers correspond to the exercises in
this series. We recommend that you create and use your own scenes, but if you would like to
start with clean les, you are welcome to use the provided les.
4. In the Hierarchy view, select the Main Camera object. You will see the object selected

in the Scene view and its details displayed in the Inspector view.
The Hierarchy view shows you the relationship of all of the objects in a scene. The Scene
view displays your scene in free point of view (you can look at the scene from all angles).
The Inspector view displays all of the components and properties of a selected object in
a scene.

5. In the Inspector view, disable the Main Camera by unchecking the box next to the
object name.

Add a cube mesh to the scene


Now you can begin adding content to your splash scene. Youll start by adding a game
object. Considered a building block of a Unity project, a game object can be a piece of
geometry or script that is dened by specic components, or object properties and
behaviors.
1. In the Project view, open the /Assets/Workshop/Meshes folder and drag the Box_Inv
object into the Hierarchy view. You can also drag the object into the Scene view, but
dragging it into the Hierarchy view will position the object at (0, 0, 0).

The Box_Inv object is a 3D inverted cube mesh, or shape, that you will use as the
background of your splash screen. By default, this box has a plain gray texture, or
surface. You will place a different material on each side of the cube to create a
background image.

Apply materials to an object


1. With the Box_Inv object selected, navigate to the Inspector view and locate the Mesh
Renderer component. Expand the Materials section. Here you will see
a Size property and several Element slots. The Size property dictates the number of
Element slots. In this case, there are six, one for each side of the inverted box object.
Changing the materials in the Element slots will change the background image for the
Splash scene.

2. In the Project view, open the /Assets/Workshop/Materials folder. Here you will see

six different Box materials with a number appended. These numbers correspond to
the Box_Inv objects Element slots in the Mesh Renderer > Materials setting. Drag
the Box_0_Back.mat le into the Element 0 property eld.

3. Repeat step 2 for the ve remaining Element slots.

Add a prefab to the scene


1. In the Project view, open the /Assets/Workshop/Prefabs folder and drag the Logo_1
prefab into the Heirarchy view.
Tip: Hold down the Alt/Option key and click-drag the scene to orbit around the views pivot
point. For more tips on using the Scene view, review the Unity Manual
(http://docs.unity3d.com/Manual/SceneView.html).
2. In the Inspector view, navigate to the Transform component and make sure the

following values are set:


Position: (0, 0, 30)
Rotation: (-90, -180, 0)
Tip: In addition to using the Inspector view, you can also position an object in the Scene view by
dragging the object by one of its axes.

3. From the menu, select Window > Lighting.


4. In the Lighting view, select the Scene tab and navigate to the Environment Lighting
section.
5. To the right of the Skybox eld, click the Target button. In the Select Material
window, choose the Skybox material.

6. In Scene view, review the Splash screen.

Add the OVRCameraRig prefab


1. In the Project view, open the /Assets/OVR/Prefabs folder and drag
theOVRCameraRig prefab into the Hierarchy view. Placing the OVRCameraRig
prefab in a scene replaces the Main Camera provided in Unity and allows you to start
viewing the scene on Gear VR.
Note: For more detailed information on the prefabs included in the Oculus Mobile SDK, review
the Oculus Mobile SDK documentation. (http://static.oculus.com/sdk-downloads/documents
/Oculus_Mobile_v0.5.0_SDK_Documentation.pdf)
2. In the Hierarchy view, expand the OVRCameraRig > Tracking Space object. Nested
within this object are the LeftEyeAnchor, CenterEyeAnchor, RightEyeAnchor, and
TrackingAnchor objects. Later in the workshop, you will use the CenterEyeAnchor to
implement a reticle and raycaster that will target and trigger buttons in the app.

3. At the top of the Unity window, click the Play button. In Game view, you will see your
Splash scene displayed. On your Gear VR headset, this scene will be rendered in two
side-by-side images, mapping to your left and right eyes, creating a stereoscopic view.

4. Click the Play button again to stop the preview.


Note: Any changes made to your project while in Preview mode will not be saved. If you
preview your app, make sure to stop the preview before making changes.
5. Save the scene.
Download the Oculus Signature File

Oculus requires that all applications accessing VR functionality use a unique signature
le created with a specic Note 4 or S6/S6 Edge Device ID. This signature le will access
low-level device functions through APIs provided in the Oculus Mobile SDK.
1. On your device, open the Device Id Fetch app. You will see your Device ID displayed
in the app.
Note: You can also retrieve your Device ID by using ADB, a command line for the Android SDK.
Details on how to manually retrieve the Device ID are outlined in the Setup guides for Mac OS
X (setup-mac-os-x.html) and Windows OS (setup-windows-os.html) and you can also nd
instructions on the Oculus Signature File Generator (https://developer.oculus.com/tools
/osig/) page.

2. On your computer, open a browser and navigate to the Oculus Signature File
Generator (https://developer.oculus.com/tools/osig/) page. Login to your Oculus
account. If you do not have an account, create one now.
3. In the Device ID eld, type in the Device ID retrieved from your device and click the
DOWNLOAD FILE button. Your Oculus signature le will be downloaded to your
machine.

4. In your le system, navigate to the location of your Oculus signature le.


5. Return to Unity.
6. In the Project view, open the /Assets/Plugins/Android/assets folder and drag your
Oculus signature le into the folder.

Edit the Player Settings


1. From the menu, select Edit > Project Settings > Player.
2. In the Inspector view, review the current PlayerSettings. When you replaced the
ProjectSettings folder in your Unity project in the previous exercise, you
implemented default Player Settings from the Oculus Mobile SDK.
3. Change the following settings:
Company Name: Add your company name here
Product Name: Hello World 360
Default Icon: Icon (/Assets/ Workshop/Textures/Icon.png)

4. Expand the Other Settings section and change the Bundle Identier to
com.[yourComanyName].HelloWorld360.

Build and run the application


1. Connect your device to your machine via USB.
2. The rst time you connect the device to your machine, you will see the Allow USB
debugging? dialog appear on your device. Check the Always allow this computer box
and tap OK.

3. Return to Unity. From the menu, select File > Build Settings...
4. In the Build Settings window, click the Add Current button to add your Splash scene
to the Scenes In Build list.

5. Under the Android settings, make sure the Texture Compression is set to ETC2
(GLES 3.0).
6. Click the Build And Run button.
7. In the Build Android dialog, give your APK le a name and click Save. As the app
builds, you may be prompted to specify the location of the Android SDK root folder
on your machine.
8. Once Unity has nished building your app, you will see the Insert device dialog
appear on your device. Disconnect your device from your computer, connect it to
your Gear VR, and review your scene.

Sign Up for Emails about Samsung's Developer Tools and Events

I have read the Privacy Policy (../../../privacy.html) and agree to the Samsung Developer Connection Terms and
Conditions. (exercise-2-creating-the-splash-scene.html#modal-1)
CONNECT

Search

Latest Tweets

@SamsungDevUS (http://twitter.com/SamsungDevUS)

Follow @SamsungDevUS (http://www.twitter.com/SamsungDevUS).


Recent Posts
Announcing the Gear VR Developer Program (../../../blog/announcing-the-gearvr-developer-program.html)

Exciting New Speakers just Announced for GMIC SV 2014! (../../../blog/excitingnew-speakers-just-announced-gmic-sv-2014.html)

Nuance and Samsung Arm Developers with Innovation and Tools for the Connected
Lifestyle (../../../blog/nuance-samsung-arm-developers-innovation-tools-connectedlifestyle.html)

Win-Win: Using the Gear 2 as a Second Screen (../../../blog/win-win-using-gear-2second-screen.html)

Develop Samsung Gear and Android Apps with the Tizen IDE for Wearable (../../../blog
/develop-samsung-gear-android-apps-tizen-ide-wearable.html)

2015 samsungdevus.com (http://tes.iquariusmedia.com)

App Showcase (../../../app-showcase.html)

Events (../../../events.html)

Developer Resources (../../../developer-resources.html)

Blog (../../../blog.html)

Privacy (../../../privacy.html)

Sign Up (../../../sign-up.html)

Das könnte Ihnen auch gefallen