12345678910111213141516171819202122232425262728 |
- using UnityEngine;
- using XGame.Framework.Asset;
- using XGame.Framework.Quality;
- using XGame.Framework.Time;
- namespace XGame.Framework.Map
- {
- public class MapModuleBuilder
- {
- public IMapModule Product { get; private set; }
- public void Build(IQualityModule qualityModule, ITimeModule timeModule)
- {
- var assetModule = new AssetModule();
- var root = CreateRoot();
- var mapModule = new MapModule(assetModule, root);
- var context = new MapContext(qualityModule, timeModule, mapModule);
- (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;
- }
- }
- }
|