SpecklePlayground
that shows an in-game
example of how to send and receive data from your default speckle account.
The example is minimal, but demonstrates what is possible using the Speckle Unity Connector.
Windows -> Package Manager
)
and select Add Package from git URL.
SpeckleReceiver.cs
component to a GameObject, in the inspector you’ll now be able to select accounts, streams, branches and commits.
Generate Asset
option, when enabled, will generate Mesh, Material, and Prefab assets in the Resource
folder.
SpeckleSender.cs
component to a GameObject.
Receiver.cs
class in Assets\Speckle Connector
. This is just a wrapper around methods in Core, an example usage follows:
Init()
method accepts additional optional arguments to use different accounts, automatically receive updates, delete the old objects, report progress and errors etc. Please check the source code for a complete list.
Sender.cs
class in Assets\Speckle Connector
. This is just a wrapper around methods in Core, an example usage follows:
Send()
method accepts additional optional arguments to use different accounts, report progress and errors etc. Please check the source code for a complete list.
SpeckleProperties
component is attached to each object. Inside it there is a Dictionary<string,object>
called Data
that contains all the metadata coming from Speckle. This works similarly when sending data; if any objects have a SpeckleProperties
component attached to them, it will be used.
This data is visible from the inspector (read only)
This data is fully accessible from code (read/write), like so:
Standard
and Diffuse
shaders in project settings. To do so, just add them in Project Settings → Graphics → Built-in Shader Settings → Always Included shaders
.