public void Setup(SettingsEditorWindow window) { _disposables.Clear(); _window = window; _disposables.Add(_window.BasePackingMode.Skip(1).Subscribe(OnBasePackingModeChanged)); _disposables.Add(_window.BaseAddressingMode.Skip(1).Subscribe(OnBaseAddressingModeChanged)); _disposables.Add(_window.GroupTemplate.Skip(1).Subscribe(OnGroupTemplateChanged)); _disposables.Add(_window.OnRedoShortcutExecutedAsObservable.Subscribe(_ => Redo())); _disposables.Add(_window.OnUndoShortcutExecutedAsObservable.Subscribe(_ => Undo())); }
public void Setup(SettingsEditorWindow window) { _disposables.Clear(); _window = window; var state = _settingsService.GetState(); _disposables.Add(state.BasePackingMode.Subscribe(x => _window.BasePackingMode.SetValueAndNotNotify(x))); _disposables.Add( state.BaseAddressingMode.Subscribe(x => _window.BaseAddressingMode.SetValueAndNotNotify(x))); _disposables.Add(state.GroupTemplateGuid.Subscribe(x => { var assetPath = AssetDatabase.GUIDToAssetPath(x); var groupTemplate = AssetDatabase.LoadAssetAtPath <AddressableAssetGroupTemplate>(assetPath); _window.GroupTemplate.SetValueAndNotNotify(groupTemplate); })); }