示例#1
0
 private void EnableFocus()
 {
     TilemapEditorUserSettings.FocusMode focusMode = TilemapEditorUserSettings.focusMode;
     if (focusMode != TilemapEditorUserSettings.FocusMode.Tilemap)
     {
         if (focusMode == TilemapEditorUserSettings.FocusMode.Grid)
         {
             Tilemap component = GridPaintingState.scenePaintTarget.GetComponent <Tilemap>();
             if (component != null && component.layoutGrid != null)
             {
                 if (SceneView.lastActiveSceneView != null)
                 {
                     SceneView.lastActiveSceneView.SetSceneViewFiltering(true);
                 }
                 HierarchyProperty.FilterSingleSceneObject(component.layoutGrid.gameObject.GetInstanceID(), false);
             }
         }
     }
     else
     {
         if (SceneView.lastActiveSceneView != null)
         {
             SceneView.lastActiveSceneView.SetSceneViewFiltering(true);
         }
         HierarchyProperty.FilterSingleSceneObject(GridPaintingState.scenePaintTarget.GetInstanceID(), false);
     }
 }
示例#2
0
 private void DisplayFocusMode(UnityEngine.Object displayTarget, SceneView sceneView)
 {
     TilemapEditorUserSettings.FocusMode focusMode  = TilemapEditorUserSettings.focusMode;
     TilemapEditorUserSettings.FocusMode focusMode2 = (TilemapEditorUserSettings.FocusMode)EditorGUILayout.EnumPopup(GridPaintPaletteWindow.Styles.focusLabel, focusMode, new GUILayoutOption[0]);
     if (focusMode2 != focusMode)
     {
         this.DisableFocus();
         TilemapEditorUserSettings.focusMode = focusMode2;
         this.EnableFocus();
     }
 }