Getting Started
Package Types
Scene Setup
Economy
Scripting
Components
Guidelines
Support
Third-Party Unity Packages
These are some Unity Packages that Spatial Creators have been able to port successfully.
See also general instructions on how to port a third-party Unity library for using Spatial Creator Toolkit.
iTween
iTween is simple animation library that can be ported rather easily since it’s one file. The only function used banned function is the CallBack
function, which uses SendMessage
to deliver callbacks for tweens. If you need event callbacks for tweens, you’ll have to implement them differently.
- Copy the files (Pixelplacement folder) into your assembly.
- Comment out the references to
Application.OpenURL
andObject.SendMessage
LeanTween
See Spatial-LeanTween for a forked version that works in Spatial Creator Toolkit projects and is used in production games.
DOTween Free
The DOTween license does not allow redistributing a modified version; here are the general instructions for modifying it to work in Spatial Creator Toolkit.
- Clone locally.
- From the
_DOTween.Assembly
folder, copy theDOTween
,DOTweenEditor
, andbin/Modules
folders into your project, under the folder containing your C# assembly. - Remove
AssemblyInfo.cs
fromDOTween/Properties
andDOTweenEditor/Properties
. You can remove theProperties
folder too. - Remove or comment out all functions beginning with AsyncAwait in
DOTween/Modules/DOTweenModuleUnityVersion.cs
- Remove instances of using Resource.Load (for example, you could do
DOTweenSettings settings = ScriptableObject.CreateInstance<DOTweenSettings>();
) - In
DOTween/DOTween/Core/DOTweenComponent.cs
- for all the lines beginning with
Type modules = DOTweenUtils.GetLooseScriptType("DG.Tweening.DOTweenModuleUtils");
and ending withmi.Invoke(null, null);
- replace with just this one line:
DOTweenModuleUtils.Init();
- Remove or comment out
GetLooseScriptType
inDOTweenUtils.cs
- Comment out or remove all uses of
DontDestroyOnLoad
- Command out or remove all helper functions that reference Unity’s camera (in
DOTween/Plugins/Core/SpecialPluginsUtils.cs
) - For every file in the
Editor
folder, add a#if UNITY_EDITOR
directive on the first line of the file, and a#endif
on the last line of the file. - Normally, each
Editor
folder should have its own assembly definition. However, we found that for DOTween specifically this causes reference errors for non-exposed classes. - Sample unix commands to do this (replace
/path/to/DOTweenEditor
with your path to the editor folder)
#append #endif to all files
find /path/to/DOTweenEditor -type f -name "*.cs" -exec sed -i '' -e '$a\
\
#endif' {} \;
#prepend #if UNITY_EDITOR to all files
find /path/to/DOTweenEditor -type f -name "*.cs" -exec sed -i '' '1s/^/#if UNITY_EDITOR\n/' {} \;
Simple Car Controller
Dynamic Bone
This package from the Asset Store allows you to use bones / splines (https://assetstore.unity.com/packages/tools/animation/dynamic-bone-16743). To be able to use it, be sure to change the CheckDistance
function so that it doesn’t use Camera.main
. Instead, you want to use the camera position:
Vector3 rtPos = m_ReferenceObject != null ? m_ReferenceObject.position : SpatialBridge.cameraService.position;
float d2 = (rtPos - transform.position).sqrMagnitude;
← Previous