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

Commit 2a89bb4

Browse files
committed
upgraded to SpatialOS 10.3.3 + visual update
1 parent 74195f1 commit 2a89bb4

File tree

641 files changed

+91573
-1903
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

641 files changed

+91573
-1903
lines changed

snapshots/default.snapshot

574 Bytes
Binary file not shown.

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.3.3",
4+
"sdk_version": "10.4.0-rc-06",
55
"dependencies": [
6-
{"name": "WorkerSdkSchema", "version": "10.3.3"}
6+
{"name": "WorkerSdkSchema", "version": "10.4.0-rc-06"}
77
]
88
}

workers/unity/Assets/Editor/SnapshotMenu.cs

Lines changed: 51 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,64 @@
66
using System.Collections.Generic;
77
using System.IO;
88
using UnityEditor;
9+
using Improbable.Math;
10+
using Random = UnityEngine.Random;
911
using UnityEngine;
1012

1113
namespace Assets.Editor
1214
{
13-
public class SnapshotMenu : MonoBehaviour
14-
{
15-
[MenuItem("Improbable/Snapshots/Generate Default Snapshot")]
16-
[UsedImplicitly]
17-
private static void GenerateDefaultSnapshot()
18-
{
19-
var snapshotEntities = new Dictionary<EntityId, SnapshotEntity>();
20-
var currentEntityId = 1;
15+
public class SnapshotMenu : MonoBehaviour
16+
{
17+
[MenuItem("Improbable/Snapshots/Generate Default Snapshot")]
18+
[UsedImplicitly]
19+
private static void GenerateDefaultSnapshot()
20+
{
21+
var snapshotEntities = new Dictionary<EntityId, SnapshotEntity>();
22+
var currentEntityId = 1;
2123

22-
snapshotEntities.Add(new EntityId(currentEntityId++), EntityTemplateFactory.CreateTerrainTemplate());
23-
snapshotEntities.Add(new EntityId(currentEntityId++), EntityTemplateFactory.CreatePlayerCreatorTemplate());
24+
snapshotEntities.Add(new EntityId(currentEntityId++), EntityTemplateFactory.CreatePlayerCreatorTemplate());
25+
PopulateSnapshotWithIslandTerrainEntities(ref snapshotEntities, ref currentEntityId);
26+
PopulateSnapshotWithSmallFishGroups(ref snapshotEntities, ref currentEntityId);
27+
PopulateSnapshotWithLargeFish(ref snapshotEntities, ref currentEntityId);
2428

25-
SaveSnapshot(snapshotEntities);
26-
}
29+
SaveSnapshot(snapshotEntities);
30+
}
31+
32+
// Create and island entity for each island prefab at its given world coordinates
33+
public static void PopulateSnapshotWithIslandTerrainEntities(ref Dictionary<EntityId, SnapshotEntity> snapshotEntities, ref int nextAvailableId)
34+
{
35+
foreach(var item in SimulationSettings.IslandsEntityPlacements)
36+
{
37+
snapshotEntities.Add(new EntityId(nextAvailableId++),
38+
EntityTemplateFactory.GenerateIslandEntityTemplate(item.Value, item.Key));
39+
}
40+
}
41+
42+
// Create shoal of small fish entities around given coordinates
43+
public static void PopulateSnapshotWithSmallFishGroups(ref Dictionary<EntityId, SnapshotEntity> snapshotEntities, ref int nextAvailableId)
44+
{
45+
foreach (var location in SimulationSettings.FishShoalStartingLocations)
46+
{
47+
for (var i = 0; i < SimulationSettings.TotalFishInShoal; i++)
48+
{
49+
var nextFishCoodinates = new Coordinates(location.X + Random.Range(-SimulationSettings.ShoalRadius, SimulationSettings.ShoalRadius),
50+
location.Y + Random.Range(SimulationSettings.ShoalMinDepth, SimulationSettings.ShoalMaxDepth),
51+
location.Z + Random.Range(-SimulationSettings.ShoalRadius, SimulationSettings.ShoalRadius));
52+
snapshotEntities.Add(new EntityId(nextAvailableId++), EntityTemplateFactory.GenerateSmallFishTemplate(nextFishCoodinates));
53+
}
54+
}
55+
}
56+
57+
// Create large fish entities
58+
public static void PopulateSnapshotWithLargeFish(ref Dictionary<EntityId, SnapshotEntity> snapshotEntities, ref int nextAvailableId)
59+
{
60+
foreach (var location in SimulationSettings.LargeFishStartingLocations)
61+
{
62+
snapshotEntities.Add(new EntityId(nextAvailableId++), EntityTemplateFactory.GenerateLargeFishTemplate(location));
63+
}
64+
}
2765

28-
private static void SaveSnapshot(IDictionary<EntityId, SnapshotEntity> snapshotEntities)
66+
private static void SaveSnapshot(IDictionary<EntityId, SnapshotEntity> snapshotEntities)
2967
{
3068
File.Delete(SimulationSettings.DefaultSnapshotPath);
3169
var maybeError = Snapshot.Save(SimulationSettings.DefaultSnapshotPath, snapshotEntities);
Lines changed: 300 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,300 @@
1+
%YAML 1.1
2+
%TAG !u! tag:unity3d.com,2011:
3+
--- !u!1001 &100100000
4+
Prefab:
5+
m_ObjectHideFlags: 1
6+
serializedVersion: 2
7+
m_Modification:
8+
m_TransformParent: {fileID: 0}
9+
m_Modifications: []
10+
m_RemovedComponents: []
11+
m_ParentPrefab: {fileID: 0}
12+
m_RootGameObject: {fileID: 1189870710501702}
13+
m_IsPrefabParent: 1
14+
--- !u!1 &1189870710501702
15+
GameObject:
16+
m_ObjectHideFlags: 0
17+
m_PrefabParentObject: {fileID: 0}
18+
m_PrefabInternal: {fileID: 100100000}
19+
serializedVersion: 5
20+
m_Component:
21+
- component: {fileID: 4012785774531300}
22+
- component: {fileID: 114271667345414926}
23+
m_Layer: 0
24+
m_Name: Island_01
25+
m_TagString: Island
26+
m_Icon: {fileID: 0}
27+
m_NavMeshLayer: 0
28+
m_StaticEditorFlags: 0
29+
m_IsActive: 1
30+
--- !u!1 &1318909315712134
31+
GameObject:
32+
m_ObjectHideFlags: 0
33+
m_PrefabParentObject: {fileID: 0}
34+
m_PrefabInternal: {fileID: 100100000}
35+
serializedVersion: 5
36+
m_Component:
37+
- component: {fileID: 4791457829712726}
38+
- component: {fileID: 95657397933551932}
39+
m_Layer: 0
40+
m_Name: island_large_01_details
41+
m_TagString: Untagged
42+
m_Icon: {fileID: 0}
43+
m_NavMeshLayer: 0
44+
m_StaticEditorFlags: 0
45+
m_IsActive: 1
46+
--- !u!1 &1457680537690610
47+
GameObject:
48+
m_ObjectHideFlags: 1
49+
m_PrefabParentObject: {fileID: 0}
50+
m_PrefabInternal: {fileID: 100100000}
51+
serializedVersion: 5
52+
m_Component:
53+
- component: {fileID: 4541270163102262}
54+
- component: {fileID: 33851629033439770}
55+
- component: {fileID: 23498416790102988}
56+
m_Layer: 0
57+
m_Name: island_large_01_details
58+
m_TagString: Untagged
59+
m_Icon: {fileID: 0}
60+
m_NavMeshLayer: 0
61+
m_StaticEditorFlags: 0
62+
m_IsActive: 1
63+
--- !u!1 &1619518254829634
64+
GameObject:
65+
m_ObjectHideFlags: 1
66+
m_PrefabParentObject: {fileID: 0}
67+
m_PrefabInternal: {fileID: 100100000}
68+
serializedVersion: 5
69+
m_Component:
70+
- component: {fileID: 4682800991617828}
71+
- component: {fileID: 33653991210650194}
72+
- component: {fileID: 23425465332809596}
73+
m_Layer: 0
74+
m_Name: island_large_01
75+
m_TagString: Untagged
76+
m_Icon: {fileID: 0}
77+
m_NavMeshLayer: 0
78+
m_StaticEditorFlags: 0
79+
m_IsActive: 1
80+
--- !u!1 &1794565138384874
81+
GameObject:
82+
m_ObjectHideFlags: 0
83+
m_PrefabParentObject: {fileID: 0}
84+
m_PrefabInternal: {fileID: 100100000}
85+
serializedVersion: 5
86+
m_Component:
87+
- component: {fileID: 4887753103275932}
88+
- component: {fileID: 95152246669946646}
89+
- component: {fileID: 64228982036698322}
90+
m_Layer: 0
91+
m_Name: island_large_01
92+
m_TagString: Untagged
93+
m_Icon: {fileID: 0}
94+
m_NavMeshLayer: 0
95+
m_StaticEditorFlags: 0
96+
m_IsActive: 1
97+
--- !u!4 &4012785774531300
98+
Transform:
99+
m_ObjectHideFlags: 1
100+
m_PrefabParentObject: {fileID: 0}
101+
m_PrefabInternal: {fileID: 100100000}
102+
m_GameObject: {fileID: 1189870710501702}
103+
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
104+
m_LocalPosition: {x: 0, y: 0, z: 0}
105+
m_LocalScale: {x: 1, y: 1, z: 1}
106+
m_Children:
107+
- {fileID: 4887753103275932}
108+
- {fileID: 4791457829712726}
109+
m_Father: {fileID: 0}
110+
m_RootOrder: 0
111+
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
112+
--- !u!4 &4541270163102262
113+
Transform:
114+
m_ObjectHideFlags: 1
115+
m_PrefabParentObject: {fileID: 0}
116+
m_PrefabInternal: {fileID: 100100000}
117+
m_GameObject: {fileID: 1457680537690610}
118+
m_LocalRotation: {x: 0, y: -0, z: -0, w: 1}
119+
m_LocalPosition: {x: -0, y: 0, z: 0}
120+
m_LocalScale: {x: 1, y: 1, z: 1}
121+
m_Children: []
122+
m_Father: {fileID: 4791457829712726}
123+
m_RootOrder: 0
124+
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
125+
--- !u!4 &4682800991617828
126+
Transform:
127+
m_ObjectHideFlags: 1
128+
m_PrefabParentObject: {fileID: 0}
129+
m_PrefabInternal: {fileID: 100100000}
130+
m_GameObject: {fileID: 1619518254829634}
131+
m_LocalRotation: {x: 0, y: -0, z: -0, w: 1}
132+
m_LocalPosition: {x: -0, y: 0, z: 0}
133+
m_LocalScale: {x: 1, y: 1, z: 1}
134+
m_Children: []
135+
m_Father: {fileID: 4887753103275932}
136+
m_RootOrder: 0
137+
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
138+
--- !u!4 &4791457829712726
139+
Transform:
140+
m_ObjectHideFlags: 1
141+
m_PrefabParentObject: {fileID: 0}
142+
m_PrefabInternal: {fileID: 100100000}
143+
m_GameObject: {fileID: 1318909315712134}
144+
m_LocalRotation: {x: 0, y: -0, z: -0, w: 1}
145+
m_LocalPosition: {x: -0, y: 0, z: 0}
146+
m_LocalScale: {x: 1, y: 1, z: 1}
147+
m_Children:
148+
- {fileID: 4541270163102262}
149+
m_Father: {fileID: 4012785774531300}
150+
m_RootOrder: 1
151+
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
152+
--- !u!4 &4887753103275932
153+
Transform:
154+
m_ObjectHideFlags: 1
155+
m_PrefabParentObject: {fileID: 0}
156+
m_PrefabInternal: {fileID: 100100000}
157+
m_GameObject: {fileID: 1794565138384874}
158+
m_LocalRotation: {x: 0, y: -0, z: -0, w: 1}
159+
m_LocalPosition: {x: -0, y: 0, z: 0}
160+
m_LocalScale: {x: 1, y: 1, z: 1}
161+
m_Children:
162+
- {fileID: 4682800991617828}
163+
m_Father: {fileID: 4012785774531300}
164+
m_RootOrder: 0
165+
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
166+
--- !u!23 &23425465332809596
167+
MeshRenderer:
168+
m_ObjectHideFlags: 1
169+
m_PrefabParentObject: {fileID: 0}
170+
m_PrefabInternal: {fileID: 100100000}
171+
m_GameObject: {fileID: 1619518254829634}
172+
m_Enabled: 1
173+
m_CastShadows: 1
174+
m_ReceiveShadows: 1
175+
m_MotionVectors: 1
176+
m_LightProbeUsage: 1
177+
m_ReflectionProbeUsage: 1
178+
m_Materials:
179+
- {fileID: 2100000, guid: 0d7e070f2e75a8e4e9577f403a2b2f7a, type: 2}
180+
m_StaticBatchInfo:
181+
firstSubMesh: 0
182+
subMeshCount: 0
183+
m_StaticBatchRoot: {fileID: 0}
184+
m_ProbeAnchor: {fileID: 0}
185+
m_LightProbeVolumeOverride: {fileID: 0}
186+
m_ScaleInLightmap: 1
187+
m_PreserveUVs: 0
188+
m_IgnoreNormalsForChartDetection: 0
189+
m_ImportantGI: 0
190+
m_SelectedEditorRenderState: 3
191+
m_MinimumChartSize: 4
192+
m_AutoUVMaxDistance: 0.5
193+
m_AutoUVMaxAngle: 89
194+
m_LightmapParameters: {fileID: 0}
195+
m_SortingLayerID: 0
196+
m_SortingOrder: 0
197+
--- !u!23 &23498416790102988
198+
MeshRenderer:
199+
m_ObjectHideFlags: 1
200+
m_PrefabParentObject: {fileID: 0}
201+
m_PrefabInternal: {fileID: 100100000}
202+
m_GameObject: {fileID: 1457680537690610}
203+
m_Enabled: 1
204+
m_CastShadows: 1
205+
m_ReceiveShadows: 1
206+
m_MotionVectors: 1
207+
m_LightProbeUsage: 1
208+
m_ReflectionProbeUsage: 1
209+
m_Materials:
210+
- {fileID: 2100000, guid: fbcc366caf33f2a4d98980560841a0c2, type: 2}
211+
m_StaticBatchInfo:
212+
firstSubMesh: 0
213+
subMeshCount: 0
214+
m_StaticBatchRoot: {fileID: 0}
215+
m_ProbeAnchor: {fileID: 0}
216+
m_LightProbeVolumeOverride: {fileID: 0}
217+
m_ScaleInLightmap: 1
218+
m_PreserveUVs: 0
219+
m_IgnoreNormalsForChartDetection: 0
220+
m_ImportantGI: 0
221+
m_SelectedEditorRenderState: 3
222+
m_MinimumChartSize: 4
223+
m_AutoUVMaxDistance: 0.5
224+
m_AutoUVMaxAngle: 89
225+
m_LightmapParameters: {fileID: 0}
226+
m_SortingLayerID: 0
227+
m_SortingOrder: 0
228+
--- !u!33 &33653991210650194
229+
MeshFilter:
230+
m_ObjectHideFlags: 1
231+
m_PrefabParentObject: {fileID: 0}
232+
m_PrefabInternal: {fileID: 100100000}
233+
m_GameObject: {fileID: 1619518254829634}
234+
m_Mesh: {fileID: 4300000, guid: b3a24ec60f3eeef47b6878a9042052fd, type: 3}
235+
--- !u!33 &33851629033439770
236+
MeshFilter:
237+
m_ObjectHideFlags: 1
238+
m_PrefabParentObject: {fileID: 0}
239+
m_PrefabInternal: {fileID: 100100000}
240+
m_GameObject: {fileID: 1457680537690610}
241+
m_Mesh: {fileID: 4300000, guid: 625a4a06d50f43e43be0512e430d407f, type: 3}
242+
--- !u!64 &64228982036698322
243+
MeshCollider:
244+
m_ObjectHideFlags: 1
245+
m_PrefabParentObject: {fileID: 0}
246+
m_PrefabInternal: {fileID: 100100000}
247+
m_GameObject: {fileID: 1794565138384874}
248+
m_Material: {fileID: 0}
249+
m_IsTrigger: 0
250+
m_Enabled: 1
251+
serializedVersion: 2
252+
m_Convex: 0
253+
m_InflateMesh: 0
254+
m_SkinWidth: 0.01
255+
m_Mesh: {fileID: 4300000, guid: 4923aa448f756a84f83f6296a801d61c, type: 3}
256+
--- !u!95 &95152246669946646
257+
Animator:
258+
serializedVersion: 3
259+
m_ObjectHideFlags: 1
260+
m_PrefabParentObject: {fileID: 0}
261+
m_PrefabInternal: {fileID: 100100000}
262+
m_GameObject: {fileID: 1794565138384874}
263+
m_Enabled: 1
264+
m_Avatar: {fileID: 9000000, guid: b3a24ec60f3eeef47b6878a9042052fd, type: 3}
265+
m_Controller: {fileID: 0}
266+
m_CullingMode: 0
267+
m_UpdateMode: 0
268+
m_ApplyRootMotion: 0
269+
m_LinearVelocityBlending: 0
270+
m_WarningMessage:
271+
m_HasTransformHierarchy: 1
272+
m_AllowConstantClipSamplingOptimization: 1
273+
--- !u!95 &95657397933551932
274+
Animator:
275+
serializedVersion: 3
276+
m_ObjectHideFlags: 1
277+
m_PrefabParentObject: {fileID: 0}
278+
m_PrefabInternal: {fileID: 100100000}
279+
m_GameObject: {fileID: 1318909315712134}
280+
m_Enabled: 1
281+
m_Avatar: {fileID: 9000000, guid: 625a4a06d50f43e43be0512e430d407f, type: 3}
282+
m_Controller: {fileID: 0}
283+
m_CullingMode: 0
284+
m_UpdateMode: 0
285+
m_ApplyRootMotion: 0
286+
m_LinearVelocityBlending: 0
287+
m_WarningMessage:
288+
m_HasTransformHierarchy: 1
289+
m_AllowConstantClipSamplingOptimization: 1
290+
--- !u!114 &114271667345414926
291+
MonoBehaviour:
292+
m_ObjectHideFlags: 1
293+
m_PrefabParentObject: {fileID: 0}
294+
m_PrefabInternal: {fileID: 100100000}
295+
m_GameObject: {fileID: 1189870710501702}
296+
m_Enabled: 1
297+
m_EditorHideFlags: 0
298+
m_Script: {fileID: 11500000, guid: a6fafd46819d7b64eb2eec65e1cb4b79, type: 3}
299+
m_Name:
300+
m_EditorClassIdentifier:

workers/unity/Assets/GameResources/Terrain/First Terrain.asset.meta renamed to workers/unity/Assets/EntityPrefabs/Island_01.prefab.meta

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

0 commit comments

Comments
 (0)