-
Notifications
You must be signed in to change notification settings - Fork 4
Install ReUI and first steps
If you're starting new project and found ReUI is useful, let me help you to prepare project.
First at all, create new clean unity project as before (I hope you already have some experience with Unity).
To make unity ready to work with Rentitas and ReUI, we should change legacy compiler. I recommend to use IncrementalCompiler
Go to next repositories and clone them somethere on your computer:
Copy (or create symlinks) to next folders inside your Assets folder: Rentitas, Rentitas.Unity, ReUI.Api, ReUI.Implementation, ReUI.Integration, Uniful, xLua
First at all, ReUI is a module for Rentitas and requires rentitas application to work. Let's create folder for application in Assets (SampleApp in my case). Next we should to create simple Rentitas application what will register and execute ReUI kernel:
public class SampleApplication : Application
{
public SampleApplication(
IViewProvider viewProvider,
IContentProvider contentProvider,
ILuaProvider luaProvider)
{
RegisterKernel(new UIKernel(viewProvider, contentProvider, luaProvider));
}
}
As you can see UIKernel
requires three dependency: IViewProvider
, IContentProvider
, ILuaProvider
. In our case we'll use simple one (from ReUI.Intergation), but you can implement them by yourself as you want.
Create Bootstrap
class (as a simple MonoBehaviour) where will create and execute our SampleApplication
:
public class Bootstrap : MonoBehaviour, IAppProvider {
private SampleApplication _application;
public Application Application => _application;
private void Start ()
{
// create instance of rentitas application
_application = new SampleApplication(
new SimpleViewProvider(),
new ContentResourcesProvider(),
new XLuaProvider());
}
public void Update()
{
// execute instance of rentitas application on each update
_application.Execute();
}
}