void Deselect() { Gizmo_OLD.Detach(); Gizmo_OLD.Visible = false; if (currentlySelected != null) { OnDeselected.Invoke(currentlySelected.GetComponent <EditableVertex>()); } }
public void Deselect() { Gizmo_OLD.Detach(); Gizmo_OLD.Visible = false; //place currently selected back into mesh if (currentlySelected != null) { var selectedPrimitive = currentlySelected.GetComponent <EditablePrimitive>(); var editableMesh = LevelEditor.CurrentLevel.EditableLevelMesh.GetMaterialMesh(selectedPrimitive.Material); editableMesh.AddPrimitive(selectedPrimitive.info); editableMesh.UpdateMesh(); OnDeselected.Invoke(selectedPrimitive); Destroy(currentlySelected); currentlySelected = null; } }