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
Bootstrapprefab into the main scene. - In your
MonoBehaviourcode, add System.Runtime.Serialization namespace, then add [DataMember(Name = "")] to any serialized properties that you want to be adjusted at runtime. - Add the
GameObjectwith the aboveMonoBehaviourcomponent to theSettingPopulateListofBootstrapDictionaryon theBootstrapprefab. - Enter the play mode and hit
Generate Bootstrap File. AbootstrapSettings.jsonwill be created at eitherStreamingAssetor Persistent Data Path based on your choice. Stop the play mode. - You are all set. Enter the play mode again. Hit
Gkey to toggle the runtime inspector to change and save settings on the fly. You can useruntimeEditorKeyStrokeproperty 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
GameObjectto theSettingPopulateList.
Provides a unifying way to download and load external media assets (audio, image, video) to your Unity project.
- Create an empty
GameObjectin the main scene and addExternalAssetLoadercomponent to the object. - Change
LocalAssetsFolderPathto suit the need of the project. - On startup, all media files under
LocalAssetsFolderPathwill be loaded andAssetController.LocalAssetLoadingFinishedwill be called when it's done. Audio files will be loaded asAudioClipand 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 theAssetKeyto 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)