void Start() { stateInformation = new StateInformation(); interfaceManager = InterfaceManager.GetInstance(); prefabsManager = PrefabsManager.GetInstance(); levelController = LevelController.instance; levelDataManager = LevelDataManager.GetInstance(); startupModule = (IStartupModule)StartupModule.GetInstance(); objectDeletionModule = (IObjectDeletionModule)ObjectDeletionModule.GetInstance(); objectPlacementModule = (IObjectPlacementModule)ObjectPlacementModule.GetInstance(); objectEditingModule = (IObjectEditingModule)ObjectEditingModule.GetInstance(); objectInformationModule = (IObjectInformationModule)ObjectInformationModule.GetInstance(); GameObject leftMouseButtonObject = Instantiate(mouseButtonPrefab, transform); leftMouseButton = leftMouseButtonObject.GetComponent <MouseButton>(); GameObject rightMouseButtonObject = Instantiate(mouseButtonPrefab, transform); rightMouseButton = rightMouseButtonObject.GetComponent <MouseButton>(); leftMouseButton.Setup(0, mouseButtonLeftPressedTime); rightMouseButton.Setup(1, cameraDragTime); prefabsManager.AddPrefabs(); interfaceManager.SetupUI(prefabsManager.GetPrefabTable()); InitializeLevel(initialLevelWidth, initialLevelHeight); SetupLevel(); }
void Awake() { levelController = gameObject.GetComponent <ILevelController>(); levelController.Enable(false); optionSprites.SetActive(false); deathCanvas.SetActive(false); pauseCanvas.SetActive(false); }
public void Setup(IObjectDeletionModule objectDeletionModule, IObjectPlacementModule objectPlacementModule, IObjectInformationModule objectInformationModule, IObjectEditingModule objectEditingModule, ILevelDataManager levelDataManager, ILevelController levelController, IPrefabsManager prefabsManager) { this.objectInformationModule = objectInformationModule; this.objectDeletionModule = objectDeletionModule; this.levelDataManager = levelDataManager; this.objectPlacementModule = objectPlacementModule; this.objectEditingModule = objectEditingModule; this.levelController = levelController; this.prefabsManager = prefabsManager; }
protected virtual void OnEnable() { if (_levelController == null) { // Initializes level controller _levelController = GetComponent <ILevelController>(); _levelController.AddClearedLines(0); } if (_boardController == null) { _boardController = GetComponent <IBoardController>(); _boardController.Initialize(); } _holdInputMaxTime = _levelController.GravityInterval / _boardController.BoardModel.NumColumns; }
public void Initialize() { if (!IsInitialized) { // Initialize board model and board view if (_boardFactory == null) { _boardFactory = GetComponent <IBoardFactory>(); } (BoardModel, BoardView) = _boardFactory.GetBoard(_blockPrefab, _blocks, _blockScale, _blocksParent, _maxNumLines, _maxNumColumns); // Initialized hold input max time if (_inputController == null) { _inputController = GetComponent <IInputController>(); } if (_levelController == null) { _levelController = GetComponent <ILevelController>(); _levelController.AddClearedLines(0); } if (_holdController == null) { _holdController = GetComponent <IHoldController>(); } if (_soundController == null) { _soundController = GetComponent <ISoundController>(); } _pausePanel.SetActive(IsPaused); IsInitialized = true; } }
private void OnTriggerEnter2D(Collider2D collision) { ILevelController levelController = LevelController.Instance; levelController.LoadNextLevel(); }
public void ExitButton() { ILevelController levelController = LevelController.Instance; levelController.Exit(); }
public void StartGameButton() { ILevelController levelController = LevelController.Instance; levelController.LoadNextLevel(); }
public void OnLevelStarted(ILevelController controller) { Debug.Log("Level controller called back that it's started: " + controller); }
private void Awake() { _levelController = Controllers.LevelController.Instance; SingletonWithoutStatic(); }
public void MenuButton() { ILevelController levelController = LevelController.Instance; levelController.Menu(); }
public void RestartButton() { ILevelController levelController = LevelController.Instance; levelController.Restart(); }
void Awake() { gameLogic = levelController.GetComponent <ILevelController>(); }
internal static void Setup(LoggerFactory factory, ILevelController levelController) { Factory = factory; LevelController = levelController; }
public LevelExceptionHandler(LevelController levelController, ErrorMessagesController errorMessagesController, MessagesCollectionController messagesCollectionController) : base(errorMessagesController, messagesCollectionController) { _levelController = levelController; }