This repository was archived by the owner on Jan 18, 2022. It is now read-only.
GDK for Unity Alpha Release 0.2.0
This release contains major breaking changes to the Core ECS and MonoBehaviour APIs, based on feedback and learnings from 0.1.x releases. There are some performance improvements out-of-the-box, with the ability to isolate and disable reactive components for further gains.
Keep giving us your feedback and/or suggestions! Check out our Discord, our forums, or here in the Github issues!
For more information, have a browse through our detailed release notes below! 🎉
Breaking Changes
- Changed the format of the BuildConfiguration asset. Please recreate, or copy it from
workers/unity/Playground/Assets/Config/BuildConfiguration.asset. - Command request and responses are no longer constructed from static methods
CreateRequestandCreateResponse. Instead, they are constructors that take the same arguments. - The
Requireattribute has moved from theImprobable.Gdk.GameObjectRepresentationnamespace to theImprobable.Gdk.Subscriptionsnamespace. - The generated Readers have been renamed from
{COMPONENT_NAME}.Requirable.Readerto{COMPONENT_NAME}Reader. - The Reader callback events' names have changed.
On{EVENT_NAME}is nowOn{EVENT_NAME}Event.{FIELD_NAME}Updatedis nowOn{FIELD_NAME}Update.
- The generated Writers have been renamed from
{COMPONENT_NAME}.Requirable.Writerto{COMPONENT_NAME}Writer. - The Writer send method names have changed.
Send{EVENT_NAME}is nowSend{EVENT_NAME}Event.Sendis nowSendUpdate.
- The generated command senders in MonoBehaviours have also changed.
{COMPONENT_NAME}.Requirable.CommandRequestSenderand{COMPONENT_NAME}.Requirable.CommandResponseHandlerhave been combined and are now called{COMPONENT_NAME}CommandSender.{COMPONENT_NAME}.Requirable.CommandRequestHandleris now called{COMPONENT_NAME}CommandReceiver.
- When creating GameObjects, the
IEntityGameObjectCreator.OnEntityCreatedsignature has changed fromGameObject OnEntityCreated(SpatialOSEntity entity)tovoid OnEntityCreated(SpatialOSEntity entity, EntityGameObjectLinker linker). - The signature of
IEntityGameObjectCreator.OnEntityCreatedhas changed fromvoid OnEntityRemoved(EntityId entityId, GameObject linkedGameObject)tovoid OnEntityRemoved(EntityId entityId).- All linked
GameObjectinstances are still unlinked before this is called, however it is now your responsibility to track if aGameObjectwas created when the entity was added. - You should now call
linker.LinkGameObjectToSpatialOSEntity()to link theGameObjectto the SpatialOS entity. - You should also pass-in a list of
ComponentTypetoLinkGameObjectToSpatialOSEntitywhich you wish to be copied from theGameObjectto the ECS entity associated with theGameObject.- Note that for the Transform Synchronization feature module to work correctly, you need to set up a linked Transform Component on your GameObject. You also need to link any Rigidbody Component on your GameObject.
- There is no limit on the number of GameObject instances that you can link to a SpatialOS entity. However, you cannot add a component type to a linked GameObject instance more than once.
- Deleting a linked GameObject unlinks it from the SpatialOS entity automatically.
- All linked
SpatialOSComponenthas been renamed toLinkedEntityComponent.- The field
SpatialEntityIdon theLinkedEntityComponenthas been renamed toEntityId. - The field
Entityhas been removed.
- The field
- The
Improbable.Gdk.Core.Dispatcherclass has been removed.
Added
- All generated schema types, enums, and types which implement
ISpatialComponentSnapshotare now marked asSerializable.- Note that generated types that implement
ISpatialComponentDataare not marked asSerializable.
- Note that generated types that implement
- Added the
DynamicConverterclass for converting aISpatialComponentSnapshotto anISpatialComponentUpdate. - Added a generated ECS shared component called
{COMPONENT_NAME}.ComponentAuthorityfor each SpatialOS component.- This component contains a single boolean which denotes whether a worker instance has write access authority over that component.
- The component does not tell you about soft-handover (
AuthorityLossImminent).
- You may now
[Require]anEntityId,Entity,World,ILogDispatcher, andWorldCommandSenderin MonoBehaviours. - Added constructors for all generated component snapshot types.
- Added the ability to send arbitrary serialized data in a player creation request.
- Replaced
Vector3fposition inCreatePlayerRequestTypewith abytesfield for sending arbitrary serialized data.
- Replaced
- Added
RequestPlayerCreationto manually request for player creation inSendCreatePlayerRequestSystem. - Added a menu item, navigate to SpatialOS > Generate Dev Authentication Token, to generate a TextAsset containing the Development Authentication Token.
- Added the ability to mark a build target as
Requiredwhich will cause builds to fail in the Editor if the prerequisite build support is not installed.
Changed
- Upgraded the Worker SDK version to
13.6.2. - Improved the UX of the BuildConfiguration inspector.
- Improved the UX of the GDK’s Tools Configuration window.
- Deleting a GameObject now automatically unlinks it from its ECS entity. Note that the ECS entity and the SpatialOS entity are not also deleted.
- Changed the format of the BuildConfiguration asset. Please recreate, or copy it from
workers/unity/Playground/Assets/Config/BuildConfiguration.asset. - Building workers will not change the active build target anymore. The build target will be set back to whatever was set before starting the build process.
Fixed
- Fixed a bug where, from the SpatialOS menu in the Unity Editor, running SpatialOS > Generate code would always regenerate code, even if no files had changed.
- Fixed a bug where building all workers in our sample projects would fail if you have Android build support installed but didn't set the path to the Android SDK.
- Fixed a bug where some prefabs would not be processed correctly, causing a
NullReferenceExceptioninOnEnable.
Internal
- Changed the code generator to use the schema bundle JSON rather than AST JSON.
- If you have forked the code generator, this may be a breaking change.
- Exposed annotations in the code generator model.
- Added a
MockConnectionHandlerimplementation for testing code which requires the world to be populated with SpatialOS entities. - Added tests for
StandardSubscriptionManagersandAggregateSubscription. - Re-added tests for Reader/Writer injection criteria and MonoBehaviour enabling.
- Reactive components have been isolated and can be disabled.
- Subscriptions API has been added, this allows you to subscribe anything for which a manager has been defined.
- This now backs the
RequireAPI in MonoBehaviours.
- This now backs the
- Low-level APIs have been changed significantly.
- Added a View separate from the Unity ECS.
- Removed unnecessary
KcpNetworkParametersoverrides inMobileWorkerConnectorwhere it matched the default values.