public void ShowWithParams(Vector2 inPosition, List <string> paths, int pathIndex) { _paths = paths; _settings = RainbowFoldersSettings.Instance; var size = paths.Count; _existingFolders = new RainbowFolder[size]; _currentFolder = new RainbowFolder(KeyType.Path, paths[pathIndex]); for (var i = 0; i < size; i++) { _existingFolders[i] = _settings.GetFolderByPath(paths[i]); } if (_existingFolders[pathIndex] != null) { _currentFolder.CopyFrom(_existingFolders[pathIndex]); } // Resize var customIconHeight = (_currentFolder.IsIconCustom) ? LINE_HEIGHT * 2f : 0f; var customBackgroundHeight = (_currentFolder.IsBackgroundCustom) ? LINE_HEIGHT : 0f; var rect = new Rect(inPosition, WINDOW_SIZE) { height = WINDOW_HEIGHT + customIconHeight + customBackgroundHeight }; _windowRect = new Rect(Vector2.zero, rect.size); _backgroundRect = new Rect(Vector2.one, rect.size - new Vector2(2f, 2f)); Show <RainbowFoldersPopup>(rect); }
public void ShowWithParams(Vector2 position, string[] paths, int pathIndex) { _paths = paths; _settings = RainbowFoldersSettings.Instance; var size = paths.Length; _existingFolders = new RainbowFolder[size]; _currentFolder = new RainbowFolder(KeyType.Path, paths[pathIndex]); for (var i = 0; i < size; i++) { _existingFolders[i] = _settings.GetFolderByPath(paths[i]); } if (_existingFolders[pathIndex] != null) { _currentFolder.CopyFrom(_existingFolders[pathIndex]); } var rect = new Rect(position, WINDOW_SIZE); Show <RainbowFoldersPopup>(rect); }