private void InitIfNeeded() { if (this.m_ListAreaState == null) { this.m_ListAreaState = new ObjectListAreaState(); } if (this.m_ListArea != null) { return; } this.m_ListArea = new ObjectListArea(this.m_ListAreaState, (EditorWindow)this, true); this.m_ListArea.allowDeselection = false; this.m_ListArea.allowDragging = false; this.m_ListArea.allowFocusRendering = false; this.m_ListArea.allowMultiSelect = false; this.m_ListArea.allowRenaming = false; this.m_ListArea.allowBuiltinResources = true; this.m_ListArea.repaintCallback += new System.Action(((EditorWindow)this).Repaint); this.m_ListArea.itemSelectedCallback += new System.Action <bool>(this.ListAreaItemSelectedCallback); this.m_ListArea.gridSize = this.m_StartGridSize.value; SearchFilter searchFilter = new SearchFilter(); searchFilter.nameFilter = this.m_SearchFilter; if (!string.IsNullOrEmpty(this.m_RequiredType)) { searchFilter.classNames = new string[1] { this.m_RequiredType } } ; this.m_ListArea.Init(this.listPosition, !this.m_IsShowingAssets ? HierarchyType.GameObjects : HierarchyType.Assets, searchFilter, true); }
private void InitIfNeeded() { if (this.m_ListAreaState == null) { this.m_ListAreaState = new ObjectListAreaState(); } if (this.m_ListArea == null) { this.m_ListArea = new ObjectListArea(this.m_ListAreaState, this, true); this.m_ListArea.allowDeselection = false; this.m_ListArea.allowDragging = false; this.m_ListArea.allowFocusRendering = false; this.m_ListArea.allowMultiSelect = false; this.m_ListArea.allowRenaming = false; this.m_ListArea.allowBuiltinResources = true; ObjectListArea expr_82 = this.m_ListArea; expr_82.repaintCallback = (Action)Delegate.Combine(expr_82.repaintCallback, new Action(base.Repaint)); ObjectListArea expr_A9 = this.m_ListArea; expr_A9.itemSelectedCallback = (Action <bool>)Delegate.Combine(expr_A9.itemSelectedCallback, new Action <bool>(this.ListAreaItemSelectedCallback)); this.m_ListArea.gridSize = this.m_StartGridSize.value; SearchFilter searchFilter = new SearchFilter(); searchFilter.nameFilter = this.m_SearchFilter; if (!string.IsNullOrEmpty(this.m_RequiredType)) { searchFilter.classNames = new string[] { this.m_RequiredType }; } this.m_ListArea.Init(this.listPosition, (!this.m_IsShowingAssets) ? HierarchyType.GameObjects : HierarchyType.Assets, searchFilter, true); } }
private void InitIfNeeded() { if (this.m_ListAreaState == null) { this.m_ListAreaState = new ObjectListAreaState(); } if (this.m_ListArea == null) { this.m_ListArea = new ObjectListArea(this.m_ListAreaState, this, true); this.m_ListArea.allowDeselection = false; this.m_ListArea.allowDragging = false; this.m_ListArea.allowFocusRendering = false; this.m_ListArea.allowMultiSelect = false; this.m_ListArea.allowRenaming = false; this.m_ListArea.allowBuiltinResources = true; this.m_ListArea.repaintCallback = (System.Action)Delegate.Combine(this.m_ListArea.repaintCallback, new System.Action(this.Repaint)); this.m_ListArea.itemSelectedCallback = (Action <bool>)Delegate.Combine(this.m_ListArea.itemSelectedCallback, new Action <bool>(this.ListAreaItemSelectedCallback)); this.m_ListArea.gridSize = this.m_StartGridSize.value; this.FilterSettingsChanged(); } }
// Grid Section void InitIfNeeded() { if (m_ListAreaState == null) { m_ListAreaState = new ObjectListAreaState(); // is serialized } if (m_ListArea == null) { m_ListArea = new ObjectListArea(m_ListAreaState, this, true); m_ListArea.allowDeselection = false; m_ListArea.allowDragging = false; m_ListArea.allowFocusRendering = false; m_ListArea.allowMultiSelect = false; m_ListArea.allowRenaming = false; m_ListArea.allowBuiltinResources = true; m_ListArea.repaintCallback += Repaint; m_ListArea.itemSelectedCallback += ListAreaItemSelectedCallback; m_ListArea.gridSize = m_StartGridSize.value; FilterSettingsChanged(); } }
void InitListArea() { m_ListAreaState = new ObjectListAreaState() { m_GridSize = m_SavedGridSize }; listArea = new ObjectListArea(m_ListAreaState, editorWindow, false) { allowDeselection = true, allowMultiSelect = false, allowRenaming = false, allowBuiltinResources = true, }; listArea.itemSelectedCallback += (bool doubleClicked) => { if (listArea.GetSelection().Length == 0) { return; } var selection = listArea.GetSelection()[0]; GUIUtility.keyboardControl = GUIUtility.GetControlID(FocusType.Keyboard); if (doubleClicked) { Selection.SetActiveObjectWithContext(EditorUtility.InstanceIDToObject(selection), null); Event.current.Use(); editorWindow.Close(); GUIUtility.ExitGUI(); } else { EditorGUIUtility.PingObject(selection); Event.current.Use(); } }; SearchFilterChanged(); }
private void InitIfNeeded() { if (this.m_ListAreaState == null) { this.m_ListAreaState = new ObjectListAreaState(); } if (this.m_ListArea == null) { this.m_ListArea = new ObjectListArea(this.m_ListAreaState, this, true); this.m_ListArea.allowDeselection = false; this.m_ListArea.allowDragging = false; this.m_ListArea.allowFocusRendering = false; this.m_ListArea.allowMultiSelect = false; this.m_ListArea.allowRenaming = false; this.m_ListArea.allowBuiltinResources = true; ObjectListArea expr_82 = this.m_ListArea; expr_82.repaintCallback = (Action)Delegate.Combine(expr_82.repaintCallback, new Action(base.Repaint)); ObjectListArea expr_A9 = this.m_ListArea; expr_A9.itemSelectedCallback = (Action<bool>)Delegate.Combine(expr_A9.itemSelectedCallback, new Action<bool>(this.ListAreaItemSelectedCallback)); this.m_ListArea.gridSize = this.m_StartGridSize.value; SearchFilter searchFilter = new SearchFilter(); searchFilter.nameFilter = this.m_SearchFilter; if (!string.IsNullOrEmpty(this.m_RequiredType)) { searchFilter.classNames = new string[] { this.m_RequiredType }; } this.m_ListArea.Init(this.listPosition, (!this.m_IsShowingAssets) ? HierarchyType.GameObjects : HierarchyType.Assets, searchFilter, true); } }
public ObjectListArea(ObjectListAreaState state, EditorWindow owner, bool showNoneItem) { this.m_State = state; this.m_Owner = owner; AssetStorePreviewManager.MaxCachedImages = 72; this.m_StoreAssets = new List<ObjectListArea.AssetStoreGroup>(); this.m_RequeryAssetStore = false; this.m_LocalAssets = new ObjectListArea.LocalGroup(this, string.Empty, showNoneItem); this.m_Groups = new List<ObjectListArea.Group>(); this.m_Groups.Add((ObjectListArea.Group) this.m_LocalAssets); }
public void Init() { if (this.Initialized()) return; this.m_FocusSearchField = false; if (this.m_SearchFilter == null) this.m_DirectoriesAreaWidth = Mathf.Min(this.position.width / 2f, 200f); if (this.m_SearchFilter == null) this.m_SearchFilter = new SearchFilter(); this.m_SearchFieldText = this.m_SearchFilter.FilterToSearchFieldString(); this.CalculateRects(); this.RefreshSelectedPath(); this.SetupDroplists(); if (this.m_ListAreaState == null) this.m_ListAreaState = new ObjectListAreaState(); this.m_ListAreaState.m_RenameOverlay.isRenamingFilename = true; this.m_ListArea = new ObjectListArea(this.m_ListAreaState, (EditorWindow) this, false); this.m_ListArea.allowDeselection = true; this.m_ListArea.allowDragging = true; this.m_ListArea.allowFocusRendering = true; this.m_ListArea.allowMultiSelect = true; this.m_ListArea.allowRenaming = true; this.m_ListArea.allowBuiltinResources = false; this.m_ListArea.allowUserRenderingHook = true; this.m_ListArea.allowFindNextShortcut = true; this.m_ListArea.foldersFirst = this.GetShouldShowFoldersFirst(); this.m_ListArea.repaintCallback += new System.Action(((EditorWindow) this).Repaint); this.m_ListArea.itemSelectedCallback += new System.Action<bool>(this.ListAreaItemSelectedCallback); this.m_ListArea.keyboardCallback += new System.Action(this.ListAreaKeyboardCallback); this.m_ListArea.gotKeyboardFocus += new System.Action(this.ListGotKeyboardFocus); this.m_ListArea.drawLocalAssetHeader += new Func<Rect, float>(this.DrawLocalAssetHeader); this.m_ListArea.assetStoreSearchEnded += new System.Action(this.AssetStoreSearchEndedCallback); this.m_ListArea.gridSize = this.m_StartGridSize; this.m_StartGridSize = Mathf.Clamp(this.m_StartGridSize, this.m_ListArea.minGridSize, this.m_ListArea.maxGridSize); this.m_LastFoldersGridSize = Mathf.Min(this.m_LastFoldersGridSize, (float) this.m_ListArea.maxGridSize); this.InitListArea(); this.SyncFilterGUI(); if (this.m_FolderTreeState == null) this.m_FolderTreeState = new TreeViewState(); this.m_FolderTreeState.renameOverlay.isRenamingFilename = true; if (this.m_AssetTreeState == null) this.m_AssetTreeState = new TreeViewState(); this.m_AssetTreeState.renameOverlay.isRenamingFilename = true; this.InitViewMode(this.m_ViewMode); this.m_SearchAreaMenu = new ExposablePopupMenu(); this.RefreshSearchText(); this.DefaultSetup(); }
private void InitIfNeeded() { if (this.m_ListAreaState == null) this.m_ListAreaState = new ObjectListAreaState(); if (this.m_ListArea != null) return; this.m_ListArea = new ObjectListArea(this.m_ListAreaState, (EditorWindow) this, true); this.m_ListArea.allowDeselection = false; this.m_ListArea.allowDragging = false; this.m_ListArea.allowFocusRendering = false; this.m_ListArea.allowMultiSelect = false; this.m_ListArea.allowRenaming = false; this.m_ListArea.allowBuiltinResources = true; this.m_ListArea.repaintCallback += new System.Action(((EditorWindow) this).Repaint); this.m_ListArea.itemSelectedCallback += new System.Action<bool>(this.ListAreaItemSelectedCallback); this.m_ListArea.gridSize = this.m_StartGridSize.value; SearchFilter searchFilter = new SearchFilter(); searchFilter.nameFilter = this.m_SearchFilter; if (!string.IsNullOrEmpty(this.m_RequiredType)) searchFilter.classNames = new string[1] { this.m_RequiredType }; this.m_ListArea.Init(this.listPosition, !this.m_IsShowingAssets ? HierarchyType.GameObjects : HierarchyType.Assets, searchFilter, true); }
private void InitIfNeeded() { if (this.m_ListAreaState == null) { this.m_ListAreaState = new ObjectListAreaState(); } if (this.m_ListArea == null) { this.m_ListArea = new ObjectListArea(this.m_ListAreaState, this, true); this.m_ListArea.allowDeselection = false; this.m_ListArea.allowDragging = false; this.m_ListArea.allowFocusRendering = false; this.m_ListArea.allowMultiSelect = false; this.m_ListArea.allowRenaming = false; this.m_ListArea.allowBuiltinResources = true; this.m_ListArea.repaintCallback = (Action) Delegate.Combine(this.m_ListArea.repaintCallback, new Action(this, (IntPtr) this.Repaint)); this.m_ListArea.itemSelectedCallback = (Action<bool>) Delegate.Combine(this.m_ListArea.itemSelectedCallback, new Action<bool>(this.ListAreaItemSelectedCallback)); this.m_ListArea.gridSize = this.m_StartGridSize.value; this.FilterSettingsChanged(); } }
public void Init() { if (this.Initialized()) { return; } this.m_FocusSearchField = false; bool flag = this.m_SearchFilter == null; if (flag) { this.m_DirectoriesAreaWidth = Mathf.Min(base.position.width / 2f, 200f); } if (this.m_SearchFilter == null) { this.m_SearchFilter = new SearchFilter(); } this.m_SearchFieldText = this.m_SearchFilter.FilterToSearchFieldString(); this.CalculateRects(); this.RefreshSelectedPath(); this.SetupDroplists(); if (this.m_ListAreaState == null) { this.m_ListAreaState = new ObjectListAreaState(); } this.m_ListAreaState.m_RenameOverlay.isRenamingFilename = true; this.m_ListArea = new ObjectListArea(this.m_ListAreaState, this, false); this.m_ListArea.allowDeselection = true; this.m_ListArea.allowDragging = true; this.m_ListArea.allowFocusRendering = true; this.m_ListArea.allowMultiSelect = true; this.m_ListArea.allowRenaming = true; this.m_ListArea.allowBuiltinResources = false; this.m_ListArea.allowUserRenderingHook = true; this.m_ListArea.allowFindNextShortcut = true; this.m_ListArea.foldersFirst = this.GetShouldShowFoldersFirst(); ObjectListArea expr_131 = this.m_ListArea; expr_131.repaintCallback = (Action)Delegate.Combine(expr_131.repaintCallback, new Action(base.Repaint)); ObjectListArea expr_158 = this.m_ListArea; expr_158.itemSelectedCallback = (Action<bool>)Delegate.Combine(expr_158.itemSelectedCallback, new Action<bool>(this.ListAreaItemSelectedCallback)); ObjectListArea expr_17F = this.m_ListArea; expr_17F.keyboardCallback = (Action)Delegate.Combine(expr_17F.keyboardCallback, new Action(this.ListAreaKeyboardCallback)); ObjectListArea expr_1A6 = this.m_ListArea; expr_1A6.gotKeyboardFocus = (Action)Delegate.Combine(expr_1A6.gotKeyboardFocus, new Action(this.ListGotKeyboardFocus)); ObjectListArea expr_1CD = this.m_ListArea; expr_1CD.drawLocalAssetHeader = (Func<Rect, float>)Delegate.Combine(expr_1CD.drawLocalAssetHeader, new Func<Rect, float>(this.DrawLocalAssetHeader)); ObjectListArea expr_1F4 = this.m_ListArea; expr_1F4.assetStoreSearchEnded = (Action)Delegate.Combine(expr_1F4.assetStoreSearchEnded, new Action(this.AssetStoreSearchEndedCallback)); this.m_ListArea.gridSize = this.m_StartGridSize; this.m_StartGridSize = Mathf.Clamp(this.m_StartGridSize, this.m_ListArea.minGridSize, this.m_ListArea.maxGridSize); this.m_LastFoldersGridSize = Mathf.Min(this.m_LastFoldersGridSize, (float)this.m_ListArea.maxGridSize); this.InitListArea(); this.SyncFilterGUI(); if (this.m_FolderTreeState == null) { this.m_FolderTreeState = new TreeViewState(); } this.m_FolderTreeState.renameOverlay.isRenamingFilename = true; if (this.m_AssetTreeState == null) { this.m_AssetTreeState = new TreeViewState(); } this.m_AssetTreeState.renameOverlay.isRenamingFilename = true; this.InitViewMode(this.m_ViewMode); this.m_SearchAreaMenu = new ExposablePopupMenu(); this.RefreshSearchText(); this.DefaultSetup(); }