Esempio n. 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);
         }
     }
 }
Esempio n. 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;
         }
     }
 }