A collection of handy tools for creative coding in Unity.
https://openupm.com/packages/com.yasirkula.runtimeinspector/
https://openupm.com/packages/jillejr.newtonsoft.json-for-unity.converters/
Bind fields and properties of Monobehaviours
objects to a JSON file. Save, load, make changes to them at runtime.
- Drag
Bootstrap
prefab into the main scene. - In your
MonoBehaviour
code, add System.Runtime.Serialization namespace, then add [DataMember(Name = "")] to any serialized properties that you want to be adjusted at runtime. - Add the
GameObject
with the aboveMonoBehaviour
component to theSettingPopulateList
ofBootstrapDictionary
on theBootstrap
prefab. - Enter the play mode and hit
Generate Bootstrap File
. AbootstrapSettings.json
will be created at eitherStreamingAsset
or Persistent Data Path based on your choice. Stop the play mode. - You are all set. Enter the play mode again. Hit
G
key to toggle the runtime inspector to change and save settings on the fly. You can useruntimeEditorKeyStroke
property to change the key binding for the bootstrap inspector.
- Bootstrap works better with reference types (class) than value types (struct). You can always create a
[Serializable]
class container to group similar settings together (regardless of reference types or value types) for better organizations. - DisplayManager and ExternalAssetLoader implement Bootstrap settings already. If you are also using them in your project, remember to drag their
GameObject
to theSettingPopulateList
.
Provides a unifying way to download and load external media assets (audio, image, video) to your Unity project.
- Create an empty
GameObject
in the main scene and addExternalAssetLoader
component to the object. - Change
LocalAssetsFolderPath
to suit the need of the project. - On startup, all media files under
LocalAssetsFolderPath
will be loaded andAssetController.LocalAssetLoadingFinished
will be called when it's done. Audio files will be loaded asAudioClip
and image files will be loaded asTexture2D
. Video files will only be loaded as their absolute file path. The filename without the extension will be used as theAssetKey
to retrieve the asset. - You can access the loaded asset via the functions below:
ExternalAssetLoader.Instance.AllAvailableAssets[assetkey]
ExternalAssetLoader.Instance.PreLoadedImagesAssets[assetKey]
ExternalAssetLoader.Instance.PreLoadedAudioClips[assetKey]
ExternalAssetLoader.Instance.DownloadedVideoPaths[assetKey]
Better logging ;)
Add timestamp to each Unity log message, and save the log for each app session to the persistentDataPath. Also provides verbosity filtering.
BetterLogging.Log(string log, LogLevel logLevel)