Skip to content
This repository has been archived by the owner on Jan 18, 2022. It is now read-only.

Commit

Permalink
UTY-2647: bad sync point in ecs view manager (#1430)
Browse files Browse the repository at this point in the history
* fix codege, lookup components from SpatialOSReceiveSystem

* use explicit system

* Update CHANGELOG.md

* Update CHANGELOG.md

* Update CHANGELOG.md
  • Loading branch information
BryanJY-Wong committed Aug 3, 2020
1 parent 146d34a commit 384d61c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- Fixed an `IndexOutOfRangeException` that could be thrown when editing your 'Build Configuration' asset. [#1441](https://github.com/spatialos/gdk-for-unity/pull/1441)
- The 'Build Configuration' Inspector window will no longer report your Android SDK installation as missing if you have a completely fresh Unity installation with the bundled Android SDK. [#1441](https://github.com/spatialos/gdk-for-unity/pull/1441)
- Fixed a bug where having spaces in the path to your project would cause the 'Local launch' and 'Launch standalone client' menu options to fail on MacOS. [#1442](https://github.com/spatialos/gdk-for-unity/pull/1442)
- Fixed a faulty sync point caused by using `ComponentDataFromEntity` of the `WorkerSystem`. [#1430](https://github.com/spatialos/gdk-for-unity/pull/1430)

### Internal

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public static CodeWriter Generate(UnityComponentDetails componentDetails)
{
evm.Line($@"
private WorkerSystem workerSystem;
private SpatialOSReceiveSystem spatialOSReceiveSystem;
private EntityManager entityManager;
private readonly ComponentType[] initialComponents = new ComponentType[]
Expand Down Expand Up @@ -63,7 +64,7 @@ public void ApplyDiff(ViewDiff diff)
}
var updates = diffStorage.GetUpdates();
var dataFromEntity = workerSystem.GetComponentDataFromEntity<Component>();
var dataFromEntity = spatialOSReceiveSystem.GetComponentDataFromEntity<Component>();
for (int i = 0; i < updates.Count; ++i)
{
ApplyUpdate(in updates[i], dataFromEntity);
Expand Down Expand Up @@ -92,6 +93,13 @@ public void Init(World world)
{
throw new ArgumentException(""World instance is not running a valid SpatialOS worker"");
}
spatialOSReceiveSystem = world.GetExistingSystem<SpatialOSReceiveSystem>();
if (spatialOSReceiveSystem == null)
{
throw new ArgumentException(""Could not find SpatialOS Receive System in the current world instance"");
}
}
");
evm.Method("public void Clean()", m =>
Expand Down

0 comments on commit 384d61c

Please sign in to comment.