loomnetwork / unity-sdk

Loom DAppChain SDK for Unity3d
Other
121 stars 34 forks source link

SDK is imported into every sample repo #38

Open ZimM-LostPolygon opened 6 years ago

ZimM-LostPolygon commented 6 years ago

Currently, samples just include a copy of the SDK, which works, but is messy. People seem to just download the sample and rip the SDK out of it, even if it is outdated already.

We need to have a way to easily keep the SDK up-to-date in samples. Proposal: remove the SDK from samples, and instead have a script that will bootstrap the SDK - download the latest package from GitHub releases (or any other place we can host it) and import it into the sample project.

The downside is that the sample code might be using some APIs that are not present in the latest SDK anymore, but I think it's fair to say this is not going to happen often, and we have to keep the samples working with the latest SDK, otherwise there's little use for them in terms of learning how to use the SDK.

Here is the current version of the bootstrapper: https://raw.githubusercontent.com/loomnetwork/unity3d-sdk/sample-bootstrapper/UnityProject/Assets/LoomSDKBootstrapper/Editor/LoomSdkBootstrapper.cs

It downloads the latest .unitypackage from GitHub releases of this repo (we don't have any ATM) and imports it into the project. Since the bootstrapper should be distributed as a .dll, rather than source code, Unity will load even if the compilation of sample fails, which it will, since there is initially no SDK in the samples. The .dll can be grabbed from \UnityProject\Library\ScriptAssemblies\LoomSDKBootstrapper.dll.