Current Version 3
Supported Unity versions: 2019.1 or latest.
If you need to use the old scripting runtime (.net 3.5) then use the release-1.3 branch.
The purpose of Core Framework is to help speed up development in Unity3D by providing the following basic systems every game needs to have:
- Asset Bundle loading system that can load assets from:
- Streaming assets folder
- Web server or cloud service
- Simulate asset bundles on editor
- UI System
- Basic implementation of Widgets, Dialogs and Panels
- Transition animations by using DOTween, configurable on inspector
- Can trigger sounds when a transition plays
- Basic audio system
- Mouse / Touch input control
- Factory tool
- Console window colors! Colorize your debug messages with colors so they are easier to read.
- Base game starting point (Example Project)
- .Net 4.5.
- .Net Standard 2.0
The main aspect of this library is loading and unloading asset bundles in a very simple way.
var ball = await AssetService.LoadAsset<Ball>(AssetCategoryRoot.Prefabs,
"Ball");
This project is meant to be added to an existing Unity Project, either by downloading it and placing it in the "Plugins" folder, or by setting it as a subtree to your git repo. Alternatively you can use the Example Project as a starting point.
Core Framework depends on the the following components
- UniRx: And UniAsync.
- Extenject: Core Framework libraries are loaded and used with Dependency Injectiion.
- AssetBundles-Browser: Unity's tool for building and organizing asset bundles.
- DOTween: Used in UI transitions.
Has been tested on iOS, Android, Mac, Windows and WebGL.
For simplicity, the current asset bundle strategy for this tool is that each prefab is its own asset bundle, and asset bundles are organized by categories or directories. Image below is Unity's AssetBundles-Browser.
These directories are mapped to the enum AssetCategoryRoot as shown below.
public enum AssetCategoryRoot
{
None,
Configuration,
Services,
Levels,
SceneContent,
GameContent,
Windows,
Audio,
Prefabs
}
The service also detects the platform it's running on, and uses that to get the asset bundles from the web in the following order:
This functionality is entirely seamless to the developer, thus requesting an asset is now as easy as:
var shaterrer = await AssetService.LoadAsset<Shaterrer>(AssetCategoryRoot.Prefabs,
Constants.Prefabs.Shaterrer);
Asset Bundle simulation is enabled by default. If you wish to disable it go to menu Core Framework -> Disable Simulate Asset Bundles.
Alternatively, there's also a _Core menu to enable/disable simulation mode
- Use Streaming Assets
- Toggling this will load the asset bundles from the streaming assets folder
- Asset Bundles URL
- Location where the asset bundles are stored on the cloud
- Cache Asset Bundles?
- Toggle this if you want to cache the asset bundles on device. The file UnityCloudBuildManifest.json needs to be present in order to cache bundles.
This feature allows you to easily colorize debug messages so you can keep track of related events by colors on editor. This functionality is disabled on builds so the console log doesn't become cluttered with color tags.
By using the logger, device logs are not littered with tags. thus are easier to read.
Logger.Log("My very awesome lime colored text!"",Colors.Lime);