1. 程式人生 > >SpatialOS 在unity中的使用--Get started: 1 - Set up(3)

SpatialOS 在unity中的使用--Get started: 1 - Set up(3)

There are three parts to this step:(包含三個部分)

  • Sign up for a SpatialOS account(註冊 SpatialOS賬號)
  • Set up your machine(裝軟體)
  • Clone the repos(克隆資料)

(This step is the longest of the 6 steps - the others are much quicker.) 
接下來最多會執行六補,其他的要快得多

Sign up for a SpatialOS account, or make sure you are logged in
#
(無腦註冊)

If you have already signed up, make sure you are logged in (you should see your picture in the top right of the page if you are, if not - hit “Sign In”.)

If you have not signed up before, you can do this here
 

Set up your machine#

Setup for Windows(windows平臺部署--以下內容不翻譯)

Step 1. Install Unity 2018.2.8

  • Make sure you download the Installer version, and select the following components during installation:
    • Linux Build Support
    • Mac Build Support

Note: Even though you are developing on a Windows PC, you need:
Linux Build Support

 because all server-workers in a cloud deployment run in a Linux environment. 
Mac Build Support if you want to share your game with end-users on a Mac.
Unity gives you Windows build support by default.

Step 2. Install .NET Core SDK (x64)

  • Verified with versions 2.1.3xx and 2.1.4xx

Note: After installing the .NET Core SDK, you should restart any Unity and Unity Hub processes. This will prevent errors where Unity cannot find the dotnet executable.

Step 3. Run the SpatialOS Installer

Step 4. Install a code editor if you don’t have one already

Using Visual Studio?

As you install Visual Studio, click on the Workloads tab in the Installer. If you already have Visual Studio installed, you can find this by clicking on the More option for Visual Studio Build Tools in the Visual Studio Installer, and selecting Modify from the drop-down menu.

Click Modify to find the Workloads tab.

Once you have navigated to the Workloads tab:

  • Select .NET Core cross-platform development.

  • After selecting Game development with Unity:

    • Deselect any options in the Summary on the right that mention a Unity Editor (for example, Unity 2017.2 64-bit Editor or Unity 2018.1 64-bit Editor).
    • The SpatialOS GDK for Unity requires Unity 2018.2.8, which should already be installed if you have followed the setup guide correctly.
    • Make sure Visual Studio Tools for Unity is included (there should be a tick next to it).

Warning: Older versions of Visual Studio 2017 have been known to cause some issues with Unity 2018.2.8 - the issues are projects loading and unloading frequently, and Intellisense breaking. If you do experience these issues, try updating to a newer version of Visual Studio 2017.

Using Rider?

Once you have installed Rider, install the Unity Support plugin for a better experience.

Setup for Mac(Mac平臺部署--以下內容不翻譯)

Step 1. Install Unity 2018.2.8

  • Make sure to download the Installer version, and select the following components during installation:
    • Linux Build Support
    • Windows Build Support

Note: Even though you are developing on a Mac, you need:
Linux Build Support because all server-workers in a cloud deployment run in a Linux environment. 
Windows Build Support if you want to share your game with end-users on a Windows PC.
Unity gives you Mac build support by default.

Step 2. Install .NET Core SDK (x64)

  • Verified with versions 2.1.3xx and 2.1.4xx

Note: After installing the .NET Core SDK, you should restart any Unity and Unity Hub processes. This will prevent errors where Unity cannot find the dotnet executable.

Step 3. Run the SpatialOS installer

Step 4. Install a code editor if you don’t have one already

Using Visual Studio?

Once you have installed Visual Studio, within the Visual Studio Installer, select .NET Core + ASP .NET Core.

Using Rider?

Once you have installed Rider, install the Unity Support plugin for a better experience.

  • You need Linux build support. This is because server-workers in a cloud deployment run in a Linux environment. In the Assets/Fps/Config/BuildConfiguration, do not change the UnityGameLogic Cloud Environment from Linux.
  • You need Mac build support if you are developing on a Windows PC and want to share your game with Mac users.
  • You need Windows build support if you are developing on a Mac and want to share your game with Windows PC users. 
  • Unity gives you build support for your development machine (Windows or Mac) by default.

If you need help using the GDK, come and talk to us about the software and the documentation via:

  • The SpatialOS forums - Visit the support section in our forums and use the unity-gdk tag.
  • Discord - Find us in the #unity channel. You may need to grab Discord here.
  • Github issues - Create an issue in this repository. 
     

Clone the repos#(克隆資料到本地  以下內容通過git完成)

You need to clone two repositories; the FPS Starter Project and the GDK for Unity.

Clone the FPS Starter Project repository#

Clone the FPS starter project using one of the following commands:

   
SSH git clone [email protected]:spatialos/gdk-for-unity-fps-starter-project.git
HTTPS git clone https://github.com/spatialos/gdk-for-unity-fps-starter-project.git

Then navigate to the root folder of the FPS starter project and run the following command: git checkout 0.1.1

This ensures that you are on the alpha release version of the FPS starter project.

Clone the GDK for Unity and checkout the latest release#

You can use scripts to automatically do this or follow manual instructions.

  • To use the scripts:
    From the root of the gdk-for-unity-fps-starter-project repository:
    • If you are using Windows run: powershell scripts/powershell/setup.ps1
    • If you are using Mac run: bash scripts/shell/setup.sh
  • To follow manual instructions, see below:

 

Manually clone the GDK

  1. Clone the GDK for Unity repository alongside the FPS Starter Project so that they sit side-by-side:

 

| | | | — | — | | SSH | git clone [email protected]:spatialos/gdk-for-unity.git | | HTTPS | git clone https://github.com/spatialos/gdk-for-unity.git | > The two repositories should share a common parent, like the example below:

Copy   <common_parent_directory>
      ├── gdk-for-unity-fps-starter-project
      ├── gdk-for-unity

 

  1. Navigate to the gdk-for-unity directory and checkout the pinned version which you can find in the gdk.pinned file, in the root of the gdk-for-unity-fps-starter-project directory.

     

     

    • git checkout <pinned_version>