Exemple #1
0
        private void Awake()
        {
            IResourcesRepository resourcesRepository = new ResourcesRepository();

            IUiGeneratorFactory uiGeneratorFactory = new UiGeneratorFactory(gameObject, resourcesRepository);
            var uiElementsGenerator = uiGeneratorFactory.UiElementsGenerator;

            uiElementsGenerator.InitializeGenerator(resourcesRepository);
            InitializeRestartButtons(uiElementsGenerator);

            IBuffRepositoryFactory buffRepoFactory = new BuffRepositoryFactory(resourcesRepository);
            var buffsRepository = buffRepoFactory.BuffsRepository;

            new PlayerUiControllerFactory(resourcesRepository, uiElementsGenerator);
            new PlayerControllerFactory(buffsRepository, resourcesRepository);

            IWorldObjectsGenerator worldGenerator = GetComponent <WorldObjectsGenerator>();

            worldGenerator.PlayerModelPrefab = resourcesRepository.GetPlayerModelPrefab();
            new WorldObjectControllerFactory(worldGenerator, resourcesRepository, materials);
            StartDefaultGame();
        }