public static void pickTile(Vector3 position) { if (YuME_mapEditor.findTileMapParent()) { GameObject currentLayer = YuME_mapEditor.mapLayers[YuME_mapEditor.currentLayer - 1]; Vector3 tempVec3; for (int i = 0; i < currentLayer.transform.childCount; ++i) { tempVec3 = currentLayer.transform.GetChild(i).transform.position; if (tempVec3.x == position.x && tempVec3.z == position.z && tempVec3.y >= position.y && tempVec3.y < position.y + 1f) { YuME_mapEditor.currentTile = AssetDatabase.LoadAssetAtPath(AssetDatabase.GetAssetPath(PrefabUtility.GetPrefabParent(currentLayer.transform.GetChild(i).gameObject)), typeof(GameObject)) as GameObject; float pickRotation = 0; if (currentLayer.transform.GetChild(i).transform.eulerAngles.y > 0) { pickRotation = currentLayer.transform.GetChild(i).eulerAngles.y; } YuME_mapEditor.currentBrushIndex = Array.IndexOf(YuME_mapEditor.currentTileSetObjects, YuME_mapEditor.currentTile); YuME_mapEditor.currentTile.transform.localScale = currentLayer.transform.GetChild(i).gameObject.transform.localScale; YuME_mapEditor.tileRotation = pickRotation; YuME_brushFunctions.updateBrushTile(); YuME_mapEditor.selectedTool = YuME_mapEditor.toolIcons.brushTool; return; } } } }
public static void setTileBrush(int index) { currentBrushIndex = index; currentBrushType = brushTypes.standardBrush; currentTile = currentTileSetObjects[index]; tileRotation = 0f; YuME_brushFunctions.updateBrushTile(); selectedTool = toolIcons.brushTool; }
public static void setActiveMap() { for (int i = 0; i < YuME_mapEditor.ref_MapManager.mapList.Count; i++) { if (YuME_mapEditor.ref_MapManager.mapList[i] != null) { YuME_mapEditor.ref_MapManager.mapList[i].SetActive(false); } } YuME_mapEditor.ref_MapManager.mapList[YuME_mapEditor.currentMapIndex].SetActive(true); YuME_brushFunctions.updateBrushTile(); }
public static void pickTile(Vector3 position) { if (YuME_mapEditor.findTileMapParent()) { GameObject currentLayer = YuME_mapEditor.mapLayers[YuME_mapEditor.currentLayer - 1]; Vector3 tempVec3; for (int i = 0; i < currentLayer.transform.childCount; ++i) { tempVec3 = currentLayer.transform.GetChild(i).transform.position; if (tempVec3.x == position.x && tempVec3.z == position.z && tempVec3.y >= position.y && tempVec3.y < position.y + 1f) { #if UNITY_2018_3_OR_NEWER YuME_mapEditor.currentTile = AssetDatabase.LoadAssetAtPath(AssetDatabase.GetAssetPath(PrefabUtility.GetCorrespondingObjectFromSource(currentLayer.transform.GetChild(i).gameObject)), typeof(GameObject)) as GameObject; #else YuME_mapEditor.currentTile = AssetDatabase.LoadAssetAtPath(AssetDatabase.GetAssetPath(PrefabUtility.GetPrefabParent(currentLayer.transform.GetChild(i).gameObject)), typeof(GameObject)) as GameObject; #endif float pickRotation = 0; float pickRotationX = 0; Transform pickTileTransform = currentLayer.transform.GetChild(i).transform; if (pickTileTransform.eulerAngles.y > 0) { pickRotation = pickTileTransform.eulerAngles.y; } if (pickTileTransform.eulerAngles.x > 0) { pickRotationX = pickTileTransform.eulerAngles.x; } YuME_mapEditor.currentBrushIndex = Array.IndexOf(YuME_mapEditor.currentTileSetObjects, YuME_mapEditor.currentTile); YuME_mapEditor.tileRotation = pickRotation; YuME_mapEditor.tileRotationX = pickRotationX; tempVec3 = pickTileTransform.localScale; tempVec3.x /= YuME_mapEditor.globalScale; tempVec3.y /= YuME_mapEditor.globalScale; tempVec3.z /= YuME_mapEditor.globalScale; YuME_mapEditor.tileScale = tempVec3; YuME_brushFunctions.updateBrushTile(pickTileTransform.localScale); YuME_mapEditor.currentBrushType = YuME_mapEditor.brushTypes.standardBrush; YuME_mapEditor.selectedTool = YuME_mapEditor.toolIcons.brushTool; return; } } } }
void OnEnable() { editorData = ScriptableObject.CreateInstance <YuME_editorData>(); AssetPreview.SetPreviewTextureCacheSize(1000); YuTools_Utils.disableTileGizmo(showGizmos); YuTools_Utils.addLayer("YuME_TileMap"); YuME_brushFunctions.cleanSceneOfBrushObjects(); string[] guids; // ---------------------------------------------------------------------------------------------------- // ----- Load Editor Settings // ---------------------------------------------------------------------------------------------------- guids = AssetDatabase.FindAssets("YuME_editorSetupData"); editorData = AssetDatabase.LoadAssetAtPath(AssetDatabase.GUIDToAssetPath(guids[0]), typeof(YuME_editorData)) as YuME_editorData; importTileSets(false); loadPreviewTiles(); loadCustomBrushes(); _toolEnabled = toolEnabled; gridSceneObject = GameObject.Find("YuME_MapEditorObject"); updateGridColors(); gridHeight = 0; YuME_brushFunctions.createBrushTile(); YuTools_Utils.showUnityGrid(true); SceneView.RepaintAll(); // ---------------------------------------------------------------------------------------------------- // ----- Setup Scene Delegates // ---------------------------------------------------------------------------------------------------- currentScene = EditorSceneManager.GetActiveScene().name; SceneView.onSceneGUIDelegate -= OnSceneGUI; SceneView.onSceneGUIDelegate += OnSceneGUI; EditorApplication.hierarchyWindowChanged -= OnSceneChanged; EditorApplication.hierarchyWindowChanged += OnSceneChanged; }
static void drawCustomBrushButtons(int index) { Texture2D previewImage = AssetPreview.GetAssetPreview(currentCustomBrushes[index]); GUIContent buttonContent = new GUIContent(previewImage); bool isActive = false; if (currentTile.name == currentCustomBrushes[index].name) { isActive = true; } EditorGUILayout.BeginVertical(); bool isToggleDown = GUILayout.Toggle(isActive, buttonContent, GUI.skin.button); if (isToggleDown == true && isActive == false) { currentTile = currentCustomBrushes[index]; currentBrushType = brushTypes.customBrush; tileRotation = 0f; YuME_brushFunctions.updateBrushTile(); selectedTool = toolIcons.brushTool; } if (GUILayout.Button("Delete Brush")) { if (EditorUtility.DisplayDialog("Delete Custom Brush?", "Are you sure you want to delete the custom brush prefab from the project", "Delete", "No")) { string destinationPath = availableTileSets[currentTileSetIndex].customBrushDestinationFolder + "/" + currentCustomBrushes[index].name + ".prefab"; AssetDatabase.DeleteAsset(destinationPath); loadCustomBrushes(); } } EditorGUILayout.EndVertical(); }
// ---------------------------------------------------------------------------------------------------- // ----- Draw Scene Tools // ---------------------------------------------------------------------------------------------------- static void OnSceneGUI(SceneView sceneView) { if (toolEnabled) { // ---------------------------------------------------------------------------------------------------- // ----- Draw Scene Editor Tools // ---------------------------------------------------------------------------------------------------- if (selectedTool > 0 && toolEnabled) { controlId = GUIUtility.GetControlID(FocusType.Passive); updateSceneMousePosition(); checkTilePositionIsValid(sceneView.position); YuME_sceneGizmoFunctions.drawBrushGizmo(); } // ---------------------------------------------------------------------------------------------------- // ----- Draw Editor Tool Bar // ---------------------------------------------------------------------------------------------------- YuME_editorSceneUI.drawToolUI(sceneView); // ---------------------------------------------------------------------------------------------------- // ----- Check Keyboard and Mouse Shortcuts // ---------------------------------------------------------------------------------------------------- YuME_keyboardShortcuts.checkKeyboardShortcuts(Event.current); YuME_mouseShorcuts.checkMouseShortcuts(Event.current); foreach (GameObject selected in selectedTiles) { if (selected != null) { YuME_sceneGizmoFunctions.drawSceneGizmoCube(selected.transform.position, Vector3.one, Color.green); } } // ---------------------------------------------------------------------------------------------------- // ----- Momenteray handling of the editor tool bar // ---------------------------------------------------------------------------------------------------- switch (selectedTool) { case toolIcons.defaultTools: YuME_brushFunctions.destroyBrushTile(); break; case toolIcons.brushTool: YuME_brushFunctions.createBrushTile(); selectedTiles.Clear(); break; case toolIcons.pickTool: YuME_brushFunctions.destroyBrushTile(); selectedTiles.Clear(); break; case toolIcons.eraseTool: YuME_brushFunctions.destroyBrushTile(); selectedTiles.Clear(); break; case toolIcons.selectTool: YuME_brushFunctions.destroyBrushTile(); break; case toolIcons.copyTool: YuME_customBrushFunctions.createCopyBrush(false); selectedTool = toolIcons.brushTool; break; case toolIcons.moveTool: YuME_customBrushFunctions.createCopyBrush(true); selectedTool = toolIcons.brushTool; break; case toolIcons.trashTool: YuME_tileFunctions.trashTiles(); selectedTool = previousSelectedTool; break; case toolIcons.customBrushTool: YuME_customBrushFunctions.createCustomBrush(); selectedTool = previousSelectedTool; break; case toolIcons.showGizmos: showGizmos = !showGizmos; YuTools_Utils.disableTileGizmo(showGizmos); selectedTool = previousSelectedTool; break; case toolIcons.gridUpTool: if (Event.current.alt) { gridHeight += 0.25f; } else { gridHeight++; } selectedTool = previousSelectedTool; break; case toolIcons.gridDownTool: if (Event.current.alt) { gridHeight -= 0.25f; } else { gridHeight--; } selectedTool = previousSelectedTool; break; case toolIcons.rotateTool: tileRotation += 90f; selectedTool = previousSelectedTool; break; case toolIcons.flipHorizontalTool: YuME_tileFunctions.flipHorizontal(); selectedTool = previousSelectedTool; break; case toolIcons.flipVerticalTool: YuME_tileFunctions.flipVertical(); selectedTool = previousSelectedTool; break; case toolIcons.isolateTool: YuME_tileFunctions.isolateTilesToggle(); selectedTool = previousSelectedTool; break; case toolIcons.isolateLayerTool: YuME_tileFunctions.isolateLayerToggle(); selectedTool = previousSelectedTool; break; case toolIcons.layerUp: currentLayer++; selectedTool = previousSelectedTool; break; case toolIcons.layerDown: currentLayer--; selectedTool = previousSelectedTool; break; } // ---------------------------------------------------------------------------------------------------- // ----- Check Scene View Inputs for Drawing, Picking etc. // ---------------------------------------------------------------------------------------------------- if (selectedTool > toolIcons.defaultTools) { if ((Event.current.type == EventType.MouseDrag || Event.current.type == EventType.MouseDown) && Event.current.button == 0 && Event.current.alt == false && Event.current.shift == false && Event.current.control == false && allowTileRedraw) { switch (selectedTool) { case toolIcons.brushTool: switch (currentBrushType) { case brushTypes.standardBrush: addTiles(); break; case brushTypes.customBrush: YuME_customBrushFunctions.pasteCustomBrush(tilePosition); break; case brushTypes.copyBrush: YuME_customBrushFunctions.pasteCopyBrush(tilePosition); break; } break; case toolIcons.pickTool: YuME_tileFunctions.pickTile(tilePosition); break; case toolIcons.eraseTool: eraseTiles(); break; case toolIcons.selectTool: YuME_tileFunctions.selectTile(tilePosition); break; } allowTileRedraw = false; } else if ((Event.current.type == EventType.MouseDrag || Event.current.type == EventType.MouseDown) && Event.current.button == 0 && Event.current.alt == false && Event.current.shift == true && Event.current.control == false && allowTileRedraw) { switch (selectedTool) { case toolIcons.brushTool: eraseTiles(); break; } allowTileRedraw = false; } else if ((Event.current.type == EventType.MouseDrag || Event.current.type == EventType.MouseDown) && Event.current.button == 0 && Event.current.alt == false && Event.current.shift == false && Event.current.control == true && allowTileRedraw) { switch (selectedTool) { case toolIcons.brushTool: YuME_tileFunctions.pickTile(tilePosition); break; case toolIcons.selectTool: YuME_tileFunctions.deSelectTile(tilePosition); break; } allowTileRedraw = false; } HandleUtility.AddDefaultControl(controlId); } if (showGizmos) { if (selectedTiles.Count > 0) { foreach (GameObject tile in selectedTiles) { YuME_sceneGizmoFunctions.handleInfo data; data.tileName = tile.name; data.layer = tile.transform.parent.name; data.grid = tile.transform.position.y; YuME_sceneGizmoFunctions.drawTileInfo(tile.transform.position, data); } } } // ---------------------------------------------------------------------------------------------------- // ----- Scene Housekeeping // ---------------------------------------------------------------------------------------------------- YuME_brushFunctions.updateBrushPosition(); repaintSceneView(); previousSelectedTool = selectedTool; } }
public static void combineTiles() { if (YuME_mapEditor.tileMapParent) { frozenMap = new GameObject(); frozenMap.transform.parent = YuME_mapEditor.tileMapParent.transform; frozenMap.name = "frozenMap"; List <GameObject> tilesToCombine = new List <GameObject>(); List <GameObject> lightsToCreate = new List <GameObject>(); List <Transform> freezeTiles = new List <Transform>(); List <Transform> _freezeTiles = new List <Transform>(); EditorUtility.DisplayProgressBar("Building Frozen Map", "Finding Tiles to Freeze", 0f); for (int i = 0; i < 8; i++) { if (YuME_mapEditor.editorPreferences.layerFreeze[i]) { YuME_mapEditor.mapLayers[i].GetComponentsInChildren <Transform>(false, _freezeTiles); freezeTiles.AddRange(_freezeTiles); } else { GameObject layerCopy = Instantiate(YuME_mapEditor.mapLayers[i], YuME_mapEditor.mapLayers[i].transform.position, Quaternion.identity) as GameObject; layerCopy.transform.parent = frozenMap.transform; if (!YuME_mapEditor.editorPreferences.layerStatic[i]) { Transform[] tempTiles = layerCopy.GetComponentsInChildren <Transform>(); foreach (Transform child in tempTiles) { child.gameObject.isStatic = false; } } } } foreach (Transform tile in freezeTiles) { if (tile.GetComponent <MeshRenderer>()) { if (YuME_mapEditor.editorPreferences.convexCollision) { MeshCollider _tempCol = tile.GetComponent <MeshCollider>(); if (_tempCol != null) { _tempCol.convex = true; } } tilesToCombine.Add(tile.gameObject); } if (tile.GetComponent <Light>()) { lightsToCreate.Add(tile.gameObject); } } foreach (GameObject light in lightsToCreate) { GameObject newLight = GameObject.Instantiate(light); newLight.isStatic = true; newLight.transform.position = light.transform.position; newLight.transform.eulerAngles = light.transform.eulerAngles; newLight.transform.parent = frozenMap.transform; } tilesToCombine = tilesToCombine.OrderBy(x => x.GetComponent <MeshRenderer>().sharedMaterial.name).ToList(); Material previousMaterial = tilesToCombine[0].GetComponent <MeshRenderer>().sharedMaterial; List <CombineInstance> combine = new List <CombineInstance>(); CombineInstance tempCombine = new CombineInstance(); int vertexCount = 0; foreach (GameObject mesh in tilesToCombine) { vertexCount += mesh.GetComponent <MeshFilter>().sharedMesh.vertexCount; if (vertexCount > 60000) { vertexCount = 0; newSubMesh(combine, mesh.GetComponent <MeshRenderer>().sharedMaterial); combine = new List <CombineInstance>(); } if (mesh.GetComponent <MeshRenderer>().sharedMaterial.name != previousMaterial.name) { newSubMesh(combine, previousMaterial); combine = new List <CombineInstance>(); } tempCombine.mesh = mesh.GetComponent <MeshFilter>().sharedMesh; tempCombine.transform = mesh.GetComponent <MeshFilter>().transform.localToWorldMatrix; combine.Add(tempCombine); previousMaterial = mesh.GetComponent <MeshRenderer>().sharedMaterial; } newSubMesh(combine, previousMaterial); foreach (Transform layer in YuME_mapEditor.tileMapParent.transform) { if (layer.name.Contains("layer")) { layer.gameObject.SetActive(false); } } YuME_brushFunctions.cleanSceneOfBrushObjects(); EditorUtility.ClearProgressBar(); YuME_brushFunctions.destroyBrushTile(); YuME_brushFunctions.cleanSceneOfBrushObjects(); YuME_mapEditor.selectedTool = YuME_mapEditor.toolIcons.defaultTools; } }
public static void checkMouseShortcuts(Event mouseEvent) { if (mouseEvent.type == EventType.scrollWheel && mouseEvent.shift && !mouseEvent.control && !mouseEvent.alt) { mouseEvent.Use(); if (Event.current.delta.y >= 0f) { YuME_mapEditor.gridHeight++; } else { YuME_mapEditor.gridHeight--; } } if (mouseEvent.type == EventType.scrollWheel && mouseEvent.shift && mouseEvent.alt && !mouseEvent.control) { mouseEvent.Use(); if (Event.current.delta.y >= 0f) { YuME_mapEditor.gridHeight += 0.25f; } else { YuME_mapEditor.gridHeight -= 0.25f; } } else if (mouseEvent.type == EventType.scrollWheel && mouseEvent.control && mouseEvent.alt && YuME_mapEditor.selectedTool == YuME_mapEditor.toolIcons.brushTool) { mouseEvent.Use(); if (Event.current.delta.y >= 0f) { YuME_mapEditor.tileRotation += 90f; } else { YuME_mapEditor.tileRotation -= 90f; } } else if (mouseEvent.type == EventType.scrollWheel && mouseEvent.control && mouseEvent.shift == true && YuME_mapEditor.selectedTool == YuME_mapEditor.toolIcons.brushTool) { mouseEvent.Use(); YuME_mapEditor.currentBrushType = YuME_mapEditor.brushTypes.standardBrush; if (Event.current.delta.y > 0f) { YuME_mapEditor.currentBrushIndex++; if (YuME_mapEditor.currentBrushIndex >= YuME_mapEditor.currentTileSetObjects.Length) { YuME_mapEditor.currentBrushIndex = YuME_mapEditor.currentTileSetObjects.Length - 1; } YuME_mapEditor.currentTile = YuME_mapEditor.currentTileSetObjects[YuME_mapEditor.currentBrushIndex]; YuME_mapEditor.currentTile.transform.eulerAngles = new Vector3(0f, YuME_mapEditor.tileRotation, 0f); YuME_brushFunctions.updateBrushTile(); } else { YuME_mapEditor.currentBrushIndex--; if (YuME_mapEditor.currentBrushIndex < 0) { YuME_mapEditor.currentBrushIndex = 0; } YuME_mapEditor.currentTile = YuME_mapEditor.currentTileSetObjects[YuME_mapEditor.currentBrushIndex]; YuME_mapEditor.currentTile.transform.eulerAngles = new Vector3(0f, YuME_mapEditor.tileRotation, 0f); YuME_brushFunctions.updateBrushTile(); } } }
public static void checkMouseShortcuts(Event mouseEvent) { if (mouseEvent.type == EventType.ScrollWheel && mouseEvent.shift && !mouseEvent.control && !mouseEvent.alt) { mouseEvent.Use(); if (!YuME_mapEditor.editorPreferences.invertMouseWheel) { if (!YuME_mapEditor.editorPreferences.twoPointFiveDMode) { if (Event.current.delta.y - Event.current.delta.x >= 0f) { YuME_mapEditor.gridHeight += YuME_mapEditor.globalScale * YuME_mapEditor.editorPreferences.gridLayerHeightScaler; } else { YuME_mapEditor.gridHeight -= YuME_mapEditor.globalScale * YuME_mapEditor.editorPreferences.gridLayerHeightScaler; } } else { if (Event.current.delta.y - Event.current.delta.x >= 0f) { YuME_mapEditor.gridHeight -= YuME_mapEditor.globalScale * YuME_mapEditor.editorPreferences.gridLayerHeightScaler; } else { YuME_mapEditor.gridHeight += YuME_mapEditor.globalScale * YuME_mapEditor.editorPreferences.gridLayerHeightScaler; } } } else { if (!YuME_mapEditor.editorPreferences.twoPointFiveDMode) { if (Event.current.delta.y - Event.current.delta.x >= 0f) { YuME_mapEditor.gridHeight -= YuME_mapEditor.globalScale * YuME_mapEditor.editorPreferences.gridLayerHeightScaler; } else { YuME_mapEditor.gridHeight += YuME_mapEditor.globalScale * YuME_mapEditor.editorPreferences.gridLayerHeightScaler; } } else { if (Event.current.delta.y - Event.current.delta.x >= 0f) { YuME_mapEditor.gridHeight += YuME_mapEditor.globalScale * YuME_mapEditor.editorPreferences.gridLayerHeightScaler; } else { YuME_mapEditor.gridHeight -= YuME_mapEditor.globalScale * YuME_mapEditor.editorPreferences.gridLayerHeightScaler; } } } } if (mouseEvent.type == EventType.ScrollWheel && mouseEvent.shift && mouseEvent.alt && !mouseEvent.control) { mouseEvent.Use(); if (!YuME_mapEditor.editorPreferences.invertMouseWheel) { if (Event.current.delta.y - Event.current.delta.x >= 0f) { YuME_mapEditor.gridHeight += (YuME_mapEditor.globalScale * 0.25f); } else { YuME_mapEditor.gridHeight -= (YuME_mapEditor.globalScale * 0.25f); } } else { if (Event.current.delta.y - Event.current.delta.x >= 0f) { YuME_mapEditor.gridHeight -= (YuME_mapEditor.globalScale * 0.25f); } else { YuME_mapEditor.gridHeight += (YuME_mapEditor.globalScale * 0.25f); } } } else if (mouseEvent.type == EventType.ScrollWheel && mouseEvent.control && mouseEvent.alt && YuME_mapEditor.selectedTool == YuME_mapEditor.toolIcons.brushTool) { mouseEvent.Use(); if (Event.current.delta.y - Event.current.delta.x >= 0f) { YuME_mapEditor.tileRotation += 90f; } else { YuME_mapEditor.tileRotation -= 90f; } } else if (mouseEvent.type == EventType.ScrollWheel && mouseEvent.control && mouseEvent.shift == true && YuME_mapEditor.selectedTool == YuME_mapEditor.toolIcons.brushTool) { mouseEvent.Use(); YuME_mapEditor.currentBrushType = YuME_mapEditor.brushTypes.standardBrush; if (!YuME_mapEditor.editorPreferences.invertMouseWheel) { if (Event.current.delta.y - Event.current.delta.x > 0f) { YuME_mapEditor.currentBrushIndex++; if (YuME_mapEditor.currentBrushIndex >= YuME_mapEditor.currentTileSetObjects.Length) { YuME_mapEditor.currentBrushIndex = YuME_mapEditor.currentTileSetObjects.Length - 1; } YuME_mapEditor.currentTile = YuME_mapEditor.currentTileSetObjects[YuME_mapEditor.currentBrushIndex]; YuME_mapEditor.currentTile.transform.eulerAngles = new Vector3(YuME_mapEditor.tileRotationX, YuME_mapEditor.tileRotation, 0f); YuME_brushFunctions.updateBrushTile(); } else { YuME_mapEditor.currentBrushIndex--; if (YuME_mapEditor.currentBrushIndex < 0) { YuME_mapEditor.currentBrushIndex = 0; } YuME_mapEditor.currentTile = YuME_mapEditor.currentTileSetObjects[YuME_mapEditor.currentBrushIndex]; YuME_mapEditor.currentTile.transform.eulerAngles = new Vector3(YuME_mapEditor.tileRotationX, YuME_mapEditor.tileRotation, 0f); YuME_brushFunctions.updateBrushTile(); } } else { if (Event.current.delta.y - Event.current.delta.x < 0f) { YuME_mapEditor.currentBrushIndex++; if (YuME_mapEditor.currentBrushIndex >= YuME_mapEditor.currentTileSetObjects.Length) { YuME_mapEditor.currentBrushIndex = YuME_mapEditor.currentTileSetObjects.Length - 1; } YuME_mapEditor.currentTile = YuME_mapEditor.currentTileSetObjects[YuME_mapEditor.currentBrushIndex]; YuME_mapEditor.currentTile.transform.eulerAngles = new Vector3(YuME_mapEditor.tileRotationX, YuME_mapEditor.tileRotation, 0f); YuME_brushFunctions.updateBrushTile(); } else { YuME_mapEditor.currentBrushIndex--; if (YuME_mapEditor.currentBrushIndex < 0) { YuME_mapEditor.currentBrushIndex = 0; } YuME_mapEditor.currentTile = YuME_mapEditor.currentTileSetObjects[YuME_mapEditor.currentBrushIndex]; YuME_mapEditor.currentTile.transform.eulerAngles = new Vector3(YuME_mapEditor.tileRotationX, YuME_mapEditor.tileRotation, 0f); YuME_brushFunctions.updateBrushTile(); } } } }