void HideEditorMesh() { Renderer[] rr = grid.GetComponentsInChildren <Renderer> (true); for (int k = 0; k < rr.Length; k++) { #if UNITY_5_5_OR_NEWER EditorUtility.SetSelectedRenderState(rr [k], EditorSelectedRenderState.Hidden); #else EditorUtility.SetSelectedWireframeHidden(rr [k], true); #endif } }