Example #1
0
 private void Update()
 {
     if (!EditorTerrainMaterials.isPainting)
     {
         return;
     }
     if (!EditorInteract.isFlying && GUIUtility.hotControl == 0)
     {
         if (Input.GetKeyDown(122) && !LevelGround.previewHQ && Input.GetKey(306))
         {
             if (EditorTerrainMaterials.map2)
             {
                 LevelGround.undoMaterial2();
             }
             else
             {
                 LevelGround.undoMaterial();
             }
         }
         if (Input.GetKeyDown(120) && !LevelGround.previewHQ && Input.GetKey(306))
         {
             if (EditorTerrainMaterials.map2)
             {
                 LevelGround.redoMaterial2();
             }
             else
             {
                 LevelGround.redoMaterial();
             }
         }
         if (EditorInteract.groundHit.transform != null)
         {
             EditorTerrainMaterials.brush.position = EditorInteract.groundHit.point;
         }
         if (Input.GetKeyUp(ControlsSettings.primary) && !LevelGround.previewHQ && EditorTerrainMaterials.wasPainting)
         {
             if (EditorTerrainMaterials.map2)
             {
                 LevelGround.registerMaterial2();
             }
             else
             {
                 LevelGround.registerMaterial();
             }
         }
         if (Input.GetKey(ControlsSettings.primary) && !LevelGround.previewHQ && EditorInteract.groundHit.transform != null)
         {
             LevelGround.paint(EditorInteract.groundHit.point, (int)EditorTerrainMaterials.brushSize, EditorTerrainMaterials.brushNoise, (int)EditorTerrainMaterials.selected, EditorTerrainMaterials.map2);
             EditorTerrainMaterials.wasPainting = true;
         }
         else
         {
             EditorTerrainMaterials.wasPainting = false;
         }
     }
 }