Advertisement
Crazist

Untitled

Aug 9th, 2022
839
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.04 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections.Generic;
  3. using System;
  4. using GameInit.Component;
  5. using GameInit.GameCycleModule;
  6. using GameInit.PoolOfCoins;
  7.  
  8. namespace GameInit.Builders
  9. {
  10.     [DisallowMultipleComponent]
  11.     [RequireComponent(typeof(GameCycle))]
  12.  
  13.     public class LevelBuilder : MonoBehaviour
  14.     {
  15.         private readonly List<IDisposable> _dispose = new List<IDisposable>();
  16.  
  17.         private void Awake()
  18.         {
  19.             var gameCycle = GetComponent<GameCycle>();
  20.            
  21.             Builders(gameCycle);
  22.         }
  23.  
  24.         private void Builders(GameCycle gameCyrcle)
  25.         {
  26.             Pools _Pools = GameObject.FindObjectOfType<Pools>();
  27.             CitizenPoolBuilder _citizenPoolBuilder = new CitizenPoolBuilder();
  28.  
  29.             CameraBuilder _cameraBuilder = new CameraBuilder(gameCyrcle);
  30.             ResourcesUIBuilder _resourcesUIBuilder = new ResourcesUIBuilder();
  31.             ResourceManager _resourceManager = new ResourceManager(_resourcesUIBuilder);
  32.  
  33.             HeroBuilder _heroBuilder = new HeroBuilder(gameCyrcle, _Pools, _resourceManager);
  34.             ConstructionBuilder _constructionBuilder = new ConstructionBuilder(gameCyrcle, _Pools);
  35.             NomadsCampBuilder _nomadsCampBuilder = new NomadsCampBuilder(gameCyrcle, _citizenPoolBuilder);
  36.             CitizensBuilder _citizensBuilder = new CitizensBuilder(gameCyrcle);
  37.  
  38.  
  39.             ChestBuilder _chestBuilder = new ChestBuilder(gameCyrcle, _heroBuilder.GetHeroSettings(), _resourceManager);
  40.  
  41.             Hacks(_resourceManager);
  42.         }
  43.        /* private void NomadBuilder(GameCycle cycle)
  44.         {
  45.             //_nomadBuilder = new NomadBuilder(cycle, _nomadsCampBuilder, _citizenPoolBuilder);
  46.         }*/
  47.  
  48.         private void Hacks(ResourceManager _resourceManager)
  49.         {
  50.             _resourceManager.SetResource(ResourceType.Gold, 11);
  51.         }
  52.  
  53.         private void OnDestroy()
  54.         {
  55.             foreach (var item in _dispose)
  56.             {
  57.                 item.Dispose();
  58.             }
  59.         }
  60.     }
  61. }
  62.  
  63.  
  64.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement