public void StartBoardInteractor() { if (blockStorage) { Destroy(blockStorage.gameObject); } if (projectionElement) { Destroy(projectionElement.gameObject); } board?.ClearBlocks(); blockStorage = new GameObject("Storage").transform; blockStorage.transform.position += new Vector3(0, 0.5f, 0); spawnedElement = CreateRandomElement(spawnPoint.position); nextElement = CreateRandomElement(previewPoint.position); OnBlockSpawnedEvent?.Invoke(); CreateProjection(spawnedElement); lastStepTime = 0; Debug.Assert(settings != null, "Settings equal null!"); }
private void ReplaceElements() { spawnedElement = nextElement; spawnedElement.transform.position = spawnPoint.transform.position; nextElement = CreateRandomElement(previewPoint.transform.position); OnBlockSpawnedEvent?.Invoke(); }