private void DrawUnReferenceFolderRefSprites() { GUILayout.BeginVertical(GUILayout.Width(ACStyles.SpriteViewWidth)); GUILayout.Label("Un Reference Folder Reference Sprites " + _unReferenceFolderRefSprites.Count); DrawSearchToolBar(ReferenceSpriteType.UnReferenceFolderRefSprite); _scrollPos = GUILayout.BeginScrollView(_scrollPos); TryInitDrawUnReferenceFolderRefSpritesParams(); DrawSprites(_unReferenceFolderRefSprites); GUILayout.EndScrollView(); GUILayout.EndVertical(); //if (Event.current.type == EventType.Repaint) { // _selectSpritesScrollArea = GUILayoutUtility.GetLastRect(); //} if (_curSelectSprite != null) { _curSelectSprite.DrawReferences(false); } }
public void DrawAcSprites() { GUILayout.BeginVertical(GUILayout.Width(ACStyles.SpriteViewWidth)); GUILayout.Label("SPRITES " + _acSprites.Count); _spriteScrollPos = GUILayout.BeginScrollView(_spriteScrollPos); TryInitDrawAcSpritesParams(); for (int i = 0; i < _acSprites.Count; i++) { var sprite = _acSprites[i]; GUILayout.BeginHorizontal(); { sprite.DrawIcon(); bool lastToggle = _spriteToggleStates[i]; _spriteToggleStates[i] = GUILayout.Toggle(_spriteToggleStates[i], sprite.AssetFile, ACWindow.ACStyles.SpriteButton, GUILayout.Height(ACStyles.IconSize), GUILayout.Height(ACStyles.IconSize)); if (!lastToggle && _spriteToggleStates[i]) { _curSelectSprite = sprite; EditorWindowHelper.ResetToggleStates(_spriteToggleStates, i); Selection.activeObject = AssetDatabase.LoadMainAssetAtPath(sprite.AssetFile); EditorGUIUtility.PingObject(Selection.activeObject); } } GUILayout.EndHorizontal(); } GUILayout.EndScrollView(); GUILayout.EndVertical(); if (_curSelectSprite != null) { _curSelectSprite.DrawReferences(); } }