Skip to content
This repository was archived by the owner on Dec 5, 2018. It is now read-only.

Commit 40e939e

Browse files
committed
upgraded to SpatialOS 10.3.0
1 parent 6183408 commit 40e939e

File tree

13 files changed

+101
-16
lines changed

13 files changed

+101
-16
lines changed

README.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Starter Project
22
---
33

4-
*Copyright Improbable Worlds Ltd, 2017*
4+
*Copyright Improbable 2017*
55

6-
- *GitHub repository*: [https://github.com/spatialos/StarterProject](https://github.com/spatialos/StarterProject)
6+
- *GitHub Repository*: [github.com/spatialos/StarterProject](https://github.com/spatialos/StarterProject)
77

88
---
99

@@ -13,14 +13,12 @@ This is a SpatialOS starter project with useful core features that you can exten
1313

1414
It contains:
1515

16-
* A Player spawned on client connection as per the [Unity Client Lifecycle Guide](https://spatialos.improbable.io/docs/reference/latest/tutorials/client-lifecycle).
17-
* A Cube spawned through a snapshot via an entity template method and an Unity prefab.
18-
* The rest of the features included in the [BlankProject](https://github.com/spatialos/BlankProject).
16+
* A Player spawned on client connection as per the [Unity Client Lifecycle Guide](link.com) .
17+
* A Cube spawned through a snapshot via an entity template method and Unity prefab.
18+
* Other features of the [BlankProject](https://github.com/spatialos/BlankProject).
1919

20-
If you run into problems, or want to give us feedback, please visit the [SpatialOS forums](https://forums.improbable.io/).
20+
## Using the Starter Project
2121

22-
## Running the project
22+
[SpatialOS documentation](https://spatialos.improbable.io/docs/).
2323

24-
To run the project locally, first build it by running `spatial worker build`, then start the server with `spatial local start`. You can connect a client by opening the Unity project and pressing the play button, or by running `spatial local worker launch UnityClient default`. See the [documentation](https://spatialos.improbable.io/docs/reference/latest/developing/local/run) for more details.
25-
26-
To deploy the project to the cloud, first build it by running `spatial worker build -t=deployment`, then upload the assembly with `spatial cloud upload <assembly name>`, and finally deploy it with `spatial cloud launch <assembly name> <launch configuration file> <deployment name> --snapshot=<snapshot file>`. You can obtain and share links to connect to the deployment from the [console](http://console.improbable.io/projects). See the [documentation](https://spatialos.improbable.io/docs/reference/latest/developing/deploy-an-application) for more details.
24+
To report bugs or to give feedback on this project, please contact SpatialOS Support.

spatialos.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "your_project_name_here",
33
"project_version": "1.0.0",
4-
"sdk_version": "10.2.0",
4+
"sdk_version": "10.3.0",
55
"dependencies": [
6-
{"name": "WorkerSdkSchema", "version": "10.2.0"}
6+
{"name": "WorkerSdkSchema", "version": "10.3.0"}
77
]
88
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
using System;
2+
using System.IO;
3+
using System.Linq;
4+
using Assets.Gamelogic.Global;
5+
using Improbable.Unity;
6+
using UnityEditor;
7+
using Improbable.Unity.EditorTools.Build;
8+
9+
namespace Assets.Editor
10+
{
11+
[InitializeOnLoad]
12+
public class PlayerBuildProcess : IPlayerBuildEvents
13+
{
14+
#region Implement IPlayerBuildEvents
15+
16+
public string[] GetScenes(WorkerPlatform workerType)
17+
{
18+
switch (workerType)
19+
{
20+
case WorkerPlatform.UnityClient:
21+
return FormatSceneList(BuildSettings.ClientScenes, BuildSettings.ClientDefaultActiveScene);
22+
case WorkerPlatform.UnityWorker:
23+
return FormatSceneList(BuildSettings.WorkerScenes, BuildSettings.WorkerDefaultActiveScene);
24+
default:
25+
throw new Exception("Attempting to get scenes for unrecognised worker platform");
26+
}
27+
}
28+
29+
private string[] FormatSceneList(string[] sceneList, string defaultActiveScene)
30+
{
31+
return sceneList.OrderBy(scene => scene != defaultActiveScene).Select(FormatSceneName).ToArray();
32+
}
33+
34+
private string FormatSceneName(string sceneName)
35+
{
36+
return Path.Combine(BuildSettings.SceneDirectory, sceneName) + ".unity";
37+
}
38+
39+
public void BeginBuild() { }
40+
41+
public void EndBuild() { }
42+
43+
public void BeginPackage(WorkerPlatform workerType, BuildTarget target, Config config, string packagePath) { }
44+
45+
#endregion
46+
47+
static PlayerBuildProcess()
48+
{
49+
SimpleBuildSystem.CreatePlayerBuildEventsAction = () => new PlayerBuildProcess();
50+
}
51+
}
52+
}

workers/unity/Assets/Editor/PlayerBuildProcess.cs.meta

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+

2+
public static class BuildSettings
3+
{
4+
public static readonly string UnityClientScene = "UnityClient";
5+
public static readonly string UnityWorkerScene = "UnityWorker";
6+
public static readonly string[] ClientScenes = { UnityClientScene };
7+
public static readonly string[] WorkerScenes = { UnityWorkerScene };
8+
public static readonly string ClientDefaultActiveScene = UnityClientScene;
9+
public static readonly string WorkerDefaultActiveScene = UnityWorkerScene;
10+
public const string SceneDirectory = "Assets";
11+
}

workers/unity/Assets/Gamelogic/Global/BuildSettings.cs.meta

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

workers/unity/Assets/Plugins.meta

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

workers/unity/Assets/Resources/EntityPrefabs.meta

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
File renamed without changes.

0 commit comments

Comments
 (0)