// --------------------------------------------------------------------------- #region Change Placement Mode // --------------------------------------------------------------------------- public static void ChangePlacementMode(PlacementMode newPlacementMode) { // Get new selected Draw Tool placementMode = newPlacementMode; // Remove any previous visualizer Visualizer.RemoveVisualizer(); // -------------------------------- // Create Visualizer // -------------------------------- // If changed tool to Nothing or Eraser if (placementMode == PlacementMode.None || placementMode == PlacementMode.Erase) { // Deselect any item in the palette //MAST_Prefab_Palette_GUI.RemovePrefabSelection(); // If changed tool to Eraser, create eraser visualizer if (placementMode == PlacementMode.Erase) { ChangePrefabToEraser(); } } // If changed tool to Draw Single, Draw Continuous, Paint Area, or Randomizer else { // If a palette item is selected if (Palette.Manager.selectedItemIndex != -1) { // Create visualizer from selected item in the palette GUI.Palette.ChangePrefabSelection(); // If changed tool to Randomizer if (placementMode == PlacementMode.Randomize) { // Make a new random seed Randomizer.GenerateNewRandomSeed(); } } } // If Draw Continuous nor Paint Area tools are selected if (placementMode != PlacementMode.DrawContinuous && placementMode != PlacementMode.PaintArea) { // Delete last saved position Placement.lastPosition = Vector3.positiveInfinity; // Remove any paint area visualization PaintArea.DeletePaintArea(); } }
private void FixedUpdate() { if (inputManager.eventData == null) { return; } if (inputManager.hit.collider != null) { PaintArea pa = inputManager.hit.collider.GetComponent <PaintArea>(); if (pa != null) { pa.PaintOn(inputManager.hit.textureCoord, brushTexture, brushColor); } } }
public Form2(int N, int max) { InitializeComponent(); counter = new VisualCounter("count", max, N); graphics = PaintArea.CreateGraphics(); }