public static void SelectLastDeselected() // called when clicking on a tilemap-editing related thing { if (lastDeselected != null) { currentlySelected = lastDeselected; currentlySelected.selectionImage.color = currentlySelected.selectedColor; lastDeselected = null; } }
public void OnPointerDown(PointerEventData data) { if (currentlySelected != null && currentlySelected != null) { currentlySelected.selectionImage.color = Color.clear; } currentlySelected = this; selectionImage.color = selectedColor; OnMouseDown(); }
private void OnSwitchedEditingAction(CommonEditMode.EditingActions action) { if (action == CommonEditMode.EditingActions.Entity_Placement) { isEditingTilemap = false; tilePlacementIndicator.position = Vector3.one * 0.5f; DarkenLayersExcept(tilemapList.ToArray()); // dependency TilemapTool.DeselectCurrent(); } else if (action == CommonEditMode.EditingActions.Tile_Placement) { isEditingTilemap = true; SetActiveLayer(layerToEnumStr[activeLayer]); if (TilemapTool.currentlySelected == null) { TilemapTool.SelectLastDeselected(); } } }
public static void DeselectCurrent() // called when clicking on an entity { currentlySelected.selectionImage.color = Color.clear; lastDeselected = currentlySelected; currentlySelected = null; }