public CopyFrom ( |
||
target | ||
return | void |
/// <summary> /// Searches for a folder config that has the same type and key, and updates /// its other fields with provided value, if found; creates new folder config otherwise. /// </summary> public void UpdateFolder(RainbowFolder match, RainbowFolder value) { Undo.RecordObject(this, "Modify Rainbow Folder Settings"); RainbowFolder existingFolder = GetFolder(match); if (existingFolder != null) { if (value.HasAtLeastOneIcon()) { existingFolder.CopyFrom(value); } else { RemoveAll(match); } } else { if (value.HasAtLeastOneIcon()) { AddFolder(value); } } EditorUtility.SetDirty(this); }
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); }