public void DrawGrid() { _offSetPosition = new Vector3(_levelArkanoidManager.transform.position.x + LevelData.BrickWidth / 2, _levelArkanoidManager.transform.position.y - LevelData.BrickHeight / 2); for (int x = 0; x < LevelData.LevelWidth; x++) { for (int y = 0; y < LevelData.LevelHeight; y++) { Vector3 pos = new Vector3(_offSetPosition.x + x * LevelData.BrickWidth, _offSetPosition.y - y * LevelData.BrickHeight); EditorToolsUtils.DrawRectangle(pos, LevelData.BrickWidth, LevelData.BrickHeight, Color.clear, Color.white); } } }
public void OnMouseMove(Vector3 mousePosition) { if (Selection.activeTransform == _arkanoidManager.transform) { Vector3 worldPosition = _grid.MousePositionToWorldPosition(mousePosition); if (EraseMode) { EditorToolsUtils.DrawRectangle(worldPosition, LevelData.BrickWidth, LevelData.BrickHeight, new Color32(255, 77, 77, 70), Color.black); } else if (_selectedPrefab != null) { _selectedPrefab.transform.position = worldPosition; } } }
private void DrawBackGroundWindow(int windowID) { EditorToolsUtils.DrawScrollViewWindow(windowID, ref _backGroundWindowPosition, ref _selectedBackgroundMaterialIndex, _backGroundMaterials, _backgroundPreviewWidth, _backgroundPreviewHeight); EditorPrefs.SetInt("_selectedBackgroundMaterialIndex", _selectedBackgroundMaterialIndex); GetSelectedBackgroundMaterial(_selectedBackgroundMaterialIndex); }
private void DrawPrefabPreviewWindow(int windowID) { EditorToolsUtils.DrawScrollViewWindow(windowID, ref _paleteWindowPosition, ref _selectedPrefabIndex, _bricksPrefabs, _prefabPreviewWidth, _prefabPreviewHeight); EditorPrefs.SetInt("_selectedPrefabIndex", _selectedPrefabIndex); GetSelectedPrefab(_selectedPrefabIndex); }