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

Commit 46cb08b

Browse files
committed
upgraded to SpatialOS 11.1.0
1 parent fbd61b7 commit 46cb08b

33 files changed

+991
-1303
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ spatial.log
22
spatialos_worker_packages.json
33
build/
44
logs/
5+
workers/unity/external-default-unityclient.log

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
---
66

7-
*Copyright Improbable Worlds Ltd, 2017*
7+
*Copyright (C) 2017 Improbable Worlds Limited. All rights reserved.*
88

99
- *Accompanying tutorial*: [https://spatialos.improbable.io/docs/reference/latest/tutorials/pirates/lesson1](https://spatialos.improbable.io/docs/reference/latest/tutorials/pirates/lesson1)
1010

snapshots/default.snapshot

-3 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": "11.0.0",
4+
"sdk_version": "11.1.0",
55
"dependencies": [
6-
{"name": "standard_library", "version": "11.0.0"}
6+
{"name": "standard_library", "version": "11.1.0"}
77
]
88
}

workers/unity/Assets/Gamelogic/EntityTemplates/EntityTemplateFactory.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
using System; // Used in lesson 8
2-
using Assets.Gamelogic.Core;
1+
using Assets.Gamelogic.Core;
32
using Improbable.Core;
43
using Improbable.Player;
54
using Improbable.Ship;
65
using Improbable.Unity.Core.Acls;
76
using Improbable.Worker;
87
using Improbable;
98
using Improbable.Unity.Entity;
9+
using Random = UnityEngine.Random; // Used in lesson 2
10+
using System; // Used in lesson 2
1011
using UnityEngine;
11-
using Random = UnityEngine.Random; // Used in lesson 8
1212

1313
namespace Assets.Gamelogic.EntityTemplates
1414
{

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ public class PlayerInputController : MonoBehaviour
2525
void OnEnable()
2626
{
2727
cannonFirer = GetComponent<CannonFirer>();
28-
SceneManager.UnloadSceneAsync(BuildSettings.SplashScreenScene);
2928
}
3029

3130
void Update()

workers/unity/Assets/Gamelogic/UI/CursorHoverEffect.cs

Lines changed: 0 additions & 33 deletions
This file was deleted.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
using UnityEngine;
2+
3+
namespace Assets.Gamelogic.UI
4+
{
5+
public class Spinner : MonoBehaviour
6+
{
7+
[SerializeField] private float rotationAmount = 270.0f;
8+
9+
// Update is called once per frame
10+
void Update()
11+
{
12+
Vector3 rot = transform.rotation.eulerAngles;
13+
rot.z = rot.z + rotationAmount * Time.deltaTime;
14+
if (rot.z > 360)
15+
rot.z -= 360;
16+
else if (rot.z < 360)
17+
rot.z += 360;
18+
19+
transform.eulerAngles = rot;
20+
}
21+
}
22+
}

workers/unity/Assets/Gamelogic/UI/CursorHoverEffect.cs.meta renamed to workers/unity/Assets/Gamelogic/UI/Spinner.cs.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/Gamelogic/UI/SplashScreenController.cs

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,22 @@ public class SplashScreenController : MonoBehaviour
1313
private GameObject NotReadyWarning;
1414
[SerializeField]
1515
private Button ConnectButton;
16+
[SerializeField]
17+
private GameObject Spinner;
1618

1719

1820
public void AttemptToConnect()
1921
{
20-
DisableConnectButton();
21-
AttemptConnection();
22-
}
23-
24-
private void DisableConnectButton()
25-
{
22+
// Disable connect button
2623
ConnectButton.interactable = false;
27-
ConnectButton.GetComponent<CursorHoverEffect>().ShowDefaultCursor();
24+
25+
// Hide warning if already shown
26+
NotReadyWarning.SetActive(false);
27+
28+
// Start loading spinner
29+
Spinner.SetActive(true);
30+
31+
AttemptConnection();
2832
}
2933

3034
private void AttemptConnection()
@@ -35,6 +39,9 @@ private void AttemptConnection()
3539
throw new Exception("Couldn't find Bootstrap script on GameEntry in UnityScene");
3640
}
3741
bootstrap.ConnectToClient();
42+
43+
// In case the client connection is successful this coroutine is destroyed as part of unloading
44+
// the splash screen so ConnectionTimeout won't be called
3845
StartCoroutine(TimerUtils.WaitAndPerform(SimulationSettings.ClientConnectionTimeoutSecs, ConnectionTimeout));
3946
}
4047

@@ -44,6 +51,8 @@ private void ConnectionTimeout()
4451
{
4552
SpatialOS.Disconnect();
4653
}
54+
55+
Spinner.SetActive(false);
4756
NotReadyWarning.SetActive(true);
4857
ConnectButton.interactable = true;
4958
}

0 commit comments

Comments
 (0)