private void ResetToLastColor() { currentBrushSwatch = swatchData[lastSelectedSwatch]; terrainBrushesButton.GetComponent <Image>().color = currentBrushSwatch.color; MapManager.singleton.SelectSwatch1Brush(); SetColorSwatchPanelActive(false); }
public void OverwriteCurrentColor(ColorPickerPopup.SwatchData newSwatch) { currentBrushSwatch = new ColorPickerPopup.SwatchData(newSwatch); swatchData[lastSelectedSwatch] = currentBrushSwatch; SetSwatchButtonColors(); terrainBrushesButton.GetComponent <Image>().color = currentBrushSwatch.color; }
public void PressedSwatchButton(int button) { currentBrushSwatch = swatchData[(int)button]; terrainBrushesButton.GetComponent <Image>().color = currentBrushSwatch.color; SetColorSwatchPanelActive(false); lastSelectedSwatch = button; ResetToLastTool(); }
public HSREraseTile(HistoryKeeper parent, IntVector2 tileLocation) : base(parent) { location = tileLocation; var tileCheck = MapManager.singleton.GetTileAt(tileLocation); if (tileCheck != null) { //MapManager.BrushType oldType = tileCheck.GetComponent<TileListener>(). oldPrefab = MapManager.singleton.GetTilePrefabForType(MapManager.BrushType.TILE); //TODO: make this consider terrain types/ animated types etc. oldSwatch = tileCheck.GetComponent <TileListener>().swatchData; } else { oldPrefab = null; } }
public HSRDrawTile(HistoryKeeper parent, ColorPickerPopup.SwatchData swatch, IntVector2 tileLocation, GameObject prefab) : base(parent) { newSwatch = swatch; location = tileLocation; newPrefab = prefab; var tileCheck = MapManager.singleton.GetTileAt(tileLocation); if (tileCheck != null) { oldPrefab = newPrefab; //TODO: make this consider terrain types/ animated types etc. oldSwatch = tileCheck.GetComponent <TileListener>().swatchData; } else { oldPrefab = null; } }
public void InitSwatchData() { if (swatchData.Length != swatchButtons.Length) { Debug.LogError("[MapEditorManager:InitSwatchData] swatchData.Length != swatchButtons.Length"); } swatchData[0] = new ColorPickerPopup.SwatchData(); swatchData[0].coords = new Vector2(1f, 0.5f); swatchData[0].value = 1f; swatchData[1] = new ColorPickerPopup.SwatchData(); swatchData[1].coords = new Vector2(0.75f, 0f); swatchData[1].value = 1f; swatchData[2] = new ColorPickerPopup.SwatchData(); swatchData[2].coords = new Vector2(0.25f, 0f); swatchData[2].value = 1f; swatchData[3] = new ColorPickerPopup.SwatchData(); swatchData[3].coords = new Vector2(0f, 0.5f); swatchData[3].value = 1f; swatchData[4] = new ColorPickerPopup.SwatchData(); swatchData[4].coords = new Vector2(0.25f, 1f); swatchData[4].value = 1f; swatchData[5] = new ColorPickerPopup.SwatchData(); swatchData[5].coords = new Vector2(0.75f, 1f); swatchData[5].value = 1f; swatchButtons[0] = swatchButton0; swatchButtons[1] = swatchButton1; swatchButtons[2] = swatchButton2; swatchButtons[3] = swatchButton3; swatchButtons[4] = swatchButton4; swatchButtons[5] = swatchButton5; SetSwatchButtonColors(); }