Return to Video

(Unity 4) Publishing the game - 07 - Roll-a-ball - Unity Official Tutorials

  • 0:01 - 0:03
    Now that we've finished our game we need to
  • 0:03 - 0:05
    present it to our players.
  • 0:05 - 0:07
    One of the greatest things about Unity is that
  • 0:07 - 0:09
    once we have created our game we can deploy
  • 0:09 - 0:11
    it to many of the current platforms.
  • 0:12 - 0:14
    For more detailed information on building and
  • 0:14 - 0:17
    build targets please see the lesson linked below.
  • 0:17 - 0:19
    Before we build our game we should
  • 0:19 - 0:21
    save our scene.
  • 0:21 - 0:23
    To build our game we must first open
  • 0:23 - 0:25
    the Build Settings window.
  • 0:25 - 0:29
    We can do this by selecting File - Build Settings
  • 0:29 - 0:31
    or by using the key combination of
  • 0:31 - 0:35
    shift plus command or control plus B.
  • 0:36 - 0:39
    This brings up the Build Settings window.
  • 0:39 - 0:42
    Our current build target is indicated by the Unity logo.
  • 0:42 - 0:44
    The blue highlight indicates our focus and
  • 0:44 - 0:47
    shows us on the right hand side the build
  • 0:47 - 0:49
    options for the currently selected platform.
  • 0:50 - 0:52
    We want to build to the web player.
  • 0:53 - 0:55
    Our current build target is PC, Mac and
  • 0:55 - 0:57
    Linux Standalone.
  • 0:57 - 1:00
    To change build targets, select the desired platform
  • 1:00 - 1:03
    from the list and click the Switch Platform button
  • 1:03 - 1:05
    at the bottom of the window.
  • 1:06 - 1:08
    Once we have selected our new build target
  • 1:08 - 1:10
    we need to add the scenes we want to build
  • 1:10 - 1:12
    to the Build Settings window.
  • 1:12 - 1:14
    We can add the current scene by clicking the
  • 1:14 - 1:16
    Add Current button.
  • 1:16 - 1:18
    Or we can drag and drop any scene from our
  • 1:18 - 1:20
    project view in to the field at the top of
  • 1:20 - 1:22
    the Build Settings window.
  • 1:23 - 1:25
    It's worth noting that we don't need to
  • 1:25 - 1:27
    include every scene in our project.
  • 1:27 - 1:28
    We only need to include the scenes we
  • 1:28 - 1:30
    we want in our game.
  • 1:30 - 1:32
    It is also possible to perform a build
  • 1:32 - 1:35
    with no scenes in the build Settings window.
  • 1:35 - 1:38
    If we do this, Unity will simply build our game
  • 1:38 - 1:41
    using the current scene we have open for editing.
  • 1:43 - 1:45
    Now we are ready to build our game.
  • 1:45 - 1:47
    Let's return to the Build Settings window
  • 1:47 - 1:48
    and click the Build button.
  • 1:48 - 1:50
    This will bring up a dialogue box asking us
  • 1:50 - 1:52
    to choose a build location.
  • 1:52 - 1:54
    I like to associate my build location with
  • 1:54 - 1:57
    my project, so I will create a new folder
  • 1:57 - 2:00
    inside my project called Builds.
  • 2:00 - 2:02
    This folder must be placed only on the
  • 2:02 - 2:04
    root of our project alongside the
  • 2:04 - 2:06
    assets and library folders.
  • 2:06 - 2:10
    With the build folder selected let's name the build
  • 2:12 - 2:14
    and then click save.
  • 2:15 - 2:17
    Unity will now build the web player and
  • 2:17 - 2:19
    save it to our Builds folder
  • 2:21 - 2:23
    When building a web player Unity creates a
  • 2:23 - 2:25
    folder with the name of our game
  • 2:25 - 2:28
    and in that folder are 2 files.
  • 2:28 - 2:30
    1 is the Unity3D data file,
  • 2:30 - 2:32
    which contains the game data,
  • 2:32 - 2:34
    and an HTML file which holds the code
  • 2:34 - 2:38
    to make a webpage with our game embedded in it.
  • 2:38 - 2:41
    We must have both the data file and the HTML file
  • 2:41 - 2:43
    to run our game in a browser.
  • 2:43 - 2:46
    However we can write a custom HTML file
  • 2:46 - 2:48
    to replace the page build by Unity.
  • 2:48 - 2:50
    It is also possible to create a custom
  • 2:50 - 2:53
    web player template which Unity can use to build
  • 2:53 - 2:55
    that custom page automatically.
  • 2:56 - 2:59
    To run the game open the HTML file.
  • 3:00 - 3:02
    And now we are running a local copy of the
  • 3:02 - 3:04
    game in our browser.
  • 3:06 - 3:08
    To present this to our audience we need
  • 3:08 - 3:10
    to place both the HTML file and the
  • 3:10 - 3:12
    data file up on the internet.
  • 3:12 - 3:14
    I'm going to open an FTP client and
  • 3:14 - 3:17
    place the folder with both the HTML file and
  • 3:17 - 3:20
    the data file in it up on my website.
  • 3:23 - 3:25
    When the folder has been uploaded we can simply
  • 3:25 - 3:27
    enter the address in to our browser
  • 3:27 - 3:29
    and play our game.
  • 3:33 - 3:37
    And, we win!
  • 3:41 - 3:43
    So in these assignments we have learned how to
  • 3:43 - 3:45
    create new game objects,
  • 3:45 - 3:46
    how to position them in the scene,
  • 3:46 - 3:48
    add new components to them,
  • 3:48 - 3:50
    write our own custom behaviours for them
  • 3:50 - 3:52
    using simple scripting.
  • 3:52 - 3:54
    We've seen how to use lights, cameras,
  • 3:54 - 3:56
    colliders, triggers, rigid bodies.
  • 3:56 - 3:58
    We can collect and count objects.
  • 3:58 - 4:00
    Though this is a very simple example
  • 4:00 - 4:02
    it covers a large set of basic
  • 4:02 - 4:06
    subjects important to understanding how to use Unity.
  • 4:06 - 4:08
    For continued learning about Unity
  • 4:08 - 4:10
    check the Learn site for more lessons,
  • 4:10 - 4:12
    assignments and projects.
Title:
(Unity 4) Publishing the game - 07 - Roll-a-ball - Unity Official Tutorials
Description:

more » « less
Duration:
04:12

English subtitles

Revisions