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

Commit fb4ec1a

Browse files
committed
upgraded to SpatialOS 10.4.1
1 parent a71504f commit fb4ec1a

File tree

10 files changed

+960
-1178
lines changed

10 files changed

+960
-1178
lines changed

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

workers/unity/.vs/config/applicationhost.config

Lines changed: 0 additions & 1019 deletions
This file was deleted.

workers/unity/Assets/Editor/SnapshotMenu.cs

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -64,18 +64,19 @@ public static void PopulateSnapshotWithLargeFish(ref Dictionary<EntityId, Snapsh
6464
}
6565

6666
private static void SaveSnapshot(IDictionary<EntityId, SnapshotEntity> snapshotEntities)
67-
{
68-
File.Delete(SimulationSettings.DefaultSnapshotPath);
69-
var maybeError = Snapshot.Save(SimulationSettings.DefaultSnapshotPath, snapshotEntities);
67+
{
68+
var snapshotPath = Application.dataPath + SimulationSettings.DefaultRelativeSnapshotPath;
69+
File.Delete(snapshotPath);
70+
var maybeError = Snapshot.Save(snapshotPath, snapshotEntities);
7071

71-
if (maybeError.HasValue)
72-
{
73-
Debug.LogErrorFormat("Failed to generate initial world snapshot: {0}", maybeError.Value);
74-
}
75-
else
76-
{
77-
Debug.LogFormat("Successfully generated initial world snapshot at {0}", SimulationSettings.DefaultSnapshotPath);
78-
}
79-
}
80-
}
72+
if (maybeError.HasValue)
73+
{
74+
Debug.LogErrorFormat("Failed to generate initial world snapshot: {0}", maybeError.Value);
75+
}
76+
else
77+
{
78+
Debug.LogFormat("Successfully generated initial world snapshot at {0}", snapshotPath);
79+
}
80+
}
81+
}
8182
}

workers/unity/Assets/EntityPrefabs/PirateShip.prefab

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,4 +357,4 @@ CapsuleCollider:
357357
m_Radius: 0.6
358358
m_Height: 4
359359
m_Direction: 2
360-
m_Center: {x: 0, y: 0.25, z: -0.35}
360+
m_Center: {x: 0, y: 0.5, z: -0.35}

workers/unity/Assets/EntityPrefabs/PlayerShip.prefab

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,4 +635,4 @@ CapsuleCollider:
635635
m_Radius: 0.6
636636
m_Height: 4
637637
m_Direction: 2
638-
m_Center: {x: 0, y: 0.25, z: -0.35}
638+
m_Center: {x: 0, y: 0.5, z: -0.35}

workers/unity/Assets/Gamelogic/Core/PlayerCreatingBehaviour.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ private void OnFailedReservation(ICommandErrorDetails response, string clientWor
4747

4848
private void CreatePlayer(string clientWorkerId, EntityId entityId)
4949
{
50-
var playerEntityTemplate = EntityTemplateFactory.CreatePlayerShipTemplate(clientWorkerId, Coordinates.ZERO);
50+
// Initial position is slightly randomised to prevent colliders interpenetrating at start
51+
var initialPosition = new Coordinates(Random.Range(-1f, 1f), 0, Random.Range(-1f, 1f));
52+
var playerEntityTemplate = EntityTemplateFactory.CreatePlayerShipTemplate(clientWorkerId, initialPosition);
5153
SpatialOS.Commands.CreateEntity(PlayerCreationWriter, entityId, SimulationSettings.PlayerShipPrefabName, playerEntityTemplate)
5254
.OnFailure(failure => OnFailedPlayerCreation(failure, clientWorkerId, entityId));
5355
}

workers/unity/Assets/Gamelogic/Core/SimulationSettings.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ public static class SimulationSettings
3232
public static readonly float PlayerEntityCreationRetrySecs = 4;
3333

3434
// Snapshot
35-
public static readonly string DefaultSnapshotPath = Application.dataPath +
36-
"/../../../snapshots/default.snapshot";
35+
public static readonly string DefaultRelativeSnapshotPath = "/../../../snapshots/default.snapshot";
3736

3837
// Island placements (prefab name and coordinate location)
3938
public static readonly Dictionary<string, Coordinates> IslandsEntityPlacements =

workers/unity/Assets/Gamelogic/Pirates/Behaviours/SinkingBehaviour.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ private void OnDisable()
2222
private void VisualiseSinking()
2323
{
2424
SinkingAnimation.Play();
25-
ShipWashVfx.SetActive(false);
25+
if (ShipWashVfx != null)
26+
{
27+
ShipWashVfx.SetActive(false);
28+
}
2629
}
2730
}
2831
}

workers/unity/Assets/Gamelogic/Pirates/Cannons/CannonFirer.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,5 @@ private void Start()
1212
// Cache entity's cannon gameobject
1313
cannon = gameObject.GetComponent<Cannon>();
1414
}
15-
16-
private void FireCannon(Vector3 direction)
17-
{
18-
cannon.Fire(direction);
19-
}
2015
}
2116
}

0 commit comments

Comments
 (0)