示例#1
0
 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);
         }
     }
 }
示例#2
0
 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;
         }
     }
 }
示例#3
0
 private void DrawBackGroundWindow(int windowID)
 {
     EditorToolsUtils.DrawScrollViewWindow(windowID, ref _backGroundWindowPosition, ref _selectedBackgroundMaterialIndex, _backGroundMaterials, _backgroundPreviewWidth, _backgroundPreviewHeight);
     EditorPrefs.SetInt("_selectedBackgroundMaterialIndex", _selectedBackgroundMaterialIndex);
     GetSelectedBackgroundMaterial(_selectedBackgroundMaterialIndex);
 }
示例#4
0
 private void DrawPrefabPreviewWindow(int windowID)
 {
     EditorToolsUtils.DrawScrollViewWindow(windowID, ref _paleteWindowPosition, ref _selectedPrefabIndex, _bricksPrefabs, _prefabPreviewWidth, _prefabPreviewHeight);
     EditorPrefs.SetInt("_selectedPrefabIndex", _selectedPrefabIndex);
     GetSelectedPrefab(_selectedPrefabIndex);
 }