예제 #1
0
 /// <summary>
 /// Find module installer components for auto install with settings from unity editor.
 /// </summary>
 /// <param name="_gamemanagerGO"></param>
 public void ModuleAutoInstallerOverride(GameObject _gamemanagerGO)
 {
     // DataModule
     if (_gamemanagerGO.GetComponentInChildren <ModuleInstaller <IDataModule> >())
     {
         IDataModule dm = _gamemanagerGO.GetComponentInChildren <ModuleInstaller <IDataModule> >().InstallModule();
         DataModule.SetupModule(dm, dm.Settings);
         //typeof(IMyInterface).IsAssignableFrom(typeof(MyType))
         //typeof().GetInterfaces().Contains(typeof(IMyInterface))
     }
     // LocalizationModule
     if (_gamemanagerGO.GetComponentInChildren <ModuleInstaller <ILocalizationModule> >())
     {
         ILocalizationModule dm = _gamemanagerGO.GetComponentInChildren <ModuleInstaller <ILocalizationModule> >().InstallModule();
         LocalizationModule.SetupModule(dm, dm.Settings);
     }
     // PlayerProfileModule Install
     if (_gamemanagerGO.GetComponentInChildren <ModuleInstaller <IPlayerProfileModule> >())
     {
         IPlayerProfileModule moduleInstance = _gamemanagerGO.GetComponentInChildren <ModuleInstaller <IPlayerProfileModule> >().InstallModule();
         PlayerProfile.SetupModule(moduleInstance, moduleInstance.Settings);
     }
     // UIModule Install
     if (_gamemanagerGO.GetComponentInChildren <ModuleInstaller <IUIModule> >())
     {
         IUIModule moduleInstance = _gamemanagerGO.GetComponentInChildren <ModuleInstaller <IUIModule> >().InstallModule();
         UIModule.SetupModule(moduleInstance, moduleInstance.Settings);
     }
     // SceneModule Install
     if (_gamemanagerGO.GetComponentInChildren <ModuleInstaller <ISceneModule> >())
     {
         ISceneModule moduleInstance = _gamemanagerGO.GetComponentInChildren <ModuleInstaller <ISceneModule> >().InstallModule();
         SceneModule.SetupModule(moduleInstance, moduleInstance.Settings);
     }
 }