1234567891011121314151617181920212223242526272829 |
- using UnityEngine;
- using XGame.Framework.Asset;
- using XGame.Framework.Quality;
- using XGame.Framework.Time;
- using XGame.Framework.UI;
- namespace XGame.Framework.Map
- {
- public class MapModuleBuilder
- {
- public IMapModule Product { get; private set; }
- public void Build(IQualityModule qualityModule, ITimeModule timeModule, IUIModule uiModule)
- {
- var assetModule = new AssetModule();
- var root = CreateRoot();
- var mapModule = new MapModule(assetModule, root);
- var context = new MapContext(qualityModule, timeModule, mapModule, uiModule);
- (mapModule as IMapContextSetter).Context = context;
- Product = mapModule;
- }
- private Transform CreateRoot()
- {
- var go = new GameObject("MapRoot");
- go.transform.SetParent(AppManager.Root, false);
- go.transform.localPosition = new Vector3(0, 100, 0);
- return go.transform;
- }
- }
- }
|