├── .github ├── CODEOWNERS └── workflows │ ├── acquire-activation-file.yml │ ├── on-release.yml │ └── tests.yml ├── .gitignore ├── .vsconfig ├── Assets ├── Package.meta ├── Package │ ├── CHANGELOG.md │ ├── CHANGELOG.md.meta │ ├── Editor.meta │ ├── Editor │ │ ├── ByAttributeMainToolbarElementRepository.cs │ │ ├── ByAttributeMainToolbarElementRepository.cs.meta │ │ ├── ControlPanelWindow.meta │ │ ├── ControlPanelWindow │ │ │ ├── MainToolbarControlPanelWindow.cs │ │ │ ├── MainToolbarControlPanelWindow.cs.meta │ │ │ ├── MainToolbarElementController.cs │ │ │ ├── MainToolbarElementController.cs.meta │ │ │ ├── OrganizationalFoldableContainer.cs │ │ │ ├── OrganizationalFoldableContainer.cs.meta │ │ │ ├── OverridableElement.cs │ │ │ └── OverridableElement.cs.meta │ │ ├── Extensions.meta │ │ ├── Extensions │ │ │ ├── EditorWindowExtensions.cs │ │ │ └── EditorWindowExtensions.cs.meta │ │ ├── GroupDefinitions.meta │ │ ├── GroupDefinitions │ │ │ ├── GroupDefinition.cs │ │ │ ├── GroupDefinition.cs.meta │ │ │ ├── GroupDropdownWindowPopup.cs │ │ │ ├── GroupDropdownWindowPopup.cs.meta │ │ │ ├── GroupDropdownWindowPopupManager.cs │ │ │ ├── GroupDropdownWindowPopupManager.cs.meta │ │ │ ├── GroupElement.cs │ │ │ ├── GroupElement.cs.meta │ │ │ ├── GroupPopupSubWindowAttribute.cs │ │ │ ├── GroupPopupSubWindowAttribute.cs.meta │ │ │ ├── IGroupDefinitionRepository.cs │ │ │ ├── IGroupDefinitionRepository.cs.meta │ │ │ ├── MainToolbarElementDropdownAttribute.cs │ │ │ ├── MainToolbarElementDropdownAttribute.cs.meta │ │ │ ├── MainToolbarElementDropdownDrawer.cs │ │ │ ├── MainToolbarElementDropdownDrawer.cs.meta │ │ │ ├── ScriptableGroupDefinition.cs │ │ │ ├── ScriptableGroupDefinition.cs.meta │ │ │ ├── ScriptableGroupDefinitionHelper.cs │ │ │ ├── ScriptableGroupDefinitionHelper.cs.meta │ │ │ ├── ScriptableObjectGroupDefinitionRepository.cs │ │ │ └── ScriptableObjectGroupDefinitionRepository.cs.meta │ │ ├── Helpers.meta │ │ ├── Helpers │ │ │ ├── GlobalActions.cs │ │ │ ├── GlobalActions.cs.meta │ │ │ ├── Icons.cs │ │ │ ├── Icons.cs.meta │ │ │ ├── MenuItems.cs │ │ │ ├── MenuItems.cs.meta │ │ │ ├── RefreshToolbarAutomaticExtenderOnSave.cs │ │ │ ├── RefreshToolbarAutomaticExtenderOnSave.cs.meta │ │ │ ├── ServicesAndRepositories.cs │ │ │ ├── ServicesAndRepositories.cs.meta │ │ │ ├── ToolInfo.cs │ │ │ ├── ToolInfo.cs.meta │ │ │ ├── UnityNativeElementsIds.cs │ │ │ ├── UnityNativeElementsIds.cs.meta │ │ │ ├── UserSettingsPrefs.cs │ │ │ └── UserSettingsPrefs.cs.meta │ │ ├── IMainToolbarElementRepository.cs │ │ ├── IMainToolbarElementRepository.cs.meta │ │ ├── MainToolbar.cs │ │ ├── MainToolbar.cs.meta │ │ ├── MainToolbarAutomaticExtender.cs │ │ ├── MainToolbarAutomaticExtender.cs.meta │ │ ├── MainToolbarCustomContainer.cs │ │ ├── MainToolbarCustomContainer.cs.meta │ │ ├── MainToolbarElement.cs │ │ ├── MainToolbarElement.cs.meta │ │ ├── MainToolbarElementAttribute.cs │ │ ├── MainToolbarElementAttribute.cs.meta │ │ ├── MainToolbarElementOverrideApplier.cs │ │ ├── MainToolbarElementOverrideApplier.cs.meta │ │ ├── NativeToolbarElement.cs │ │ ├── NativeToolbarElement.cs.meta │ │ ├── Override.meta │ │ ├── Override │ │ │ ├── IMainToolbarElementOverrideRepository.cs │ │ │ ├── IMainToolbarElementOverrideRepository.cs.meta │ │ │ ├── MainToolbarElementOverride.cs │ │ │ ├── MainToolbarElementOverride.cs.meta │ │ │ ├── UserSettingsFileMainToolbarElementOverrideRepository.cs │ │ │ └── UserSettingsFileMainToolbarElementOverrideRepository.cs.meta │ │ ├── Paps.UnityToolbarExtenderUIToolkit.asmdef │ │ ├── Paps.UnityToolbarExtenderUIToolkit.asmdef.meta │ │ ├── RecommendedStyles.meta │ │ ├── RecommendedStyles │ │ │ ├── ButtonRecommendedStyle.cs │ │ │ ├── ButtonRecommendedStyle.cs.meta │ │ │ ├── ColorFieldRecommendedStyle.cs │ │ │ ├── ColorFieldRecommendedStyle.cs.meta │ │ │ ├── DropdownFieldRecommendedStyle.cs │ │ │ ├── DropdownFieldRecommendedStyle.cs.meta │ │ │ ├── EditorToolbarDropdownRecommendedStyle.cs │ │ │ ├── EditorToolbarDropdownRecommendedStyle.cs.meta │ │ │ ├── EditorToolbarToggleRecommendedStyle.cs │ │ │ ├── EditorToolbarToggleRecommendedStyle.cs.meta │ │ │ ├── EnumFieldRecommendedStyle.cs │ │ │ ├── EnumFieldRecommendedStyle.cs.meta │ │ │ ├── EnumFlagsFieldRecommendedStyle.cs │ │ │ ├── EnumFlagsFieldRecommendedStyle.cs.meta │ │ │ ├── FloatFieldRecommendedStyle.cs │ │ │ ├── FloatFieldRecommendedStyle.cs.meta │ │ │ ├── IntegerFieldRecommendedStyle.cs │ │ │ ├── IntegerFieldRecommendedStyle.cs.meta │ │ │ ├── LayerFieldRecommendedStyle.cs │ │ │ ├── LayerFieldRecommendedStyle.cs.meta │ │ │ ├── ObjectFieldRecommendedStyle.cs │ │ │ ├── ObjectFieldRecommendedStyle.cs.meta │ │ │ ├── RecommendedStyle.cs │ │ │ ├── RecommendedStyle.cs.meta │ │ │ ├── RecommendedStyleVisualElement.cs │ │ │ ├── RecommendedStyleVisualElement.cs.meta │ │ │ ├── RecommendedStyles.cs │ │ │ ├── RecommendedStyles.cs.meta │ │ │ ├── SliderRecommendedStyle.cs │ │ │ ├── SliderRecommendedStyle.cs.meta │ │ │ ├── TagFieldRecommendedStyle.cs │ │ │ ├── TagFieldRecommendedStyle.cs.meta │ │ │ ├── TextFieldRecommendedStyle.cs │ │ │ ├── TextFieldRecommendedStyle.cs.meta │ │ │ ├── ToggleRecommendedStyle.cs │ │ │ ├── ToggleRecommendedStyle.cs.meta │ │ │ ├── Vector2FieldRecommendedStyle.cs │ │ │ ├── Vector2FieldRecommendedStyle.cs.meta │ │ │ ├── Vector3FieldRecommendedStyle.cs │ │ │ └── Vector3FieldRecommendedStyle.cs.meta │ │ ├── SerializableValues.meta │ │ ├── SerializableValues │ │ │ ├── ElementVariables.cs │ │ │ ├── ElementVariables.cs.meta │ │ │ ├── FieldVariable.cs │ │ │ ├── FieldVariable.cs.meta │ │ │ ├── IMainToolbarElementVariableRepository.cs │ │ │ ├── IMainToolbarElementVariableRepository.cs.meta │ │ │ ├── IMainToolbarElementVariableSerializer.cs │ │ │ ├── IMainToolbarElementVariableSerializer.cs.meta │ │ │ ├── IValueSerializer.cs │ │ │ ├── IValueSerializer.cs.meta │ │ │ ├── MainToolbarElementVariableWatcher.cs │ │ │ ├── MainToolbarElementVariableWatcher.cs.meta │ │ │ ├── PropertyVariable.cs │ │ │ ├── PropertyVariable.cs.meta │ │ │ ├── SerializableElement.cs │ │ │ ├── SerializableElement.cs.meta │ │ │ ├── SerializableElementGroup.cs │ │ │ ├── SerializableElementGroup.cs.meta │ │ │ ├── SerializableVariable.cs │ │ │ ├── SerializableVariable.cs.meta │ │ │ ├── SerializeAttribute.cs │ │ │ ├── SerializeAttribute.cs.meta │ │ │ ├── UnitySerializationMainToolbarElementVariableSerializer.cs │ │ │ ├── UnitySerializationMainToolbarElementVariableSerializer.cs.meta │ │ │ ├── UnitySerializationValueSerializer.cs │ │ │ ├── UnitySerializationValueSerializer.cs.meta │ │ │ ├── UserSettingsFileMainToolbarElementVariableRepository.cs │ │ │ ├── UserSettingsFileMainToolbarElementVariableRepository.cs.meta │ │ │ ├── ValueHolderType.cs │ │ │ ├── ValueHolderType.cs.meta │ │ │ ├── Variable.cs │ │ │ └── Variable.cs.meta │ │ ├── ToolbarAlign.cs │ │ └── ToolbarAlign.cs.meta │ ├── LICENSE │ ├── LICENSE.meta │ ├── README.md │ ├── README.md.meta │ ├── Readme-Resources~ │ │ ├── broken-element-example.jpg │ │ ├── common-arrangement-example.png │ │ ├── common-button-example.png │ │ ├── container-scrollable-demonstration.gif │ │ ├── control-alignment-example.png │ │ ├── custom-element-example.gif │ │ ├── group-demonstration.gif │ │ ├── main-toolbar-control-panel-demonstration.gif │ │ ├── other-common-controls.png │ │ ├── subgroup-demonstration.gif │ │ ├── subwindow-demonstration.gif │ │ └── warning.png │ ├── Samples~ │ │ └── BasicElements │ │ │ ├── Paps.UnityToolbarExtenderUIToolkit.Samples.asmdef │ │ │ ├── SampleButton.cs │ │ │ ├── SampleButtonToggle.cs │ │ │ ├── SampleButtonWithIcon.cs │ │ │ ├── SampleColorField.cs │ │ │ ├── SampleComplexElement.cs │ │ │ ├── SampleDropdownField.cs │ │ │ ├── SampleEnumField.cs │ │ │ ├── SampleEnumFlagsField.cs │ │ │ ├── SampleFloatField.cs │ │ │ ├── SampleIMGUIContainer.cs │ │ │ ├── SampleIntegerField.cs │ │ │ ├── SampleLayerField.cs │ │ │ ├── SampleObjectField.cs │ │ │ ├── SampleRootGroup.asset │ │ │ ├── SampleSlider.cs │ │ │ ├── SampleTagField.cs │ │ │ ├── SampleTextField.cs │ │ │ ├── SampleVector2Field.cs │ │ │ ├── SampleVector3Field.cs │ │ │ ├── Subgroups │ │ │ ├── ButtonSubgroup.asset │ │ │ ├── ButtonsInGroup.cs │ │ │ ├── DropdownFieldSubgroup.asset │ │ │ ├── DropdownFieldsInGroup.cs │ │ │ ├── DropdownInGroupWithPopupWindow.cs │ │ │ ├── DropdownInGroupWithWindow.cs │ │ │ ├── DropdownWithSubWindowSubgroup.asset │ │ │ ├── SampleGroupWithSubgroups.asset │ │ │ ├── SliderSubgroup.asset │ │ │ └── SlidersInGroup.cs │ │ │ ├── UnityTypeElementsGroup.asset │ │ │ └── WithSerialization │ │ │ ├── ElementsWithSerialization.asset │ │ │ ├── SamplePrefab │ │ │ └── SamplePrefab.prefab │ │ │ ├── SampleRigidbodyFieldWithSerialization.cs │ │ │ ├── SampleScriptableObject │ │ │ ├── SampleScriptableObject.asset │ │ │ └── SampleScriptableObject.cs │ │ │ ├── SampleScriptableObjectWithSerialization.cs │ │ │ └── SampleToggleWithSerialization.cs │ ├── package.json │ └── package.json.meta ├── ProjectTools.meta ├── ProjectTools │ ├── MenuItemsTools.cs │ └── MenuItemsTools.cs.meta ├── Samples.meta ├── Samples │ ├── BasicElements.meta │ └── BasicElements │ │ ├── Paps.UnityToolbarExtenderUIToolkit.Samples.asmdef │ │ ├── Paps.UnityToolbarExtenderUIToolkit.Samples.asmdef.meta │ │ ├── SampleButton.cs │ │ ├── SampleButton.cs.meta │ │ ├── SampleButtonToggle.cs │ │ ├── SampleButtonToggle.cs.meta │ │ ├── SampleButtonWithIcon.cs │ │ ├── SampleButtonWithIcon.cs.meta │ │ ├── SampleColorField.cs │ │ ├── SampleColorField.cs.meta │ │ ├── SampleComplexElement.cs │ │ ├── SampleComplexElement.cs.meta │ │ ├── SampleDropdownField.cs │ │ ├── SampleDropdownField.cs.meta │ │ ├── SampleEnumField.cs │ │ ├── SampleEnumField.cs.meta │ │ ├── SampleEnumFlagsField.cs │ │ ├── SampleEnumFlagsField.cs.meta │ │ ├── SampleFloatField.cs │ │ ├── SampleFloatField.cs.meta │ │ ├── SampleIMGUIContainer.cs │ │ ├── SampleIMGUIContainer.cs.meta │ │ ├── SampleIntegerField.cs │ │ ├── SampleIntegerField.cs.meta │ │ ├── SampleLayerField.cs │ │ ├── SampleLayerField.cs.meta │ │ ├── SampleObjectField.cs │ │ ├── SampleObjectField.cs.meta │ │ ├── SampleRootGroup.asset │ │ ├── SampleRootGroup.asset.meta │ │ ├── SampleSlider.cs │ │ ├── SampleSlider.cs.meta │ │ ├── SampleTagField.cs │ │ ├── SampleTagField.cs.meta │ │ ├── SampleTextField.cs │ │ ├── SampleTextField.cs.meta │ │ ├── SampleVector2Field.cs │ │ ├── SampleVector2Field.cs.meta │ │ ├── SampleVector3Field.cs │ │ ├── SampleVector3Field.cs.meta │ │ ├── Subgroups.meta │ │ ├── Subgroups │ │ ├── ButtonSubgroup.asset │ │ ├── ButtonSubgroup.asset.meta │ │ ├── ButtonsInGroup.cs │ │ ├── ButtonsInGroup.cs.meta │ │ ├── DropdownFieldSubgroup.asset │ │ ├── DropdownFieldSubgroup.asset.meta │ │ ├── DropdownFieldsInGroup.cs │ │ ├── DropdownFieldsInGroup.cs.meta │ │ ├── DropdownInGroupWithPopupWindow.cs │ │ ├── DropdownInGroupWithPopupWindow.cs.meta │ │ ├── DropdownInGroupWithWindow.cs │ │ ├── DropdownInGroupWithWindow.cs.meta │ │ ├── DropdownWithSubWindowSubgroup.asset │ │ ├── DropdownWithSubWindowSubgroup.asset.meta │ │ ├── SampleGroupWithSubgroups.asset │ │ ├── SampleGroupWithSubgroups.asset.meta │ │ ├── SliderSubgroup.asset │ │ ├── SliderSubgroup.asset.meta │ │ ├── SlidersInGroup.cs │ │ └── SlidersInGroup.cs.meta │ │ ├── UnityTypeElementsGroup.asset │ │ ├── UnityTypeElementsGroup.asset.meta │ │ ├── WithSerialization.meta │ │ └── WithSerialization │ │ ├── ElementsWithSerialization.asset │ │ ├── ElementsWithSerialization.asset.meta │ │ ├── SamplePrefab.meta │ │ ├── SamplePrefab │ │ ├── SamplePrefab.prefab │ │ └── SamplePrefab.prefab.meta │ │ ├── SampleRigidbodyFieldWithSerialization.cs │ │ ├── SampleRigidbodyFieldWithSerialization.cs.meta │ │ ├── SampleScriptableObject.meta │ │ ├── SampleScriptableObject │ │ ├── SampleScriptableObject.asset │ │ ├── SampleScriptableObject.asset.meta │ │ ├── SampleScriptableObject.cs │ │ └── SampleScriptableObject.cs.meta │ │ ├── SampleScriptableObjectWithSerialization.cs │ │ ├── SampleScriptableObjectWithSerialization.cs.meta │ │ ├── SampleToggleWithSerialization.cs │ │ └── SampleToggleWithSerialization.cs.meta ├── Scenes.meta └── Scenes │ ├── SampleScene.unity │ └── SampleScene.unity.meta ├── Packages ├── manifest.json └── packages-lock.json ├── ProjectSettings ├── AudioManager.asset ├── ClusterInputManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── MemorySettings.asset ├── NavMeshAreas.asset ├── NetworkManager.asset ├── PackageManagerSettings.asset ├── Physics2DSettings.asset ├── PresetManager.asset ├── ProjectSettings.asset ├── ProjectVersion.txt ├── QualitySettings.asset ├── TagManager.asset ├── TimeManager.asset ├── UnityConnectSettings.asset ├── VFXManager.asset ├── VersionControlSettings.asset └── XRSettings.asset └── README.md /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # Each line is a file pattern followed by one or more owners. 2 | 3 | # These owners will be the default owners for everything in the repo. Unless a later match takes precedence. 4 | # Owners will be requested for review when someone opens a pull request. 5 | * @paps/Games 6 | -------------------------------------------------------------------------------- /.github/workflows/acquire-activation-file.yml: -------------------------------------------------------------------------------- 1 | name: Acquire activation file 2 | 3 | # This project uses unity-ci project (unity-ci.com) to help getting activation file and run tests automatically on push. 4 | # unity-ci project has great documentation on what activation file is and how to use it in https://unity-ci.com/docs/github/activation 5 | 6 | # Controls when the action will run. Workflow runs when manually triggered using the UI or API. 7 | on: 8 | workflow_dispatch: 9 | inputs: 10 | unity-version: 11 | description: 'Unity version' 12 | default: 2019.4.1f1 13 | required: true 14 | 15 | jobs: 16 | activation: 17 | name: Request manual activation file 🔑 18 | runs-on: ubuntu-latest 19 | steps: 20 | - name: Request manual activation 21 | id: getManualLicenseFile 22 | uses: webbertakken/unity-request-manual-activation-file@v1.1 23 | with: 24 | unityVersion: ${{ github.event.inputs.unity-version }} 25 | - name: Expose as artifact # Upload artifact (Unity_v20XX.X.XXXX.alf) 26 | uses: actions/upload-artifact@v1 27 | with: 28 | name: ${{ steps.getManualLicenseFile.outputs.filePath }} 29 | path: ${{ steps.getManualLicenseFile.outputs.filePath }} 30 | -------------------------------------------------------------------------------- /.github/workflows/on-release.yml: -------------------------------------------------------------------------------- 1 | name: Publish to npm 2 | 3 | # Publishes npm package to npmjs registry automatically when creating new release. 4 | # NOTE: You need create a new github repository secret NPM_TOKEN for this to work. 5 | # For further details on how to add secrets, please see github docs https://docs.github.com/en/free-pro-team@latest/actions/reference/encrypted-secrets#creating-encrypted-secrets-for-a-repository 6 | 7 | on: 8 | release: 9 | types: [published] 10 | 11 | jobs: 12 | build: 13 | runs-on: ubuntu-latest 14 | steps: 15 | - uses: actions/checkout@v2 16 | - uses: actions/setup-node@v1 17 | with: 18 | node-version: 12 19 | registry-url: https://registry.npmjs.org/ 20 | - name: Publish 21 | run: npm publish --access public 22 | env: 23 | NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} 24 | -------------------------------------------------------------------------------- /.github/workflows/tests.yml: -------------------------------------------------------------------------------- 1 | name: Tests 2 | 3 | # This project uses unity-ci project (unity-ci.com) to help getting activation file and run tests automatically on push. 4 | # unity-ci project has great documentation on how to create workflow to run tests https://unity-ci.com/docs/github/test-runner 5 | 6 | # NOTE: You need create a new github repository secret UNITY_LICENSE for this to work. 7 | # For further details on how to add secrets, please see github docs https://docs.github.com/en/free-pro-team@latest/actions/reference/encrypted-secrets#creating-encrypted-secrets-for-a-repository 8 | 9 | on: 10 | # Currently tests can only be ran against main branch because of how 11 | # Test project is set up. See Samples\ExampleUnityProject\Packages\manifest.json 12 | # Package is always cloned from the main branch for tests 13 | push: 14 | branches: 15 | - main 16 | 17 | env: 18 | UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} 19 | 20 | jobs: 21 | Tests: 22 | name: Run in ${{ matrix.testMode }} on v. ${{ matrix.unityVersion }} 23 | runs-on: ubuntu-latest 24 | strategy: 25 | fail-fast: false 26 | matrix: 27 | projectPath: [ Samples/ExampleUnityProject ] 28 | unityVersion: [ 2019.4.1f1 ] 29 | testMode: [ playmode ] # editmode 30 | steps: 31 | - uses: actions/checkout@v2 32 | with: 33 | lfs: true 34 | - uses: actions/cache@v1.1.0 35 | with: 36 | path: ${{ matrix.projectPath }}/Library 37 | key: Library-${{ matrix.projectPath }} 38 | restore-keys: | 39 | Library- 40 | - uses: webbertakken/unity-test-runner@v1.6 41 | name: Run tests 42 | id: tests 43 | with: 44 | projectPath: ${{ matrix.projectPath }} 45 | unityVersion: ${{ matrix.unityVersion }} 46 | testMode: ${{ matrix.testMode }} 47 | artifactsPath: ${{ matrix.testMode }}-artifacts 48 | - uses: actions/upload-artifact@v1 49 | name: Upload test results 50 | with: 51 | name: Test results for ${{ matrix.testMode }} 52 | path: ${{ steps.tests.outputs.artifactsPath }} 53 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | [Ll]ibrary/ 2 | [Tt]emp/[Oo]bj/ 3 | [Bb]uild/ 4 | [Bb]uilds/ 5 | [Aa]ssetBundles/ 6 | [Oo]bj/ 7 | [Tt]emp/ 8 | [Ll]ogs/ 9 | [Uu]ser[Ss]ettings/ 10 | Assets/AssetStoreTools* 11 | .idea/ 12 | 13 | # Visual Studio 2015 cache directory 14 | .vs/ 15 | .vscode/ 16 | 17 | 18 | # Autogenerated VS/MD/Consulo solution and project files 19 | ExportedObj/ 20 | .consulo/ 21 | *.csproj 22 | *.unityproj 23 | *.sln 24 | *.suo 25 | *.tmp 26 | *.user 27 | *.userprefs 28 | *.pidb 29 | *.booproj 30 | *.svd 31 | *.pdb 32 | *.tgz 33 | 34 | # Unity3D generated meta files 35 | *.pidb.meta 36 | 37 | # Unity3D Generated File On Crash Reports 38 | sysinfo.txt 39 | 40 | # Builds 41 | *.apk 42 | *.unitypackage 43 | 44 | 45 | 46 | 47 | 48 | # Modificación por CiarlantiniD - Windows y MacOS System Files 49 | 50 | 51 | # General 52 | .DS_Store 53 | .AppleDouble 54 | .LSOverride 55 | # Icon must end with two \r 56 | Icon 57 | 58 | # Thumbnails 59 | ._* 60 | # Files that might appear in the root of a volume 61 | .DocumentRevisions-V100 62 | .fseventsd 63 | .Spotlight-V100 64 | .TemporaryItems 65 | .Trashes 66 | .VolumeIcon.icns 67 | .com.apple.timemachine.donotpresent 68 | # Directories potentially created on remote AFP share 69 | .AppleDB 70 | .AppleDesktop 71 | Network Trash Folder 72 | Temporary Items 73 | .apdisk 74 | 75 | 76 | # Windows thumbnail cache files 77 | Thumbs.db 78 | ehthumbs.db 79 | ehthumbs_vista.db 80 | 81 | # Dump file 82 | *.stackdump 83 | 84 | # Folder config file 85 | [Dd]esktop.ini 86 | 87 | # Recycle Bin used on file shares 88 | $RECYCLE.BIN/ 89 | 90 | # Windows Installer files 91 | *.cab 92 | *.msi 93 | *.msix 94 | *.msm 95 | *.msp 96 | 97 | # Windows shortcuts 98 | *.lnk 99 | -------------------------------------------------------------------------------- /.vsconfig: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0", 3 | "components": [ 4 | "Microsoft.VisualStudio.Workload.ManagedGame" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /Assets/Package.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 20a851b83090f3849876ed3b98cde1e4 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Package/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## [2.0.0] 4 | 5 | ### Added 6 | 7 | - Main toolbar elements field and property serialization, using SerializeAttribute and calling InitializeElement method if it exists 8 | - Recommended styles for: Vector2Field, Vector3Field, ColorField, LayerField, EnumField, EnumFlagsField, TagField and ObjectField 9 | - Ids for native elements on Unity 6 10 | - ObjectSelector, SearchPickerWindow and EditorGenericDropdownMenuWindowContent won't make group popup close 11 | - Support for Mac (mostly) 12 | 13 | ### Changed 14 | 15 | - **Breaking:** Overrides and some stats saved by control panel window are now saved under UserSettings folder 16 | - **Breaking:** Set AutoReferenced to false on assembly definition 17 | - **Breaking:** Added new dependency Unity serialization (while being AutoReferenced) 18 | 19 | ### Removed 20 | 21 | - Newtonsoft Json.Net dependency 22 | - Delete actions. Just remove UserSettings/unity-toolbar-extender-ui-toolkit/ files to remove the thing you want 23 | 24 | ## [1.0.1] 25 | 26 | ### Fixed 27 | 28 | - Recommended styles throwing exceptions when some of them have no label element created 29 | 30 | ## [1.0.0] 31 | 32 | ### Added 33 | 34 | - Source Code -------------------------------------------------------------------------------- /Assets/Package/CHANGELOG.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 97db1ece2d5efe84995ce8abcc497e10 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Package/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 06be9243e19d1094b9027a8c203a3d70 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Package/Editor/ByAttributeMainToolbarElementRepository.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Reflection; 4 | using UnityEditor; 5 | using UnityEngine.UIElements; 6 | 7 | namespace Paps.UnityToolbarExtenderUIToolkit 8 | { 9 | internal class ByAttributeMainToolbarElementRepository : IMainToolbarElementRepository 10 | { 11 | public MainToolbarElement[] GetAll() 12 | { 13 | return TypeCache.GetTypesWithAttribute() 14 | .Where(type => IsValidVisualElementType(type)) 15 | .Select(type => GetMainToolbarElementFromType(type)) 16 | .ToArray(); 17 | } 18 | 19 | private MainToolbarElement GetMainToolbarElementFromType(Type type) 20 | { 21 | var elementInstance = (VisualElement)Activator.CreateInstance(type); 22 | var attribute = type.GetCustomAttribute(); 23 | 24 | if (string.IsNullOrEmpty(elementInstance.name)) 25 | elementInstance.name = elementInstance.GetType().Name; 26 | 27 | return new MainToolbarElement(attribute.Id, elementInstance, attribute.Alignment, 28 | attribute.Order, attribute.UseRecommendedStyles); 29 | } 30 | 31 | private bool IsValidVisualElementType(Type type) 32 | { 33 | var visualElementType = typeof(VisualElement); 34 | 35 | return visualElementType != type && 36 | visualElementType.IsAssignableFrom(type) && 37 | !type.IsAbstract; 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /Assets/Package/Editor/ByAttributeMainToolbarElementRepository.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9e664729ffc0507499365cb1b3393b91 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/ControlPanelWindow.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e5d6770a557fcef47bfab9c1562f972c 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Package/Editor/ControlPanelWindow/MainToolbarControlPanelWindow.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fef14479cdf8f5a41bb3b7f4b442484e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/ControlPanelWindow/MainToolbarElementController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ae80166256b03484a9bfc1ad9c4cc0dc 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/ControlPanelWindow/OrganizationalFoldableContainer.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using UnityEngine; 3 | using UnityEngine.UIElements; 4 | 5 | namespace Paps.UnityToolbarExtenderUIToolkit 6 | { 7 | internal class OrganizationalFoldableContainer : Box 8 | { 9 | private static readonly Color ORGANIZATIONAL_FOLDABLE_CONTAINER_BORDER_COLOR = new Color(153f / 255f, 153f / 255f, 153f / 255f); 10 | private const string FOLDOUT_STATE_SAVE_KEY_BASE = "organizational-foldable-container:foldout-state:"; 11 | 12 | private Foldout _foldout; 13 | private string _id; 14 | 15 | public OrganizationalFoldableContainer(string containerId, string foldoutText) 16 | { 17 | _id = containerId; 18 | name = containerId; 19 | style.borderTopColor = ORGANIZATIONAL_FOLDABLE_CONTAINER_BORDER_COLOR; 20 | style.borderTopWidth = 1; 21 | 22 | _foldout = new Foldout() { text = foldoutText }; 23 | _foldout.value = GetSavedFoldoutState(); 24 | _foldout.RegisterCallback>(SaveFoldoutState); 25 | 26 | Add(_foldout); 27 | } 28 | 29 | private string GetFullFoldoutStateSaveKey() => FOLDOUT_STATE_SAVE_KEY_BASE + _id; 30 | 31 | private void SaveFoldoutState(ChangeEvent eventArgs) 32 | { 33 | UserSettingsPrefs.SetBool(GetFullFoldoutStateSaveKey(), eventArgs.newValue); 34 | } 35 | 36 | private bool GetSavedFoldoutState() 37 | { 38 | return UserSettingsPrefs.GetBool(GetFullFoldoutStateSaveKey(), false); 39 | } 40 | 41 | public void SetControllers(IEnumerable controllers) 42 | { 43 | _foldout.Clear(); 44 | 45 | foreach (var controller in controllers) 46 | { 47 | _foldout.Add(controller); 48 | } 49 | } 50 | } 51 | } -------------------------------------------------------------------------------- /Assets/Package/Editor/ControlPanelWindow/OrganizationalFoldableContainer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9ac00cb9059df7e43b1c2ed433ce61cc 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/ControlPanelWindow/OverridableElement.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine.UIElements; 2 | 3 | namespace Paps.UnityToolbarExtenderUIToolkit 4 | { 5 | internal readonly struct OverridableElement 6 | { 7 | public string Id { get; } 8 | public VisualElement VisualElement { get; } 9 | public bool IsNative { get; } 10 | 11 | public OverridableElement(string id, VisualElement visualElement, bool isNative) 12 | { 13 | Id = id; 14 | VisualElement = visualElement; 15 | IsNative = isNative; 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /Assets/Package/Editor/ControlPanelWindow/OverridableElement.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 542f1fb68120090489ba1613162eb17b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/Extensions.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f0a074f24b9c98d488341e6258c0c0b0 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Package/Editor/Extensions/EditorWindowExtensions.cs: -------------------------------------------------------------------------------- 1 | using UnityEditor; 2 | using UnityEngine; 3 | 4 | namespace Paps.UnityToolbarExtenderUIToolkit 5 | { 6 | public static class EditorWindowExtensions 7 | { 8 | public static void ShowAsDropdownForMainToolbar(this EditorWindow window, Rect activatorRect, Vector2 size) 9 | { 10 | window.ShowAsDropDown(activatorRect, size); 11 | 12 | var rect = GUIUtility.GUIToScreenRect(activatorRect); 13 | rect.y += activatorRect.size.y; 14 | window.position = new Rect(rect.position, window.position.size); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Assets/Package/Editor/Extensions/EditorWindowExtensions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3333a000c60ebce4aa038ee0945d0072 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/GroupDefinitions.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1a83afb20ef0f5f40b22a93ff124fe1f 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Package/Editor/GroupDefinitions/GroupDefinition.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | 3 | namespace Paps.UnityToolbarExtenderUIToolkit 4 | { 5 | internal readonly struct GroupDefinition 6 | { 7 | public string GroupId { get; } 8 | public string GroupName { get; } 9 | public ToolbarAlign Alignment { get; } 10 | public int Order { get; } 11 | public string[] ToolbarElementsIds { get; } 12 | 13 | public GroupDefinition(string groupId, string groupName, ToolbarAlign alignment, int order, string[] toolbarElementsIds) 14 | { 15 | GroupId = groupId; 16 | GroupName = string.IsNullOrEmpty(groupName) ? groupId : groupName; 17 | Alignment = alignment; 18 | Order = order; 19 | ToolbarElementsIds = toolbarElementsIds; 20 | } 21 | 22 | public bool AreEquals(GroupDefinition other) 23 | { 24 | return GroupId == other.GroupId && 25 | GroupName == other.GroupName && 26 | Alignment == other.Alignment && 27 | Order == other.Order && 28 | AreEquals(ToolbarElementsIds, other.ToolbarElementsIds); 29 | } 30 | 31 | private bool AreEquals(string[] types, string[] types2) 32 | { 33 | if(types.Length != types2.Length) 34 | return false; 35 | 36 | return types.All(typeName => types2.Contains(typeName)); 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /Assets/Package/Editor/GroupDefinitions/GroupDefinition.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8e3f2e82a96ef3246860b2861fa19b15 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/GroupDefinitions/GroupDropdownWindowPopup.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8509c9dbf1627b74c9e521402a3de28b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/GroupDefinitions/GroupDropdownWindowPopupManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 88333c3cc209cb143bc93891e1664b41 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/GroupDefinitions/GroupElement.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using UnityEditor.Toolbars; 3 | using UnityEngine.UIElements; 4 | 5 | namespace Paps.UnityToolbarExtenderUIToolkit 6 | { 7 | internal class GroupElement : EditorToolbarDropdown 8 | { 9 | private VisualElement[] _groupedElements; 10 | public VisualElement[] GroupedElements => _groupedElements.ToArray(); 11 | 12 | public GroupElement(string name) 13 | { 14 | this.name = name; 15 | text = name; 16 | clicked += ShowDropdown; 17 | } 18 | 19 | public void Initialize(VisualElement[] groupedElements) 20 | { 21 | _groupedElements = groupedElements; 22 | } 23 | 24 | private void ShowDropdown() 25 | { 26 | GroupDropdownWindowPopupManager.Show(worldBound, _groupedElements); 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /Assets/Package/Editor/GroupDefinitions/GroupElement.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c782e5c3d1d2bd7499b358c6aa5703cd 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/GroupDefinitions/GroupPopupSubWindowAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Paps.UnityToolbarExtenderUIToolkit 4 | { 5 | [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)] 6 | public class GroupPopupSubWindowAttribute : Attribute 7 | { 8 | 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Assets/Package/Editor/GroupDefinitions/GroupPopupSubWindowAttribute.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f6e542ea23caed94c92fab5ac0d0f1c8 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/GroupDefinitions/IGroupDefinitionRepository.cs: -------------------------------------------------------------------------------- 1 | namespace Paps.UnityToolbarExtenderUIToolkit 2 | { 3 | internal interface IGroupDefinitionRepository 4 | { 5 | public GroupDefinition[] GetAll(); 6 | } 7 | } -------------------------------------------------------------------------------- /Assets/Package/Editor/GroupDefinitions/IGroupDefinitionRepository.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 15164a1a1815ea04c9ae72e65e0a9fe9 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/GroupDefinitions/MainToolbarElementDropdownAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace Paps.UnityToolbarExtenderUIToolkit 5 | { 6 | [AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = false)] 7 | internal class MainToolbarElementDropdownAttribute : PropertyAttribute 8 | { 9 | 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/GroupDefinitions/MainToolbarElementDropdownAttribute.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ffb57bb326f1c1247b6e1341c5caecf3 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/GroupDefinitions/MainToolbarElementDropdownDrawer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cb51db686d5e79d4295bc1a510395e2c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/GroupDefinitions/ScriptableGroupDefinition.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace Paps.UnityToolbarExtenderUIToolkit 4 | { 5 | [CreateAssetMenu(menuName = ToolInfo.EDITOR_MENU_BASE + "/Group Definition")] 6 | public sealed class ScriptableGroupDefinition : ScriptableObject 7 | { 8 | [SerializeField] 9 | [Tooltip("Id of group. It must be unique")] 10 | private string _groupId; 11 | [SerializeField] 12 | [Tooltip("Text to display in group element dropdown")] 13 | private string _groupName; 14 | [SerializeField] 15 | [Tooltip("Alignment when used as root element. Ignored inside other groups")] 16 | private ToolbarAlign _alignment; 17 | [Tooltip("Order when used as root element. Ignored inside other groups. Order of elements inside a group is determined by ToolbarElementsIds array elements order.")] 18 | [SerializeField] private int _order; 19 | [SerializeField] 20 | [Tooltip("Elements ids of this group. Order of elements in array determines the order in which the elements will be displayed")] 21 | [MainToolbarElementDropdown] private string[] _toolbarElementsIds; 22 | 23 | public string GroupId => _groupId; 24 | public string GroupName => _groupName; 25 | public ToolbarAlign Alignment => _alignment; 26 | public int Order => _order; 27 | public string[] ToolbarElementsIds => _toolbarElementsIds == null ? new string[0] : _toolbarElementsIds; 28 | 29 | private void OnValidate() 30 | { 31 | SetEqualValuesToEmptyInOrder(); 32 | } 33 | 34 | private void SetEqualValuesToEmptyInOrder() 35 | { 36 | for (int i = 0; i < _toolbarElementsIds.Length; i++) 37 | { 38 | var value = _toolbarElementsIds[i]; 39 | for (int j = 0; j < _toolbarElementsIds.Length; j++) 40 | { 41 | if (i == j) 42 | continue; 43 | 44 | if (_toolbarElementsIds[j] == value) 45 | { 46 | _toolbarElementsIds[j] = ""; 47 | } 48 | } 49 | } 50 | } 51 | } 52 | } -------------------------------------------------------------------------------- /Assets/Package/Editor/GroupDefinitions/ScriptableGroupDefinition.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6df7c06c2de586e41bb0c33bfd80766f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/GroupDefinitions/ScriptableGroupDefinitionHelper.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using UnityEditor; 4 | 5 | namespace Paps.UnityToolbarExtenderUIToolkit 6 | { 7 | internal static class ScriptableGroupDefinitionHelper 8 | { 9 | private static ScriptableGroupDefinition[] _projectGroupDefinitions; 10 | 11 | static ScriptableGroupDefinitionHelper() 12 | { 13 | LoadProjectGroupDefinitions(); 14 | 15 | EditorApplication.projectChanged += OnProjectChange; 16 | } 17 | 18 | public static void Refresh() 19 | { 20 | LoadProjectGroupDefinitions(); 21 | } 22 | 23 | private static void LoadProjectGroupDefinitions() 24 | { 25 | var paths = AssetDatabase.FindAssets("t:" + nameof(ScriptableGroupDefinition)) 26 | .Select(guid => AssetDatabase.GUIDToAssetPath(guid)); 27 | 28 | _projectGroupDefinitions = paths 29 | .Select(path => AssetDatabase.LoadAssetAtPath(path)) 30 | .ToArray(); 31 | } 32 | 33 | public static IEnumerable GetUnusedMainToolbarElementIds(IEnumerable allIds) 34 | { 35 | return allIds.Except(GetUsedMainToolbarElementIds()); 36 | } 37 | 38 | private static IEnumerable GetUsedMainToolbarElementIds() 39 | { 40 | return _projectGroupDefinitions 41 | .SelectMany(groupDefinition => groupDefinition.ToolbarElementsIds); 42 | } 43 | 44 | public static IEnumerable GetGroupIds() 45 | { 46 | return _projectGroupDefinitions.Select(g => g.GroupId); 47 | } 48 | 49 | public static IEnumerable GetEligibleGroupChildsFor(string groupId) 50 | { 51 | var allUsedIds = _projectGroupDefinitions.SelectMany(g => g.ToolbarElementsIds); 52 | 53 | return _projectGroupDefinitions.Select(g => g.GroupId) 54 | .Where(id => !allUsedIds.Contains(id)) 55 | .Where(id => id != groupId); 56 | } 57 | 58 | private static void OnProjectChange() 59 | { 60 | Refresh(); 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Assets/Package/Editor/GroupDefinitions/ScriptableGroupDefinitionHelper.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 12a0d38180307184e87497e8fbb28985 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/GroupDefinitions/ScriptableObjectGroupDefinitionRepository.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using UnityEditor; 3 | 4 | namespace Paps.UnityToolbarExtenderUIToolkit 5 | { 6 | internal class ScriptableObjectGroupDefinitionRepository : IGroupDefinitionRepository 7 | { 8 | public GroupDefinition[] GetAll() 9 | { 10 | var paths = AssetDatabase.FindAssets("t:" + nameof(ScriptableGroupDefinition)) 11 | .Select(guid => AssetDatabase.GUIDToAssetPath(guid)); 12 | 13 | return paths 14 | .Select(path => AssetDatabase.LoadAssetAtPath(path)) 15 | .Where(scriptableGroupDefinition => !string.IsNullOrEmpty(scriptableGroupDefinition.GroupId)) 16 | .GroupBy(scriptableGroupDefinition => scriptableGroupDefinition.GroupId) 17 | .Select(scriptableGroupDefinition => scriptableGroupDefinition.First()) 18 | .Select(scriptableGroupDefinition => new GroupDefinition( 19 | scriptableGroupDefinition.GroupId, 20 | scriptableGroupDefinition.GroupName, 21 | scriptableGroupDefinition.Alignment, 22 | scriptableGroupDefinition.Order, 23 | FilterIds(scriptableGroupDefinition) 24 | ) 25 | ) 26 | .Where(m => m.ToolbarElementsIds.Length > 0) 27 | .ToArray(); 28 | } 29 | 30 | private string[] FilterIds(ScriptableGroupDefinition scriptableGroupDefinition) 31 | { 32 | return scriptableGroupDefinition.ToolbarElementsIds 33 | .Where(id => !string.IsNullOrEmpty(id)) 34 | .Distinct() 35 | .ToArray(); 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /Assets/Package/Editor/GroupDefinitions/ScriptableObjectGroupDefinitionRepository.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 225393fc4d1ad744c972f3a876dce3df 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/Helpers.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: efeeca875749f6d46905cc399ed76bae 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Package/Editor/Helpers/GlobalActions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEditor; 3 | 4 | namespace Paps.UnityToolbarExtenderUIToolkit 5 | { 6 | internal static class GlobalActions 7 | { 8 | public static void ResetOverrides() 9 | { 10 | ServicesAndRepositories.MainToolbarElementOverridesRepository.Clear(); 11 | MainToolbarAutomaticExtender.Refresh(); 12 | } 13 | 14 | public static void ResetOverridesIfUserAccepts() 15 | { 16 | ShowDialog( 17 | "Reset Overrides", 18 | "You are about to reset all toolbar elements overrides.\nAre you sure you want to continue?", 19 | "Reset", 20 | "Cancel", 21 | ResetOverrides 22 | ); 23 | } 24 | 25 | public static void ShowDialog(string title, string message, string okMessage, 26 | string cancelMessage, Action onOk = null, Action onCancel = null) 27 | { 28 | if (EditorUtility.DisplayDialog(title, message, okMessage, cancelMessage)) 29 | onOk?.Invoke(); 30 | else 31 | onCancel?.Invoke(); 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /Assets/Package/Editor/Helpers/GlobalActions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bfe995773a109214db8292f8ce74d342 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/Helpers/Icons.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEditor; 3 | using UnityEngine; 4 | 5 | namespace Paps.UnityToolbarExtenderUIToolkit 6 | { 7 | internal static class Icons 8 | { 9 | private static readonly Lazy VISIBILITY_ON_OVERRIDE_ICON_LAZY = 10 | new Lazy(() => EditorGUIUtility.IconContent("animationvisibilitytoggleon").image); 11 | 12 | private static readonly Lazy VISIBILITY_OFF_OVERRIDE_ICON_LAZY = 13 | new Lazy(() => EditorGUIUtility.IconContent("animationvisibilitytoggleoff").image); 14 | 15 | public static Texture VisibilityOnOverrideIcon => VISIBILITY_ON_OVERRIDE_ICON_LAZY.Value; 16 | public static Texture VisibilityOffOverrideIcon => VISIBILITY_OFF_OVERRIDE_ICON_LAZY.Value; 17 | } 18 | } -------------------------------------------------------------------------------- /Assets/Package/Editor/Helpers/Icons.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 51ede7e0c6a32a74faa6298082ed29cc 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/Helpers/MenuItems.cs: -------------------------------------------------------------------------------- 1 | using UnityEditor; 2 | 3 | namespace Paps.UnityToolbarExtenderUIToolkit 4 | { 5 | internal static class MenuItems 6 | { 7 | [MenuItem(ToolInfo.EDITOR_MENU_BASE + "/Refresh Toolbar Extender", priority = 1)] 8 | public static void Refresh() 9 | { 10 | MainToolbarAutomaticExtender.Refresh(); 11 | } 12 | 13 | [MenuItem(ToolInfo.EDITOR_MENU_BASE + "/Windows/Main Toolbar Control Panel", priority = 12)] 14 | public static void OpenControlPanel() 15 | { 16 | MainToolbarControlPanelWindow.OpenWindow(); 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /Assets/Package/Editor/Helpers/MenuItems.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a74255adbb601344cb6b565d617de6f1 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/Helpers/RefreshToolbarAutomaticExtenderOnSave.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using UnityEditor; 4 | 5 | namespace Paps.UnityToolbarExtenderUIToolkit 6 | { 7 | internal class RefreshToolbarAutomaticExtenderOnSave : AssetModificationProcessor 8 | { 9 | private static string[] OnWillSaveAssets(string[] paths) 10 | { 11 | var groupDefinitionsAssetsPaths = AssetDatabase.FindAssets("t:" + nameof(ScriptableGroupDefinition)) 12 | .Select(guid => AssetDatabase.GUIDToAssetPath(guid)) 13 | .ToArray(); 14 | 15 | if (GroupDefinitionAssetIsBeingSaved(paths, groupDefinitionsAssetsPaths)) 16 | { 17 | EditorApplication.update += RefreshOneTime; 18 | } 19 | 20 | return paths; 21 | } 22 | 23 | private static bool GroupDefinitionAssetIsBeingSaved(string[] savingAssetsPaths, string[] groupDefinitionsAssetsPaths) 24 | { 25 | return savingAssetsPaths.Any(path => groupDefinitionsAssetsPaths.Contains(path)); 26 | } 27 | 28 | private static void RefreshOneTime() 29 | { 30 | EditorApplication.update -= RefreshOneTime; 31 | Refresh(); 32 | } 33 | 34 | private static void Refresh() 35 | { 36 | MainToolbarAutomaticExtender.Refresh(); 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /Assets/Package/Editor/Helpers/RefreshToolbarAutomaticExtenderOnSave.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e74405729947e434fb3760be36ad262e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/Helpers/ServicesAndRepositories.cs: -------------------------------------------------------------------------------- 1 | namespace Paps.UnityToolbarExtenderUIToolkit 2 | { 3 | internal static class ServicesAndRepositories 4 | { 5 | public static IMainToolbarElementOverrideRepository MainToolbarElementOverridesRepository = 6 | new UserSettingsFileMainToolbarElementOverrideRepository(); 7 | 8 | public static IGroupDefinitionRepository GroupDefinitionRepository = 9 | new ScriptableObjectGroupDefinitionRepository(); 10 | 11 | public static IMainToolbarElementRepository MainToolbarElementRepository = 12 | new ByAttributeMainToolbarElementRepository(); 13 | 14 | public static IValueSerializer ValueSerializer = 15 | new UnitySerializationValueSerializer(); 16 | 17 | public static IMainToolbarElementVariableSerializer MainToolbarElementVariableSerializer = 18 | new UnitySerializationMainToolbarElementVariableSerializer(ValueSerializer); 19 | 20 | public static IMainToolbarElementVariableRepository MainToolbarElementVariableRepository = 21 | new UserSettingsFileMainToolbarElementVariableRepository(MainToolbarElementVariableSerializer); 22 | } 23 | } -------------------------------------------------------------------------------- /Assets/Package/Editor/Helpers/ServicesAndRepositories.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4f95a2c4cbecd4f419ae142074dbb03f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/Helpers/ToolInfo.cs: -------------------------------------------------------------------------------- 1 | namespace Paps.UnityToolbarExtenderUIToolkit 2 | { 3 | internal static class ToolInfo 4 | { 5 | public const string COMPANY_NAME = "Paps"; 6 | public const string FRIENDLY_TOOL_NAME = "Unity Toolbar Extender UI Toolkit"; 7 | public const string EDITOR_MENU_BASE = COMPANY_NAME + "/" + FRIENDLY_TOOL_NAME; 8 | } 9 | } -------------------------------------------------------------------------------- /Assets/Package/Editor/Helpers/ToolInfo.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c363bf3b832d93c45b14669aa6ae573c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/Helpers/UnityNativeElementsIds.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 62370caf7a9d1274ba18d9556d83fd07 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/Helpers/UserSettingsPrefs.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fad7572312c85da4e80e115c63b2d164 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/IMainToolbarElementRepository.cs: -------------------------------------------------------------------------------- 1 | namespace Paps.UnityToolbarExtenderUIToolkit 2 | { 3 | internal interface IMainToolbarElementRepository 4 | { 5 | public MainToolbarElement[] GetAll(); 6 | } 7 | } -------------------------------------------------------------------------------- /Assets/Package/Editor/IMainToolbarElementRepository.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b6fdece3308162d4994b872bcb838c72 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/MainToolbar.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ce77a44ce866ce34d9ce10f93b19c256 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/MainToolbarAutomaticExtender.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6fd1abb4edafb6a4793209e0f154d8a8 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/MainToolbarCustomContainer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3a0122c91e132b8478c5d18c85d0df6f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/MainToolbarElement.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine.UIElements; 2 | 3 | namespace Paps.UnityToolbarExtenderUIToolkit 4 | { 5 | internal class MainToolbarElement 6 | { 7 | public string Id { get; } 8 | public VisualElement VisualElement { get; } 9 | public ToolbarAlign Alignment { get; } 10 | public int Order { get; } 11 | public bool UseRecommendedStyles { get; } 12 | 13 | public MainToolbarElement(string id, VisualElement visualElement, 14 | ToolbarAlign alignment, int order, bool useRecommendedStyles) 15 | { 16 | Id = id; 17 | VisualElement = visualElement; 18 | Alignment = alignment; 19 | Order = order; 20 | UseRecommendedStyles = useRecommendedStyles; 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /Assets/Package/Editor/MainToolbarElement.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f67ca04efaf7f044fa5a17a7627aca0b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/MainToolbarElementAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Paps.UnityToolbarExtenderUIToolkit 4 | { 5 | [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)] 6 | public class MainToolbarElementAttribute : Attribute 7 | { 8 | public string Id { get; } 9 | public ToolbarAlign Alignment { get; } 10 | public int Order { get; } 11 | public bool UseRecommendedStyles { get; } 12 | 13 | /// 14 | /// Mark a class derived from VisualElement to be found by toolbar extender 15 | /// 16 | /// Id of element. Must be unique. In case of collision, first found is used 17 | /// Left or right to play buttons. Ignored if inside a group 18 | /// Order in which this element will be displayed in toolbar. Ignored if inside a group 19 | /// True if this element should use recommended styles. Set it to false if you want to style the visual element yourself. 20 | /// 21 | public MainToolbarElementAttribute(string id, ToolbarAlign alignment = ToolbarAlign.Left, 22 | int order = 0, 23 | bool useRecommendedStyles = true) 24 | { 25 | Id = id; 26 | Alignment = alignment; 27 | Order = order; 28 | UseRecommendedStyles = useRecommendedStyles; 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /Assets/Package/Editor/MainToolbarElementAttribute.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d4059a4ac36791549810df04f72dcc75 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/MainToolbarElementOverrideApplier.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 24d310911f14d4d45a02bd5586c371bb 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/NativeToolbarElement.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine.UIElements; 2 | 3 | namespace Paps.UnityToolbarExtenderUIToolkit 4 | { 5 | internal class NativeToolbarElement 6 | { 7 | public string Id { get; } 8 | public VisualElement VisualElement { get; } 9 | 10 | public NativeToolbarElement(string id, VisualElement visualElement) 11 | { 12 | Id = id; 13 | VisualElement = visualElement; 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /Assets/Package/Editor/NativeToolbarElement.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4b9dec15dbb8eea42b0c2254ce4b7177 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/Override.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6f722a3e209ed5649a219e2282177125 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Package/Editor/Override/IMainToolbarElementOverrideRepository.cs: -------------------------------------------------------------------------------- 1 | namespace Paps.UnityToolbarExtenderUIToolkit 2 | { 3 | internal interface IMainToolbarElementOverrideRepository 4 | { 5 | public MainToolbarElementOverride? Get(string elementId); 6 | public MainToolbarElementOverride[] GetAll(); 7 | public void Save(MainToolbarElementOverride elementOverride); 8 | public void Clear(); 9 | } 10 | } -------------------------------------------------------------------------------- /Assets/Package/Editor/Override/IMainToolbarElementOverrideRepository.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 280c883dcd1944448a1b93cecc8877f7 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/Override/MainToolbarElementOverride.cs: -------------------------------------------------------------------------------- 1 | namespace Paps.UnityToolbarExtenderUIToolkit 2 | { 3 | internal readonly struct MainToolbarElementOverride 4 | { 5 | public string ElementId { get; } 6 | public bool Visible { get; } 7 | 8 | public MainToolbarElementOverride(string elementId, bool visible) 9 | { 10 | ElementId = elementId; 11 | Visible = visible; 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /Assets/Package/Editor/Override/MainToolbarElementOverride.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e51009f5c83b62f419eee2089fd6e63f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/Override/UserSettingsFileMainToolbarElementOverrideRepository.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 267c04a3d47600c488137859ea7af2a9 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/Paps.UnityToolbarExtenderUIToolkit.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Paps.UnityToolbarExtenderUIToolkit", 3 | "rootNamespace": "Paps.UnityToolbarExtenderUIToolkit", 4 | "references": [ 5 | "Unity.Serialization" 6 | ], 7 | "includePlatforms": [ 8 | "Editor" 9 | ], 10 | "excludePlatforms": [], 11 | "allowUnsafeCode": false, 12 | "overrideReferences": false, 13 | "precompiledReferences": [], 14 | "autoReferenced": false, 15 | "defineConstraints": [], 16 | "versionDefines": [], 17 | "noEngineReferences": false 18 | } -------------------------------------------------------------------------------- /Assets/Package/Editor/Paps.UnityToolbarExtenderUIToolkit.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8d62da4aabd2a19419c7378d23ea5849 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Package/Editor/RecommendedStyles.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 21a21acb2ce38fb46bd178a11e0cc483 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Package/Editor/RecommendedStyles/ButtonRecommendedStyle.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine.UIElements; 2 | 3 | namespace Paps.UnityToolbarExtenderUIToolkit 4 | { 5 | internal class ButtonRecommendedStyle : RecommendedStyle 6 | { 7 | private Button _button; 8 | 9 | public ButtonRecommendedStyle(Button button) 10 | { 11 | _button = button; 12 | } 13 | 14 | protected override void ApplyRootElementStyle() 15 | { 16 | _button.style.overflow = Overflow.Visible; 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /Assets/Package/Editor/RecommendedStyles/ButtonRecommendedStyle.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dcaec52f220ee13458fa862e8f9f31b6 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/RecommendedStyles/ColorFieldRecommendedStyle.cs: -------------------------------------------------------------------------------- 1 | using UnityEditor.UIElements; 2 | using UnityEngine.UIElements; 3 | 4 | namespace Paps.UnityToolbarExtenderUIToolkit 5 | { 6 | internal class ColorFieldRecommendedStyle : RecommendedStyle 7 | { 8 | private readonly ColorField _colorField; 9 | 10 | public ColorFieldRecommendedStyle(ColorField colorField) 11 | { 12 | _colorField = colorField; 13 | } 14 | 15 | protected override void ApplyRootElementStyle() 16 | { 17 | _colorField.labelElement.style.minWidth = Length.Auto(); 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /Assets/Package/Editor/RecommendedStyles/ColorFieldRecommendedStyle.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ee22b5ac49a830e4a8e35f5e98b656d1 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/RecommendedStyles/DropdownFieldRecommendedStyle.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine.UIElements; 2 | 3 | namespace Paps.UnityToolbarExtenderUIToolkit 4 | { 5 | internal class DropdownFieldRecommendedStyle : RecommendedStyle 6 | { 7 | private DropdownField _dropdownField; 8 | 9 | public DropdownFieldRecommendedStyle(DropdownField dropdownField) 10 | { 11 | _dropdownField = dropdownField; 12 | } 13 | 14 | protected override void ApplyRootElementStyle() 15 | { 16 | _dropdownField.labelElement.style.minWidth = Length.Auto(); 17 | 18 | var inputFieldIndex = 1; 19 | 20 | if (string.IsNullOrEmpty(_dropdownField.label)) 21 | inputFieldIndex = 0; 22 | 23 | var inputElement = _dropdownField[inputFieldIndex]; 24 | inputElement.style.overflow = Overflow.Visible; 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /Assets/Package/Editor/RecommendedStyles/DropdownFieldRecommendedStyle.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 494f883ee1470b044a6a7dbdc7218c66 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/RecommendedStyles/EditorToolbarDropdownRecommendedStyle.cs: -------------------------------------------------------------------------------- 1 | using UnityEditor.Toolbars; 2 | using UnityEngine.UIElements; 3 | 4 | namespace Paps.UnityToolbarExtenderUIToolkit 5 | { 6 | internal class EditorToolbarDropdownRecommendedStyle : RecommendedStyle 7 | { 8 | private EditorToolbarDropdown _dropdown; 9 | 10 | public EditorToolbarDropdownRecommendedStyle(EditorToolbarDropdown dropdown) 11 | { 12 | _dropdown = dropdown; 13 | } 14 | 15 | protected override void ApplyInsideGroupStyle() 16 | { 17 | var arrowIndex = 2; 18 | 19 | if (string.IsNullOrEmpty(_dropdown.text)) 20 | arrowIndex = 1; 21 | 22 | var arrow = _dropdown[arrowIndex]; 23 | 24 | _dropdown.style.flexDirection = FlexDirection.Row; 25 | _dropdown.style.flexWrap = Wrap.NoWrap; 26 | _dropdown.style.overflow = Overflow.Visible; 27 | _dropdown.RemoveFromClassList("unity-toolbar-button"); 28 | _dropdown.AddToClassList("unity-button"); 29 | arrow.AddToClassList("unity-base-popup-field__arrow"); 30 | } 31 | 32 | protected override void ApplyRootElementStyle() 33 | { 34 | var arrowIndex = 2; 35 | 36 | if (string.IsNullOrEmpty(_dropdown.text)) 37 | arrowIndex = 1; 38 | 39 | var arrow = _dropdown[arrowIndex]; 40 | 41 | _dropdown.style.flexDirection = FlexDirection.Row; 42 | _dropdown.style.flexWrap = Wrap.NoWrap; 43 | _dropdown.style.overflow = StyleKeyword.Null; 44 | _dropdown.RemoveFromClassList("unity-button"); 45 | _dropdown.AddToClassList("unity-toolbar-button"); 46 | arrow.RemoveFromClassList("unity-base-popup-field__arrow"); 47 | } 48 | } 49 | } -------------------------------------------------------------------------------- /Assets/Package/Editor/RecommendedStyles/EditorToolbarDropdownRecommendedStyle.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ceacb8187593d1345ac7101feedd059c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/RecommendedStyles/EditorToolbarToggleRecommendedStyle.cs: -------------------------------------------------------------------------------- 1 | using UnityEditor.Toolbars; 2 | using UnityEngine.UIElements; 3 | using System.Reflection; 4 | using UnityEngine; 5 | 6 | namespace Paps.UnityToolbarExtenderUIToolkit 7 | { 8 | internal class EditorToolbarToggleRecommendedStyle : RecommendedStyle 9 | { 10 | private readonly EditorToolbarToggle _toolbarToggle; 11 | private Image _iconImageElement; 12 | private VisualElement _checkmark; 13 | 14 | public EditorToolbarToggleRecommendedStyle(EditorToolbarToggle toolbarToggle) 15 | { 16 | _toolbarToggle = toolbarToggle; 17 | _iconImageElement = _toolbarToggle.Q(); 18 | _checkmark = _toolbarToggle.Query(className: "unity-toggle__checkmark"); 19 | } 20 | 21 | protected override void ApplyRootElementStyle() 22 | { 23 | _iconImageElement.style.width = Length.Auto(); 24 | _toolbarToggle.style.paddingLeft = 3; 25 | } 26 | 27 | protected override void ApplyInsideGroupStyle() 28 | { 29 | _toolbarToggle.AddToClassList("unity-button"); 30 | _toolbarToggle.RemoveFromClassList("unity-toolbar-toggle"); 31 | _toolbarToggle.RemoveFromClassList("unity-editor-toolbar-toggle"); 32 | _checkmark.style.display = DisplayStyle.None; 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /Assets/Package/Editor/RecommendedStyles/EditorToolbarToggleRecommendedStyle.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1397116b676f4994c8458c8ca852d7dc 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/RecommendedStyles/EnumFieldRecommendedStyle.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine.UIElements; 2 | 3 | namespace Paps.UnityToolbarExtenderUIToolkit 4 | { 5 | internal class EnumFieldRecommendedStyle : RecommendedStyle 6 | { 7 | private EnumField _enumField; 8 | 9 | public EnumFieldRecommendedStyle(EnumField enumField) 10 | { 11 | _enumField = enumField; 12 | } 13 | 14 | protected override void ApplyRootElementStyle() 15 | { 16 | _enumField.labelElement.style.minWidth = Length.Auto(); 17 | 18 | var inputFieldIndex = 1; 19 | 20 | if (string.IsNullOrEmpty(_enumField.label)) 21 | inputFieldIndex = 0; 22 | 23 | var inputElement = _enumField[inputFieldIndex]; 24 | inputElement.style.overflow = Overflow.Visible; 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /Assets/Package/Editor/RecommendedStyles/EnumFieldRecommendedStyle.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d96e8ee8678283341916b37ef64659a9 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/RecommendedStyles/EnumFlagsFieldRecommendedStyle.cs: -------------------------------------------------------------------------------- 1 | using UnityEditor.UIElements; 2 | using UnityEngine.UIElements; 3 | 4 | namespace Paps.UnityToolbarExtenderUIToolkit 5 | { 6 | internal class EnumFlagsFieldRecommendedStyle : RecommendedStyle 7 | { 8 | private EnumFlagsField _enumField; 9 | 10 | public EnumFlagsFieldRecommendedStyle(EnumFlagsField enumField) 11 | { 12 | _enumField = enumField; 13 | } 14 | 15 | protected override void ApplyRootElementStyle() 16 | { 17 | _enumField.labelElement.style.minWidth = Length.Auto(); 18 | 19 | var inputFieldIndex = 1; 20 | 21 | if (string.IsNullOrEmpty(_enumField.label)) 22 | inputFieldIndex = 0; 23 | 24 | var inputElement = _enumField[inputFieldIndex]; 25 | inputElement.style.overflow = Overflow.Visible; 26 | inputElement.style.minWidth = 120; 27 | } 28 | 29 | protected override void ApplyInsideGroupStyle() 30 | { 31 | _enumField.style.flexGrow = 1; 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /Assets/Package/Editor/RecommendedStyles/EnumFlagsFieldRecommendedStyle.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bb3b70fed4d19e84394fb93b4e4417aa 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/RecommendedStyles/FloatFieldRecommendedStyle.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine.UIElements; 2 | 3 | namespace Paps.UnityToolbarExtenderUIToolkit 4 | { 5 | internal class FloatFieldRecommendedStyle : RecommendedStyle 6 | { 7 | private const int MIN_WIDTH = 80; 8 | 9 | private FloatField _floatField; 10 | 11 | public FloatFieldRecommendedStyle(FloatField floatField) 12 | { 13 | _floatField = floatField; 14 | } 15 | 16 | protected override void ApplyRootElementStyle() 17 | { 18 | var inputFieldIndex = 1; 19 | 20 | if (string.IsNullOrEmpty(_floatField.label)) 21 | inputFieldIndex = 0; 22 | 23 | var inputElement = _floatField[inputFieldIndex]; 24 | 25 | _floatField.labelElement.style.minWidth = Length.Auto(); 26 | inputElement.style.minWidth = MIN_WIDTH; 27 | inputElement.style.overflow = Overflow.Visible; 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /Assets/Package/Editor/RecommendedStyles/FloatFieldRecommendedStyle.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1886e6235603764499ce2f621b0104e1 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/RecommendedStyles/IntegerFieldRecommendedStyle.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.UIElements; 3 | 4 | namespace Paps.UnityToolbarExtenderUIToolkit 5 | { 6 | internal class IntegerFieldRecommendedStyle : RecommendedStyle 7 | { 8 | private const int MIN_WIDTH = 80; 9 | 10 | private IntegerField _integerField; 11 | 12 | public IntegerFieldRecommendedStyle(IntegerField integerField) 13 | { 14 | _integerField = integerField; 15 | } 16 | 17 | protected override void ApplyRootElementStyle() 18 | { 19 | var inputFieldIndex = 1; 20 | 21 | if(string.IsNullOrEmpty(_integerField.label)) 22 | inputFieldIndex = 0; 23 | 24 | var inputElement = _integerField[inputFieldIndex]; 25 | 26 | _integerField.labelElement.style.minWidth = Length.Auto(); 27 | inputElement.style.minWidth = MIN_WIDTH; 28 | inputElement.style.overflow = Overflow.Visible; 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /Assets/Package/Editor/RecommendedStyles/IntegerFieldRecommendedStyle.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e985a178fb9e7144997ea894be45f69c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/RecommendedStyles/LayerFieldRecommendedStyle.cs: -------------------------------------------------------------------------------- 1 | using UnityEditor.UIElements; 2 | using UnityEngine.UIElements; 3 | 4 | namespace Paps.UnityToolbarExtenderUIToolkit 5 | { 6 | internal class LayerFieldRecommendedStyle : RecommendedStyle 7 | { 8 | private readonly LayerField _layerField; 9 | 10 | public LayerFieldRecommendedStyle(LayerField layerField) 11 | { 12 | _layerField = layerField; 13 | } 14 | 15 | protected override void ApplyRootElementStyle() 16 | { 17 | _layerField.labelElement.style.minWidth = Length.Auto(); 18 | 19 | var inputFieldIndex = 1; 20 | 21 | if (string.IsNullOrEmpty(_layerField.label)) 22 | inputFieldIndex = 0; 23 | 24 | var inputElement = _layerField[inputFieldIndex]; 25 | inputElement.style.overflow = Overflow.Visible; 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /Assets/Package/Editor/RecommendedStyles/LayerFieldRecommendedStyle.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2d1af6dea50217644b547fb52bf5c06d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/RecommendedStyles/ObjectFieldRecommendedStyle.cs: -------------------------------------------------------------------------------- 1 | using UnityEditor.UIElements; 2 | using UnityEngine.UIElements; 3 | 4 | namespace Paps.UnityToolbarExtenderUIToolkit 5 | { 6 | internal class ObjectFieldRecommendedStyle : RecommendedStyle 7 | { 8 | private ObjectField _objectField; 9 | 10 | public ObjectFieldRecommendedStyle(ObjectField objectField) 11 | { 12 | _objectField = objectField; 13 | } 14 | 15 | protected override void ApplyRootElementStyle() 16 | { 17 | _objectField.labelElement.style.minWidth = Length.Auto(); 18 | 19 | var inputFieldIndex = 1; 20 | 21 | if (string.IsNullOrEmpty(_objectField.label)) 22 | inputFieldIndex = 0; 23 | 24 | var inputElement = _objectField[inputFieldIndex]; 25 | inputElement.style.overflow = Overflow.Visible; 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /Assets/Package/Editor/RecommendedStyles/ObjectFieldRecommendedStyle.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4867ef570d5dc0d4aa440c808aa8b8cb 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/RecommendedStyles/RecommendedStyle.cs: -------------------------------------------------------------------------------- 1 | namespace Paps.UnityToolbarExtenderUIToolkit 2 | { 3 | internal abstract class RecommendedStyle 4 | { 5 | public void Apply(bool isInsideGroup) 6 | { 7 | if (isInsideGroup) 8 | ApplyInsideGroupStyle(); 9 | else 10 | ApplyRootElementStyle(); 11 | } 12 | 13 | protected virtual void ApplyRootElementStyle() { } 14 | protected virtual void ApplyInsideGroupStyle() { } 15 | } 16 | } -------------------------------------------------------------------------------- /Assets/Package/Editor/RecommendedStyles/RecommendedStyle.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5f26f22147430fd489504b39ee8b4701 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/RecommendedStyles/RecommendedStyleVisualElement.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine.UIElements; 2 | 3 | namespace Paps.UnityToolbarExtenderUIToolkit 4 | { 5 | internal class RecommendedStyleVisualElement 6 | { 7 | public VisualElement VisualElement { get; } 8 | public bool IsInsideGroup { get; } 9 | 10 | public RecommendedStyleVisualElement(VisualElement visualElement, bool isInsideGroup) 11 | { 12 | VisualElement = visualElement; 13 | IsInsideGroup = isInsideGroup; 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /Assets/Package/Editor/RecommendedStyles/RecommendedStyleVisualElement.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c7fa52a9eb868af459e137032102136d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/RecommendedStyles/RecommendedStyles.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 716c417d45185ed49880601a82aa7ce3 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/RecommendedStyles/SliderRecommendedStyle.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine.UIElements; 2 | 3 | namespace Paps.UnityToolbarExtenderUIToolkit 4 | { 5 | internal class SliderRecommendedStyle : RecommendedStyle 6 | { 7 | private const float MIN_WIDTH = 200; 8 | 9 | private readonly Slider _slider; 10 | 11 | public SliderRecommendedStyle(Slider slider) 12 | { 13 | _slider = slider; 14 | } 15 | 16 | protected override void ApplyInsideGroupStyle() 17 | { 18 | _slider.style.flexWrap = Wrap.NoWrap; 19 | _slider.style.flexShrink = 1; 20 | } 21 | 22 | protected override void ApplyRootElementStyle() 23 | { 24 | _slider.labelElement.style.minWidth = 0; 25 | _slider.style.minWidth = MIN_WIDTH; 26 | _slider.style.flexShrink = 0; 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /Assets/Package/Editor/RecommendedStyles/SliderRecommendedStyle.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5d17fd66cf40a264298b8233ece34e5d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/RecommendedStyles/TagFieldRecommendedStyle.cs: -------------------------------------------------------------------------------- 1 | using UnityEditor.UIElements; 2 | using UnityEngine.UIElements; 3 | 4 | namespace Paps.UnityToolbarExtenderUIToolkit 5 | { 6 | internal class TagFieldRecommendedStyle : RecommendedStyle 7 | { 8 | private TagField _tagField; 9 | 10 | public TagFieldRecommendedStyle(TagField tagField) 11 | { 12 | _tagField = tagField; 13 | } 14 | 15 | protected override void ApplyRootElementStyle() 16 | { 17 | _tagField.labelElement.style.minWidth = Length.Auto(); 18 | 19 | var inputFieldIndex = 1; 20 | 21 | if (string.IsNullOrEmpty(_tagField.label)) 22 | inputFieldIndex = 0; 23 | 24 | var inputElement = _tagField[inputFieldIndex]; 25 | inputElement.style.overflow = Overflow.Visible; 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /Assets/Package/Editor/RecommendedStyles/TagFieldRecommendedStyle.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0bb992cea63cc3b4a8bb869531fa8d11 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/RecommendedStyles/TextFieldRecommendedStyle.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine.UIElements; 2 | 3 | namespace Paps.UnityToolbarExtenderUIToolkit 4 | { 5 | internal class TextFieldRecommendedStyle : RecommendedStyle 6 | { 7 | private const int MIN_WIDTH = 120; 8 | 9 | private TextField _textField; 10 | 11 | public TextFieldRecommendedStyle(TextField textField) 12 | { 13 | _textField = textField; 14 | } 15 | 16 | protected override void ApplyRootElementStyle() 17 | { 18 | var inputFieldIndex = 1; 19 | 20 | if (string.IsNullOrEmpty(_textField.label)) 21 | inputFieldIndex = 0; 22 | 23 | var inputElement = _textField[inputFieldIndex]; 24 | 25 | _textField.labelElement.style.minWidth = Length.Auto(); 26 | inputElement.style.minWidth = MIN_WIDTH; 27 | inputElement.style.overflow = Overflow.Visible; 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /Assets/Package/Editor/RecommendedStyles/TextFieldRecommendedStyle.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 34fd75b876b07474eb077487a678ff0e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/RecommendedStyles/ToggleRecommendedStyle.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine.UIElements; 2 | 3 | namespace Paps.UnityToolbarExtenderUIToolkit 4 | { 5 | internal class ToggleRecommendedStyle : RecommendedStyle 6 | { 7 | private Toggle _toggle; 8 | 9 | public ToggleRecommendedStyle(Toggle toggle) 10 | { 11 | _toggle = toggle; 12 | } 13 | 14 | protected override void ApplyRootElementStyle() 15 | { 16 | _toggle.labelElement.style.minWidth = 0; 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /Assets/Package/Editor/RecommendedStyles/ToggleRecommendedStyle.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d7af66ce1efeb9645835121aad8c63d4 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/RecommendedStyles/Vector2FieldRecommendedStyle.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using UnityEngine.UIElements; 3 | 4 | namespace Paps.UnityToolbarExtenderUIToolkit 5 | { 6 | internal class Vector2FieldRecommendedStyle : RecommendedStyle 7 | { 8 | private const int SINGLE_FIELD_MIN_WIDTH = 80; 9 | 10 | private readonly Vector2Field _vector2Field; 11 | 12 | public Vector2FieldRecommendedStyle(Vector2Field vector2Field) 13 | { 14 | _vector2Field = vector2Field; 15 | } 16 | 17 | protected override void ApplyRootElementStyle() 18 | { 19 | _vector2Field.labelElement.style.minWidth = Length.Auto(); 20 | 21 | var inputFieldsParentElement = GetInputFieldsParentElement(); 22 | 23 | foreach (var child in inputFieldsParentElement.Children().Where(childElement => childElement is FloatField)) 24 | { 25 | var inputFieldElementIndex = 1; 26 | 27 | var inputFieldElement = child[inputFieldElementIndex]; 28 | 29 | inputFieldElement.style.overflow = Overflow.Visible; 30 | inputFieldElement.style.minWidth = SINGLE_FIELD_MIN_WIDTH; 31 | } 32 | 33 | var spacerElement = inputFieldsParentElement.Children().Last(); 34 | 35 | spacerElement.style.flexGrow = 0; 36 | } 37 | 38 | protected override void ApplyInsideGroupStyle() 39 | { 40 | var inputFieldsParentElement = GetInputFieldsParentElement(); 41 | 42 | inputFieldsParentElement.style.flexWrap = Wrap.Wrap; 43 | 44 | var spacerElement = inputFieldsParentElement.Children().Last(); 45 | 46 | spacerElement.style.flexGrow = 0; 47 | } 48 | 49 | private VisualElement GetInputFieldsParentElement() 50 | { 51 | var inputFieldsParentIndex = 1; 52 | 53 | if (string.IsNullOrEmpty(_vector2Field.label)) 54 | inputFieldsParentIndex = 0; 55 | 56 | return _vector2Field[inputFieldsParentIndex]; 57 | } 58 | } 59 | } -------------------------------------------------------------------------------- /Assets/Package/Editor/RecommendedStyles/Vector2FieldRecommendedStyle.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d74598c0b3338b540a340e16719351b2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/RecommendedStyles/Vector3FieldRecommendedStyle.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine.UIElements; 2 | 3 | namespace Paps.UnityToolbarExtenderUIToolkit 4 | { 5 | internal class Vector3FieldRecommendedStyle : RecommendedStyle 6 | { 7 | private const int SINGLE_FIELD_MIN_WIDTH = 80; 8 | 9 | private readonly Vector3Field _vector3Field; 10 | 11 | public Vector3FieldRecommendedStyle(Vector3Field vector3Field) 12 | { 13 | _vector3Field = vector3Field; 14 | } 15 | 16 | protected override void ApplyRootElementStyle() 17 | { 18 | _vector3Field.labelElement.style.minWidth = Length.Auto(); 19 | 20 | var inputFieldsParentElement = GetInputFieldsParentElement(); 21 | 22 | foreach(var floatField in inputFieldsParentElement.Children()) 23 | { 24 | var inputFieldElementIndex = 1; 25 | 26 | var inputFieldElement = floatField[inputFieldElementIndex]; 27 | 28 | inputFieldElement.style.overflow = Overflow.Visible; 29 | inputFieldElement.style.minWidth = SINGLE_FIELD_MIN_WIDTH; 30 | } 31 | } 32 | 33 | protected override void ApplyInsideGroupStyle() 34 | { 35 | var inputFieldsParentElement = GetInputFieldsParentElement(); 36 | 37 | inputFieldsParentElement.style.flexWrap = Wrap.Wrap; 38 | } 39 | 40 | private VisualElement GetInputFieldsParentElement() 41 | { 42 | var inputFieldsParentIndex = 1; 43 | 44 | if (string.IsNullOrEmpty(_vector3Field.label)) 45 | inputFieldsParentIndex = 0; 46 | 47 | return _vector3Field[inputFieldsParentIndex]; 48 | } 49 | } 50 | } -------------------------------------------------------------------------------- /Assets/Package/Editor/RecommendedStyles/Vector3FieldRecommendedStyle.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ca6000716cd684f44ac44154a65f9653 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/SerializableValues.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: da7391b8db06da04394d88ad292f12d1 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Package/Editor/SerializableValues/ElementVariables.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace Paps.UnityToolbarExtenderUIToolkit 4 | { 5 | internal class ElementVariables 6 | { 7 | public MainToolbarElement MainToolbarElement; 8 | public FieldVariable[] Fields; 9 | public PropertyVariable[] Properties; 10 | 11 | public bool DidChange() 12 | { 13 | foreach (var field in Fields) 14 | if (field.DidChange()) 15 | return true; 16 | 17 | foreach (var property in Properties) 18 | if (property.DidChange()) 19 | return true; 20 | 21 | return false; 22 | } 23 | 24 | public void UpdateValues() 25 | { 26 | foreach (var field in Fields) 27 | field.UpdateValue(); 28 | 29 | foreach (var property in Properties) 30 | property.UpdateValue(); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Assets/Package/Editor/SerializableValues/ElementVariables.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1fd7c94aebc6703448efe6f6e8e899aa 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/SerializableValues/FieldVariable.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | 3 | namespace Paps.UnityToolbarExtenderUIToolkit 4 | { 5 | internal class FieldVariable : Variable 6 | { 7 | public readonly FieldInfo Field; 8 | 9 | public FieldVariable(MainToolbarElement element, FieldInfo field, IValueSerializer valueSerializer, SerializeAttribute attribute) 10 | : base(element, field.FieldType, field.GetValue(element.VisualElement), valueSerializer, attribute) 11 | { 12 | Field = field; 13 | } 14 | 15 | public override object Get() 16 | { 17 | return Field.GetValue(Element.VisualElement); 18 | } 19 | 20 | public override void Set(object value) 21 | { 22 | Field.SetValue(Element.VisualElement, value); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Assets/Package/Editor/SerializableValues/FieldVariable.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 52b93a1d12abcdd43ad8862697bad9ef 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/SerializableValues/IMainToolbarElementVariableRepository.cs: -------------------------------------------------------------------------------- 1 | namespace Paps.UnityToolbarExtenderUIToolkit 2 | { 3 | internal interface IMainToolbarElementVariableRepository 4 | { 5 | public void Set(SerializableElement serializableElement); 6 | public void SetAll(SerializableElement[] serializableElements); 7 | public SerializableElement[] GetAll(); 8 | public void Save(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Assets/Package/Editor/SerializableValues/IMainToolbarElementVariableRepository.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cc3941d2eca2d2f4ea42787117a4bd40 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/SerializableValues/IMainToolbarElementVariableSerializer.cs: -------------------------------------------------------------------------------- 1 | namespace Paps.UnityToolbarExtenderUIToolkit 2 | { 3 | internal interface IMainToolbarElementVariableSerializer 4 | { 5 | public string Serialize(SerializableElementGroup serializableElementGroup); 6 | public SerializableElementGroup Deserialize(string serializedElementGroup); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Assets/Package/Editor/SerializableValues/IMainToolbarElementVariableSerializer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d142e847e3be4574e9d1689324b5720c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/SerializableValues/IValueSerializer.cs: -------------------------------------------------------------------------------- 1 | namespace Paps.UnityToolbarExtenderUIToolkit 2 | { 3 | internal interface IValueSerializer 4 | { 5 | string Serialize(T value); 6 | T Deserialize(string serializedValue); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Assets/Package/Editor/SerializableValues/IValueSerializer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d5c4ccea207b25d4098b94a25cd4eb5e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/SerializableValues/MainToolbarElementVariableWatcher.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 62abfdfdd04775b409e83c230d7ddc4c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/SerializableValues/PropertyVariable.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Reflection; 3 | 4 | namespace Paps.UnityToolbarExtenderUIToolkit 5 | { 6 | internal class PropertyVariable : Variable 7 | { 8 | public readonly PropertyInfo Property; 9 | 10 | public PropertyVariable(MainToolbarElement element, PropertyInfo property, IValueSerializer valueSerializer, SerializeAttribute attribute) 11 | : base(element, property.PropertyType, property.GetValue(element.VisualElement), valueSerializer, attribute) 12 | { 13 | Property = property; 14 | } 15 | 16 | public override object Get() 17 | { 18 | return Property.GetValue(Element.VisualElement); 19 | } 20 | 21 | public override void Set(object value) 22 | { 23 | Property.SetValue(Element.VisualElement, value); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Assets/Package/Editor/SerializableValues/PropertyVariable.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e18acef36457df44da9432e05a0c38a1 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/SerializableValues/SerializableElement.cs: -------------------------------------------------------------------------------- 1 | namespace Paps.UnityToolbarExtenderUIToolkit 2 | { 3 | internal class SerializableElement 4 | { 5 | public string ElementFullTypeName; 6 | public SerializableVariable[] Variables = new SerializableVariable[0]; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Assets/Package/Editor/SerializableValues/SerializableElement.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7edf7215b75471c4f83e4affd1852a6f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/SerializableValues/SerializableElementGroup.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Paps.UnityToolbarExtenderUIToolkit 4 | { 5 | internal class SerializableElementGroup 6 | { 7 | public Dictionary SerializableElements = new Dictionary(); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Assets/Package/Editor/SerializableValues/SerializableElementGroup.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 657001aa20153804f8d8e39515494221 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/SerializableValues/SerializableVariable.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Paps.UnityToolbarExtenderUIToolkit 4 | { 5 | internal struct SerializableVariable 6 | { 7 | public ValueHolderType Type; 8 | public string Key; 9 | public Type ValueType; 10 | public object Value; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Assets/Package/Editor/SerializableValues/SerializableVariable.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fbe233d1da6590648bd836f9184b28c7 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/SerializableValues/SerializeAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | 4 | namespace Paps.UnityToolbarExtenderUIToolkit 5 | { 6 | public class SerializeAttribute : Attribute 7 | { 8 | public string SerializationKey { get; } 9 | 10 | public SerializeAttribute(string serializationKey = null) 11 | { 12 | SerializationKey = serializationKey; 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Assets/Package/Editor/SerializableValues/SerializeAttribute.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 13ca109f93dfdcd49bb7e38c834a6679 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/SerializableValues/UnitySerializationMainToolbarElementVariableSerializer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: eb8fdee7bd4d00a489619573c341c510 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/SerializableValues/UnitySerializationValueSerializer.cs: -------------------------------------------------------------------------------- 1 | using Unity.Serialization.Json; 2 | 3 | namespace Paps.UnityToolbarExtenderUIToolkit 4 | { 5 | internal class UnitySerializationValueSerializer : IValueSerializer 6 | { 7 | public T Deserialize(string serializedValue) 8 | { 9 | return JsonSerialization.FromJson(serializedValue); 10 | } 11 | 12 | public string Serialize(T value) 13 | { 14 | return JsonSerialization.ToJson(value, new JsonSerializationParameters() { Minified = true } ); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Assets/Package/Editor/SerializableValues/UnitySerializationValueSerializer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 71e02839f1a8c5240af3b944fc2daa38 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/SerializableValues/UserSettingsFileMainToolbarElementVariableRepository.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using System.Linq; 3 | using UnityEditor; 4 | using UnityEngine; 5 | 6 | namespace Paps.UnityToolbarExtenderUIToolkit 7 | { 8 | internal class UserSettingsFileMainToolbarElementVariableRepository : IMainToolbarElementVariableRepository 9 | { 10 | private static readonly string DIRECTORY = Path.Combine(Directory.GetParent(Application.dataPath).FullName, "UserSettings/", "unity-toolbar-extender-ui-toolkit", "serialized-user-values"); 11 | private static readonly string FILE = Path.Combine(DIRECTORY, "serialized_values.json"); 12 | private readonly IMainToolbarElementVariableSerializer _serializer; 13 | private SerializableElementGroup _elementGroup; 14 | private SerializableElementGroup ElementGroup 15 | { 16 | get 17 | { 18 | if (_elementGroup == null) 19 | _elementGroup = Load(); 20 | 21 | return _elementGroup; 22 | } 23 | set => _elementGroup = value; 24 | } 25 | 26 | public UserSettingsFileMainToolbarElementVariableRepository(IMainToolbarElementVariableSerializer serializer) 27 | { 28 | _serializer = serializer; 29 | } 30 | 31 | public SerializableElement[] GetAll() 32 | { 33 | return ElementGroup.SerializableElements.Values.ToArray(); 34 | } 35 | 36 | public void Set(SerializableElement serializableElement) 37 | { 38 | ElementGroup.SerializableElements[serializableElement.ElementFullTypeName] = serializableElement; 39 | } 40 | 41 | public void SetAll(SerializableElement[] serializableElements) 42 | { 43 | ElementGroup.SerializableElements = serializableElements.ToDictionary(s => s.ElementFullTypeName, s => s); 44 | } 45 | 46 | private SerializableElementGroup Load() 47 | { 48 | if(!Directory.Exists(DIRECTORY)) 49 | Directory.CreateDirectory(DIRECTORY); 50 | 51 | if (!File.Exists(FILE)) 52 | return _serializer.Deserialize("{}"); 53 | else 54 | return _serializer.Deserialize(File.ReadAllText(FILE)); 55 | } 56 | 57 | public void Save() 58 | { 59 | var serializedString = _serializer.Serialize(ElementGroup); 60 | File.WriteAllText(FILE, serializedString); 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Assets/Package/Editor/SerializableValues/UserSettingsFileMainToolbarElementVariableRepository.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8063852f8dc46d74a9fa8cd1d5401716 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/SerializableValues/ValueHolderType.cs: -------------------------------------------------------------------------------- 1 | namespace Paps.UnityToolbarExtenderUIToolkit 2 | { 3 | internal enum ValueHolderType 4 | { 5 | Field, 6 | Property 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Assets/Package/Editor/SerializableValues/ValueHolderType.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1dd09907e73e4a84ab82d32c04378911 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/SerializableValues/Variable.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Reflection; 3 | 4 | namespace Paps.UnityToolbarExtenderUIToolkit 5 | { 6 | internal abstract class Variable 7 | { 8 | private string _lastValueSerialized; 9 | private string LastValueSerialized 10 | { 11 | get 12 | { 13 | if (_lastValueSerialized == null) 14 | _lastValueSerialized = Serialize(Get()); 15 | 16 | return _lastValueSerialized; 17 | } 18 | 19 | set => _lastValueSerialized = value; 20 | } 21 | private IValueSerializer _valueSerializer; 22 | private MethodInfo _serializeValueMethod, _deserializeValueMethod; 23 | 24 | public MainToolbarElement Element { get; } 25 | public Type ValueType { get; } 26 | public SerializeAttribute Attribute { get; } 27 | 28 | public Variable(MainToolbarElement element, Type valueType, object initialValue, IValueSerializer valueSerializer, SerializeAttribute attribute) 29 | { 30 | Element = element; 31 | ValueType = valueType; 32 | _valueSerializer = valueSerializer; 33 | Attribute = attribute; 34 | _serializeValueMethod = _valueSerializer.GetType().GetMethod("Serialize", BindingFlags.Instance | BindingFlags.Public); 35 | _deserializeValueMethod = _valueSerializer.GetType().GetMethod("Deserialize", BindingFlags.Instance | BindingFlags.Public); 36 | } 37 | 38 | public abstract object Get(); 39 | 40 | public abstract void Set(object value); 41 | 42 | public bool DidChange() 43 | { 44 | var currentValue = Get(); 45 | 46 | var currentValueSerialized = Serialize(currentValue); 47 | 48 | return currentValueSerialized != LastValueSerialized; 49 | } 50 | 51 | private string Serialize(object value) 52 | { 53 | var genericMethod = _serializeValueMethod.MakeGenericMethod(ValueType); 54 | return (string)genericMethod.Invoke(_valueSerializer, new object[] { Get() }); 55 | } 56 | 57 | private object Deserialize(string serialized) 58 | { 59 | var genericMethod = _deserializeValueMethod.MakeGenericMethod(ValueType); 60 | return genericMethod.Invoke(_valueSerializer, new object[] { serialized }); 61 | } 62 | 63 | public void UpdateValue() 64 | { 65 | LastValueSerialized = Serialize(Get()); 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /Assets/Package/Editor/SerializableValues/Variable.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 219c1bb61dbca8e4d966b029961aed81 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/Editor/ToolbarAlign.cs: -------------------------------------------------------------------------------- 1 | namespace Paps.UnityToolbarExtenderUIToolkit 2 | { 3 | public enum ToolbarAlign 4 | { 5 | Left, 6 | Right 7 | } 8 | } -------------------------------------------------------------------------------- /Assets/Package/Editor/ToolbarAlign.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3ea30c0e2b125014f8d433ee5360acb4 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Package/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Paps 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Assets/Package/LICENSE.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 83e586aa5cf954944aff4745fd579761 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Package/README.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 680ef92f93f231b4281d7813d51de007 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Package/Readme-Resources~/broken-element-example.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sammmte/unity-toolbar-extender-ui-toolkit/eab014cb30285cce4289da6ac19872c5d46c1489/Assets/Package/Readme-Resources~/broken-element-example.jpg -------------------------------------------------------------------------------- /Assets/Package/Readme-Resources~/common-arrangement-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sammmte/unity-toolbar-extender-ui-toolkit/eab014cb30285cce4289da6ac19872c5d46c1489/Assets/Package/Readme-Resources~/common-arrangement-example.png -------------------------------------------------------------------------------- /Assets/Package/Readme-Resources~/common-button-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sammmte/unity-toolbar-extender-ui-toolkit/eab014cb30285cce4289da6ac19872c5d46c1489/Assets/Package/Readme-Resources~/common-button-example.png -------------------------------------------------------------------------------- /Assets/Package/Readme-Resources~/container-scrollable-demonstration.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sammmte/unity-toolbar-extender-ui-toolkit/eab014cb30285cce4289da6ac19872c5d46c1489/Assets/Package/Readme-Resources~/container-scrollable-demonstration.gif -------------------------------------------------------------------------------- /Assets/Package/Readme-Resources~/control-alignment-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sammmte/unity-toolbar-extender-ui-toolkit/eab014cb30285cce4289da6ac19872c5d46c1489/Assets/Package/Readme-Resources~/control-alignment-example.png -------------------------------------------------------------------------------- /Assets/Package/Readme-Resources~/custom-element-example.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sammmte/unity-toolbar-extender-ui-toolkit/eab014cb30285cce4289da6ac19872c5d46c1489/Assets/Package/Readme-Resources~/custom-element-example.gif -------------------------------------------------------------------------------- /Assets/Package/Readme-Resources~/group-demonstration.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sammmte/unity-toolbar-extender-ui-toolkit/eab014cb30285cce4289da6ac19872c5d46c1489/Assets/Package/Readme-Resources~/group-demonstration.gif -------------------------------------------------------------------------------- /Assets/Package/Readme-Resources~/main-toolbar-control-panel-demonstration.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sammmte/unity-toolbar-extender-ui-toolkit/eab014cb30285cce4289da6ac19872c5d46c1489/Assets/Package/Readme-Resources~/main-toolbar-control-panel-demonstration.gif -------------------------------------------------------------------------------- /Assets/Package/Readme-Resources~/other-common-controls.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sammmte/unity-toolbar-extender-ui-toolkit/eab014cb30285cce4289da6ac19872c5d46c1489/Assets/Package/Readme-Resources~/other-common-controls.png -------------------------------------------------------------------------------- /Assets/Package/Readme-Resources~/subgroup-demonstration.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sammmte/unity-toolbar-extender-ui-toolkit/eab014cb30285cce4289da6ac19872c5d46c1489/Assets/Package/Readme-Resources~/subgroup-demonstration.gif -------------------------------------------------------------------------------- /Assets/Package/Readme-Resources~/subwindow-demonstration.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sammmte/unity-toolbar-extender-ui-toolkit/eab014cb30285cce4289da6ac19872c5d46c1489/Assets/Package/Readme-Resources~/subwindow-demonstration.gif -------------------------------------------------------------------------------- /Assets/Package/Readme-Resources~/warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sammmte/unity-toolbar-extender-ui-toolkit/eab014cb30285cce4289da6ac19872c5d46c1489/Assets/Package/Readme-Resources~/warning.png -------------------------------------------------------------------------------- /Assets/Package/Samples~/BasicElements/Paps.UnityToolbarExtenderUIToolkit.Samples.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Paps.UnityToolbarExtenderUIToolkit.Samples", 3 | "rootNamespace": "", 4 | "references": [ 5 | "GUID:8d62da4aabd2a19419c7378d23ea5849" 6 | ], 7 | "includePlatforms": [ 8 | "Editor" 9 | ], 10 | "excludePlatforms": [], 11 | "allowUnsafeCode": false, 12 | "overrideReferences": false, 13 | "precompiledReferences": [], 14 | "autoReferenced": true, 15 | "defineConstraints": [], 16 | "versionDefines": [], 17 | "noEngineReferences": false 18 | } -------------------------------------------------------------------------------- /Assets/Package/Samples~/BasicElements/SampleButton.cs: -------------------------------------------------------------------------------- 1 | using Paps.UnityToolbarExtenderUIToolkit; 2 | using UnityEngine; 3 | using UnityEngine.UIElements; 4 | 5 | [MainToolbarElement(id: "SampleButton", alignment: ToolbarAlign.Left, order: 0)] 6 | public class SampleButton : Button 7 | { 8 | public void InitializeElement() 9 | { 10 | text = "Sample Button"; 11 | tooltip = "This is an example of a toolbar button"; 12 | clicked += () => Debug.Log("A debug log from sample button"); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Assets/Package/Samples~/BasicElements/SampleButtonToggle.cs: -------------------------------------------------------------------------------- 1 | using Paps.UnityToolbarExtenderUIToolkit; 2 | using UnityEditor.Toolbars; 3 | using UnityEngine; 4 | using UnityEngine.UIElements; 5 | 6 | [MainToolbarElement(id: "SampleButtonToggle", alignment: ToolbarAlign.Right, order: 0)] 7 | public class SampleButtonToggle : EditorToolbarToggle 8 | { 9 | public void InitializeElement() 10 | { 11 | text = "Sample Button Toggle"; 12 | tooltip = "This is an example of a toolbar button toggle"; 13 | RegisterCallback>(eventArgs => Debug.Log("Sample button toggle changed its value to " + eventArgs.newValue)); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Assets/Package/Samples~/BasicElements/SampleButtonWithIcon.cs: -------------------------------------------------------------------------------- 1 | using Paps.UnityToolbarExtenderUIToolkit; 2 | using UnityEditor; 3 | using UnityEditor.Toolbars; 4 | using UnityEngine; 5 | 6 | [MainToolbarElement(id: "SampleButtonWithIcon", alignment: ToolbarAlign.Left, order: 2)] 7 | public class SampleButtonWithIcon : EditorToolbarButton 8 | { 9 | public void InitializeElement() 10 | { 11 | icon = (Texture2D)EditorGUIUtility.IconContent("_Popup@2x").image; 12 | tooltip = "This is an example of a toolbar button with an icon"; 13 | clicked += () => Debug.Log("A debug log from sample button with an icon"); 14 | } 15 | } -------------------------------------------------------------------------------- /Assets/Package/Samples~/BasicElements/SampleColorField.cs: -------------------------------------------------------------------------------- 1 | using Paps.UnityToolbarExtenderUIToolkit; 2 | using UnityEditor.UIElements; 3 | 4 | [MainToolbarElement("SampleColorField")] 5 | public class SampleColorField : ColorField 6 | { 7 | public void InitializeElement() 8 | { 9 | label = "Sample Color"; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Assets/Package/Samples~/BasicElements/SampleComplexElement.cs: -------------------------------------------------------------------------------- 1 | using Paps.UnityToolbarExtenderUIToolkit; 2 | using UnityEngine; 3 | using UnityEngine.UIElements; 4 | using System.Collections.Generic; 5 | 6 | // Configured in Sample Group 7 | [MainToolbarElement(id: "SampleComplexElement")] 8 | public class SampleComplexElement : VisualElement 9 | { 10 | public void InitializeElement() 11 | { 12 | style.flexDirection = FlexDirection.Column; 13 | style.flexGrow = 1; 14 | 15 | var someLabel = new Label("This is a complex element"); 16 | Add(someLabel); 17 | 18 | for (int i = 0; i < 5; i++) 19 | { 20 | int elementNumber = i + 1; 21 | var button = new Button(() => Debug.Log("I am button " + elementNumber)); 22 | button.text = "Complex Button " + elementNumber; 23 | Add(button); 24 | } 25 | 26 | for (int i = 0; i < 5; i++) 27 | { 28 | int elementNumber = i + 1; 29 | var slider = new Slider("Complex Slider " + elementNumber, 0, 100); 30 | Add(slider); 31 | } 32 | 33 | for (int i = 0; i < 5; i++) 34 | { 35 | var options = new List() { "Option 1", "Option 2" }; 36 | int elementNumber = i + 1; 37 | var dropdown = new DropdownField("Complex Dropdown " + elementNumber, options, 0); 38 | Add(dropdown); 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /Assets/Package/Samples~/BasicElements/SampleDropdownField.cs: -------------------------------------------------------------------------------- 1 | using Paps.UnityToolbarExtenderUIToolkit; 2 | using System.Collections.Generic; 3 | using UnityEngine.UIElements; 4 | 5 | // Configured in Sample Group 6 | [MainToolbarElement(id: "SampleDropdownField", alignment: ToolbarAlign.Left, order: 1)] 7 | public class SampleDropdownField : DropdownField 8 | { 9 | public void InitializeElement() 10 | { 11 | label = "Sample Dropdown"; 12 | choices = new List() { "Option 1", "Option 2" }; 13 | SetValueWithoutNotify(choices[0]); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Assets/Package/Samples~/BasicElements/SampleEnumField.cs: -------------------------------------------------------------------------------- 1 | using Paps.UnityToolbarExtenderUIToolkit; 2 | using UnityEngine; 3 | using UnityEngine.UIElements; 4 | 5 | [MainToolbarElement("SampleEnumField")] 6 | public class SampleEnumField : EnumField 7 | { 8 | public void InitializeElement() 9 | { 10 | label = "Sample Enum"; 11 | Init(KeyCode.A); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Assets/Package/Samples~/BasicElements/SampleEnumFlagsField.cs: -------------------------------------------------------------------------------- 1 | using Paps.UnityToolbarExtenderUIToolkit; 2 | using System; 3 | using UnityEditor.UIElements; 4 | 5 | [MainToolbarElement("SampleEnumFlagsField")] 6 | public class SampleEnumFlagsField : EnumFlagsField 7 | { 8 | public void InitializeElement() 9 | { 10 | label = "Sample Enum Flags"; 11 | Init(MovementStates.None); 12 | } 13 | } 14 | 15 | [Flags] 16 | public enum MovementStates 17 | { 18 | None = 0, 19 | Idle = 1, 20 | Sitting = 2, 21 | Walking = 4, 22 | Running = 8, 23 | Crouching = 16, 24 | Crawling = 32 25 | } -------------------------------------------------------------------------------- /Assets/Package/Samples~/BasicElements/SampleFloatField.cs: -------------------------------------------------------------------------------- 1 | using Paps.UnityToolbarExtenderUIToolkit; 2 | using UnityEngine.UIElements; 3 | 4 | [MainToolbarElement("SampleFloatField", ToolbarAlign.Right)] 5 | public class SampleFloatField : FloatField 6 | { 7 | public void InitializeElement() 8 | { 9 | label = "Sample Float"; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Assets/Package/Samples~/BasicElements/SampleIMGUIContainer.cs: -------------------------------------------------------------------------------- 1 | using Paps.UnityToolbarExtenderUIToolkit; 2 | using UnityEngine; 3 | using UnityEngine.UIElements; 4 | 5 | [MainToolbarElement(id: "SampleIMGUIContainer", alignment: ToolbarAlign.Right, order: 1)] 6 | public class SampleIMGUIContainer : IMGUIContainer 7 | { 8 | public void InitializeElement() 9 | { 10 | onGUIHandler = MyGUIMethod; 11 | } 12 | 13 | private void MyGUIMethod() 14 | { 15 | GUILayout.BeginHorizontal(); 16 | 17 | if (GUILayout.Button("GUI Button")) 18 | Debug.Log("GUI Button clicked"); 19 | 20 | GUILayout.EndHorizontal(); 21 | } 22 | } -------------------------------------------------------------------------------- /Assets/Package/Samples~/BasicElements/SampleIntegerField.cs: -------------------------------------------------------------------------------- 1 | using Paps.UnityToolbarExtenderUIToolkit; 2 | using UnityEngine.UIElements; 3 | 4 | [MainToolbarElement("SampleIntegerField", ToolbarAlign.Right)] 5 | public class SampleIntegerField : IntegerField 6 | { 7 | public void InitializeElement() 8 | { 9 | label = "Sample Integer"; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Assets/Package/Samples~/BasicElements/SampleLayerField.cs: -------------------------------------------------------------------------------- 1 | using Paps.UnityToolbarExtenderUIToolkit; 2 | using UnityEditor.UIElements; 3 | 4 | [MainToolbarElement("SampleLayerField")] 5 | public class SampleLayerField : LayerField 6 | { 7 | public void InitializeElement() 8 | { 9 | label = "Sample Layer"; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Assets/Package/Samples~/BasicElements/SampleObjectField.cs: -------------------------------------------------------------------------------- 1 | using Paps.UnityToolbarExtenderUIToolkit; 2 | using UnityEditor.UIElements; 3 | 4 | [MainToolbarElement("SampleObjectField")] 5 | public class SampleObjectField : ObjectField 6 | { 7 | public void InitializeElement() 8 | { 9 | label = "Sample Object"; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Assets/Package/Samples~/BasicElements/SampleRootGroup.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: 6df7c06c2de586e41bb0c33bfd80766f, type: 3} 13 | m_Name: SampleRootGroup 14 | m_EditorClassIdentifier: 15 | _groupId: SampleRootGroup 16 | _groupName: Sample Root Group 17 | _alignment: 0 18 | _order: 0 19 | _toolbarElementsIds: 20 | - SampleComplexElement 21 | -------------------------------------------------------------------------------- /Assets/Package/Samples~/BasicElements/SampleSlider.cs: -------------------------------------------------------------------------------- 1 | using Paps.UnityToolbarExtenderUIToolkit; 2 | using UnityEngine; 3 | using UnityEngine.UIElements; 4 | 5 | [MainToolbarElement(id: "SampleSlider")] 6 | public class SampleSlider : Slider 7 | { 8 | public void InitializeElement() 9 | { 10 | label = "Sample Slider"; 11 | lowValue = 0; 12 | highValue = 100; 13 | 14 | RegisterCallback>(eventArgs => Debug.Log("Slider value is: " + eventArgs.newValue)); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Assets/Package/Samples~/BasicElements/SampleTagField.cs: -------------------------------------------------------------------------------- 1 | using Paps.UnityToolbarExtenderUIToolkit; 2 | using UnityEditor.UIElements; 3 | 4 | [MainToolbarElement("SampleTagField")] 5 | public class SampleTagField : TagField 6 | { 7 | public void InitializeElement() 8 | { 9 | label = "Sample Tag"; 10 | } 11 | } -------------------------------------------------------------------------------- /Assets/Package/Samples~/BasicElements/SampleTextField.cs: -------------------------------------------------------------------------------- 1 | using Paps.UnityToolbarExtenderUIToolkit; 2 | using UnityEngine.UIElements; 3 | 4 | [MainToolbarElement("SampleTextField", ToolbarAlign.Right)] 5 | public class SampleTextField : TextField 6 | { 7 | public void InitializeElement() 8 | { 9 | label = "Sample Text"; 10 | } 11 | } -------------------------------------------------------------------------------- /Assets/Package/Samples~/BasicElements/SampleVector2Field.cs: -------------------------------------------------------------------------------- 1 | using Paps.UnityToolbarExtenderUIToolkit; 2 | using UnityEngine.UIElements; 3 | 4 | [MainToolbarElement("SampleVector2Field")] 5 | public class SampleVector2Field : Vector2Field 6 | { 7 | public void InitializeElement() 8 | { 9 | label = "Sample Vector 2"; 10 | } 11 | } -------------------------------------------------------------------------------- /Assets/Package/Samples~/BasicElements/SampleVector3Field.cs: -------------------------------------------------------------------------------- 1 | using Paps.UnityToolbarExtenderUIToolkit; 2 | using UnityEngine.UIElements; 3 | 4 | [MainToolbarElement("SampleVector3Field")] 5 | public class SampleVector3Field : Vector3Field 6 | { 7 | public void InitializeElement() 8 | { 9 | label = "Sample Vector 3"; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Assets/Package/Samples~/BasicElements/Subgroups/ButtonSubgroup.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: 6df7c06c2de586e41bb0c33bfd80766f, type: 3} 13 | m_Name: ButtonSubgroup 14 | m_EditorClassIdentifier: 15 | _groupId: ButtonSubgroup 16 | _groupName: Buttons 17 | _alignment: 0 18 | _order: 0 19 | _toolbarElementsIds: 20 | - ButtonInGroup1 21 | - ButtonInGroup2 22 | - ButtonInGroup3 23 | -------------------------------------------------------------------------------- /Assets/Package/Samples~/BasicElements/Subgroups/ButtonsInGroup.cs: -------------------------------------------------------------------------------- 1 | using Paps.UnityToolbarExtenderUIToolkit; 2 | using UnityEngine.UIElements; 3 | 4 | [MainToolbarElement(nameof(ButtonInGroup1))] 5 | public class ButtonInGroup1 : Button 6 | { 7 | public ButtonInGroup1() 8 | { 9 | text = GetType().Name; 10 | } 11 | } 12 | 13 | [MainToolbarElement(nameof(ButtonInGroup2))] 14 | public class ButtonInGroup2 : Button 15 | { 16 | public ButtonInGroup2() 17 | { 18 | text = GetType().Name; 19 | } 20 | } 21 | 22 | [MainToolbarElement(nameof(ButtonInGroup3))] 23 | public class ButtonInGroup3 : Button 24 | { 25 | public ButtonInGroup3() 26 | { 27 | text = GetType().Name; 28 | } 29 | } -------------------------------------------------------------------------------- /Assets/Package/Samples~/BasicElements/Subgroups/DropdownFieldSubgroup.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: 6df7c06c2de586e41bb0c33bfd80766f, type: 3} 13 | m_Name: DropdownFieldSubgroup 14 | m_EditorClassIdentifier: 15 | _groupId: DropdownFieldSubgroup 16 | _groupName: Dropdowns 17 | _alignment: 0 18 | _order: 0 19 | _toolbarElementsIds: 20 | - DropdownFieldInGroup1 21 | - DropdownFieldInGroup2 22 | - DropdownFieldInGroup3 23 | -------------------------------------------------------------------------------- /Assets/Package/Samples~/BasicElements/Subgroups/DropdownFieldsInGroup.cs: -------------------------------------------------------------------------------- 1 | using Paps.UnityToolbarExtenderUIToolkit; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using UnityEngine; 5 | using UnityEngine.UIElements; 6 | 7 | [MainToolbarElement(nameof(DropdownFieldInGroup1))] 8 | public class DropdownFieldInGroup1 : DropdownField 9 | { 10 | public DropdownFieldInGroup1() : base( 11 | nameof(DropdownFieldInGroup1), 12 | new List() { "Option 1", "Option 2" }, 13 | 0) 14 | { 15 | 16 | } 17 | } 18 | 19 | [MainToolbarElement(nameof(DropdownFieldInGroup2))] 20 | public class DropdownFieldInGroup2 : DropdownField 21 | { 22 | public DropdownFieldInGroup2() : base( 23 | nameof(DropdownFieldInGroup2), 24 | new List() { "Option 1", "Option 2" }, 25 | 0) 26 | { 27 | 28 | } 29 | } 30 | 31 | [MainToolbarElement(nameof(DropdownFieldInGroup3))] 32 | public class DropdownFieldInGroup3 : DropdownField 33 | { 34 | public DropdownFieldInGroup3() : base( 35 | nameof(DropdownFieldInGroup3), 36 | new List() { "Option 1", "Option 2" }, 37 | 0) 38 | { 39 | 40 | } 41 | } -------------------------------------------------------------------------------- /Assets/Package/Samples~/BasicElements/Subgroups/DropdownInGroupWithPopupWindow.cs: -------------------------------------------------------------------------------- 1 | using Paps.UnityToolbarExtenderUIToolkit; 2 | using UnityEditor; 3 | using UnityEditor.Toolbars; 4 | using UnityEngine; 5 | using UnityEngine.UIElements; 6 | 7 | [MainToolbarElement(nameof(DropdownInGroupWithPopupWindow))] 8 | public class DropdownInGroupWithPopupWindow : EditorToolbarDropdown 9 | { 10 | public DropdownInGroupWithPopupWindow() 11 | { 12 | text = nameof(DropdownInGroupWithPopupWindow); 13 | clicked += ShowPopupWindow; 14 | } 15 | 16 | private void ShowPopupWindow() 17 | { 18 | UnityEditor.PopupWindow.Show(worldBound, new PopupWindowContentThatWorksInASubgroup()); 19 | } 20 | } 21 | 22 | [GroupPopupSubWindow] 23 | public class PopupWindowContentThatWorksInASubgroup : PopupWindowContent 24 | { 25 | public override void OnOpen() 26 | { 27 | var debugButton = new Button(() => Debug.Log("What a debug!")); 28 | debugButton.text = "Debug"; 29 | 30 | var closeButton = new Button(() => editorWindow.Close()); 31 | closeButton.text = "Close"; 32 | 33 | editorWindow.rootVisualElement.Add(debugButton); 34 | editorWindow.rootVisualElement.Add(closeButton); 35 | } 36 | 37 | public override void OnGUI(Rect rect) 38 | { 39 | 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Assets/Package/Samples~/BasicElements/Subgroups/DropdownInGroupWithWindow.cs: -------------------------------------------------------------------------------- 1 | using Paps.UnityToolbarExtenderUIToolkit; 2 | using UnityEditor; 3 | using UnityEditor.Toolbars; 4 | using UnityEngine; 5 | using UnityEngine.UIElements; 6 | 7 | [MainToolbarElement(nameof(DropdownInGroupWithWindow))] 8 | public class DropdownInGroupWithWindow : EditorToolbarDropdown 9 | { 10 | public DropdownInGroupWithWindow() 11 | { 12 | text = nameof(DropdownInGroupWithWindow); 13 | clicked += ShowDropdownWindow; 14 | } 15 | 16 | private void ShowDropdownWindow() 17 | { 18 | var newWindowDropdown = ScriptableObject.CreateInstance(); 19 | newWindowDropdown.ShowAsDropdownForMainToolbar(worldBound, new Vector2(200, 200)); 20 | } 21 | } 22 | 23 | [GroupPopupSubWindow] 24 | public class DropdownWindow : EditorWindow 25 | { 26 | private void CreateGUI() 27 | { 28 | var debugButton = new Button(() => Debug.Log("What a debug!")); 29 | debugButton.text = "Debug"; 30 | 31 | var closeButton = new Button(() => Close()); 32 | closeButton.text = "Close"; 33 | 34 | rootVisualElement.Add(debugButton); 35 | rootVisualElement.Add(closeButton); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Assets/Package/Samples~/BasicElements/Subgroups/DropdownWithSubWindowSubgroup.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: 6df7c06c2de586e41bb0c33bfd80766f, type: 3} 13 | m_Name: DropdownWithSubWindowSubgroup 14 | m_EditorClassIdentifier: 15 | _groupId: DropdownWithSubWindowSubgroup 16 | _groupName: Dropdowns With Window 17 | _alignment: 0 18 | _order: 0 19 | _toolbarElementsIds: 20 | - DropdownInGroupWithWindow 21 | - DropdownInGroupWithPopupWindow 22 | -------------------------------------------------------------------------------- /Assets/Package/Samples~/BasicElements/Subgroups/SampleGroupWithSubgroups.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: 6df7c06c2de586e41bb0c33bfd80766f, type: 3} 13 | m_Name: SampleGroupWithSubgroups 14 | m_EditorClassIdentifier: 15 | _groupId: SampleGroupWithSubgroups 16 | _groupName: Group With Subgroups 17 | _alignment: 1 18 | _order: 0 19 | _toolbarElementsIds: 20 | - ButtonSubgroup 21 | - DropdownFieldSubgroup 22 | - DropdownWithSubWindowSubgroup 23 | - SliderSubgroup 24 | -------------------------------------------------------------------------------- /Assets/Package/Samples~/BasicElements/Subgroups/SliderSubgroup.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: 6df7c06c2de586e41bb0c33bfd80766f, type: 3} 13 | m_Name: SliderSubgroup 14 | m_EditorClassIdentifier: 15 | _groupId: SliderSubgroup 16 | _groupName: Sliders 17 | _alignment: 0 18 | _order: 0 19 | _toolbarElementsIds: 20 | - SliderInGroup1 21 | - SliderInGroup2 22 | - SliderInGroup3 23 | -------------------------------------------------------------------------------- /Assets/Package/Samples~/BasicElements/Subgroups/SlidersInGroup.cs: -------------------------------------------------------------------------------- 1 | using Paps.UnityToolbarExtenderUIToolkit; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using UnityEngine; 5 | using UnityEngine.UIElements; 6 | 7 | [MainToolbarElement(nameof(SliderInGroup1))] 8 | public class SliderInGroup1 : Slider 9 | { 10 | public SliderInGroup1() : base(nameof(SliderInGroup1), 0, 100) 11 | { 12 | 13 | } 14 | } 15 | 16 | [MainToolbarElement(nameof(SliderInGroup2))] 17 | public class SliderInGroup2 : Slider 18 | { 19 | public SliderInGroup2() : base(nameof(SliderInGroup2), 0, 100) 20 | { 21 | 22 | } 23 | } 24 | 25 | [MainToolbarElement(nameof(SliderInGroup3))] 26 | public class SliderInGroup3 : Slider 27 | { 28 | public SliderInGroup3() : base(nameof(SliderInGroup3), 0, 100) 29 | { 30 | 31 | } 32 | } -------------------------------------------------------------------------------- /Assets/Package/Samples~/BasicElements/UnityTypeElementsGroup.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: 6df7c06c2de586e41bb0c33bfd80766f, type: 3} 13 | m_Name: UnityTypeElementsGroup 14 | m_EditorClassIdentifier: 15 | _groupId: UnityTypesElementsGroup 16 | _groupName: Elements to work with Unity types 17 | _alignment: 0 18 | _order: 0 19 | _toolbarElementsIds: 20 | - SampleVector2Field 21 | - SampleVector3Field 22 | - SampleColorField 23 | - SampleLayerField 24 | - SampleTagField 25 | - SampleObjectField 26 | -------------------------------------------------------------------------------- /Assets/Package/Samples~/BasicElements/WithSerialization/ElementsWithSerialization.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: 6df7c06c2de586e41bb0c33bfd80766f, type: 3} 13 | m_Name: ElementsWithSerialization 14 | m_EditorClassIdentifier: 15 | _groupId: ElementsWithSerialization 16 | _groupName: Elements With Serialization 17 | _alignment: 1 18 | _order: 0 19 | _toolbarElementsIds: 20 | - SampleToggleWithSerialization 21 | - SampleRigidbodyFieldWithSerialization 22 | - SampleScriptableObjectWithSerialization 23 | -------------------------------------------------------------------------------- /Assets/Package/Samples~/BasicElements/WithSerialization/SampleRigidbodyFieldWithSerialization.cs: -------------------------------------------------------------------------------- 1 | using Paps.UnityToolbarExtenderUIToolkit; 2 | using UnityEditor.UIElements; 3 | using UnityEngine; 4 | using UnityEngine.UIElements; 5 | 6 | // VERY IMPORTANT NOTE: When desired Unity Object type is derived from Component (like Rigidbody or any MonoBehaviour) 7 | // and the ObjectField is inside a group popup window 8 | // you need to use the new Advanced Object Picker tool 9 | // otherwise classic ObjectSelector window won't be able to find Component derived classes serialized in prefabs 10 | // You can enable new Advanced Object Picker at Preferences -> Search -> Search Engines -> Object Selector Dropdown -> Select 'Advanced' 11 | 12 | // You can serialize any Unity Object through ObjectField, even a prefab (GameObject) component, like Rigidbody 13 | // Also any custom Monobehaviour or ScriptableObject 14 | [MainToolbarElement("SampleRigidbodyFieldWithSerialization")] 15 | public class SampleRigidbodyFieldWithSerialization : VisualElement 16 | { 17 | [Serialize] private Rigidbody _rigidbodyValue; 18 | 19 | private ObjectField _rigidbodyField; 20 | private Button _instantiateButton; 21 | 22 | // Don't use constructors, use this method instead. 23 | // Toolbar extender will try to find this method and execute it 24 | public void InitializeElement() 25 | { 26 | _rigidbodyField = new ObjectField("Sample Rigidbody"); 27 | 28 | _rigidbodyField.value = _rigidbodyValue; 29 | 30 | // Specify Unity Object type for the field to get the right component 31 | // Also this helps to filter when using the search tool 32 | _rigidbodyField.objectType = typeof(Rigidbody); 33 | 34 | // Why this method and not simply RegisterCallback like the other examples? 35 | // Because RegisterCallback does not work in this case for some strange reason 36 | // This alternative is practically the same 37 | _rigidbodyField.RegisterValueChangedCallback(ev => 38 | { 39 | // You need to cast newValue to your Unity Object specific type 40 | _rigidbodyValue = (Rigidbody)ev.newValue; 41 | }); 42 | 43 | _instantiateButton = new Button(); 44 | 45 | _instantiateButton.text = "Instantiate"; 46 | 47 | _instantiateButton.clicked += () => 48 | { 49 | if(_rigidbodyValue == null) 50 | { 51 | Debug.Log("Rigidbody value is null and could not be instantiated. Assign a valid value and try again."); 52 | return; 53 | } 54 | 55 | Object.Instantiate(_rigidbodyValue); 56 | }; 57 | 58 | Add(_rigidbodyField); 59 | Add(_instantiateButton); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /Assets/Package/Samples~/BasicElements/WithSerialization/SampleScriptableObject/SampleScriptableObject.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: 21f2d390c5ef6ed46bfee9e5ca989d31, type: 3} 13 | m_Name: SampleScriptableObject 14 | m_EditorClassIdentifier: 15 | SomeInt: 56 16 | SomeString: Some String Here 17 | -------------------------------------------------------------------------------- /Assets/Package/Samples~/BasicElements/WithSerialization/SampleScriptableObject/SampleScriptableObject.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class SampleScriptableObject : ScriptableObject 6 | { 7 | [SerializeField] public int SomeInt; 8 | [SerializeField] public string SomeString; 9 | } 10 | -------------------------------------------------------------------------------- /Assets/Package/Samples~/BasicElements/WithSerialization/SampleScriptableObjectWithSerialization.cs: -------------------------------------------------------------------------------- 1 | using Paps.UnityToolbarExtenderUIToolkit; 2 | using UnityEditor.UIElements; 3 | using UnityEngine.UIElements; 4 | 5 | [MainToolbarElement("SampleScriptableObjectWithSerialization")] 6 | public class SampleScriptableObjectWithSerialization : ObjectField 7 | { 8 | [Serialize] private SampleScriptableObject _scriptableObjectValue; 9 | 10 | // Don't use constructors, use this method instead. 11 | // Toolbar extender will try to find this method and execute it 12 | public void InitializeElement() 13 | { 14 | value = _scriptableObjectValue; 15 | label = "Sample ScriptableObject"; 16 | 17 | objectType = typeof(SampleScriptableObject); 18 | 19 | this.RegisterValueChangedCallback(ev => 20 | { 21 | _scriptableObjectValue = (SampleScriptableObject)ev.newValue; 22 | }); 23 | } 24 | } -------------------------------------------------------------------------------- /Assets/Package/Samples~/BasicElements/WithSerialization/SampleToggleWithSerialization.cs: -------------------------------------------------------------------------------- 1 | using Paps.UnityToolbarExtenderUIToolkit; 2 | using UnityEngine.UIElements; 3 | 4 | [MainToolbarElement("SampleToggleWithSerialization")] 5 | public class SampleToggleWithSerialization : Toggle 6 | { 7 | [Serialize] private bool _toggleValue; 8 | 9 | // Don't use constructors, use this method instead. 10 | // Toolbar extender will try to find this method and execute it 11 | public void InitializeElement() 12 | { 13 | label = "Toggle With Serialization"; 14 | value = _toggleValue; 15 | 16 | RegisterCallback>(ev => _toggleValue = ev.newValue); 17 | } 18 | } -------------------------------------------------------------------------------- /Assets/Package/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "com.paps.unity-toolbar-extender-ui-toolkit", 3 | "displayName": "Unity Toolbar Extender UI Toolkit", 4 | "version": "2.0.0", 5 | "unity": "2022.3", 6 | "description": "Unity Toolbar Extender UI Toolkit provides a simple way to customize Unity's main toolbar (where play buttons are) with UI Toolkit.", 7 | "keywords": [ 8 | "unity", 9 | "unity3d", 10 | "upm", 11 | "paps", 12 | "utility", 13 | "ui", 14 | "toolkit", 15 | "ui-toolkit", 16 | "toolbar" 17 | ], 18 | "homepage": "https://github.com/Sammmte/unity-toolbar-extender-ui-toolkit", 19 | "author": { 20 | "name": "SAMMMTE", 21 | "email": "santiagoperez.-@hotmail.com" 22 | }, 23 | "dependencies": { 24 | "com.unity.serialization": "3.1.2" 25 | }, 26 | "files":[ 27 | "CHANGELOG.md", 28 | "CHANGELOG.md.meta", 29 | "package.json.meta", 30 | "README.md.meta", 31 | "LICENSE.md.meta", 32 | "Editor", 33 | "Editor.meta", 34 | "Documentation~", 35 | "Samples~" 36 | ], 37 | "samples": [ 38 | { 39 | "displayName": "Basic elements", 40 | "description": "Contains the most basic elements you can add to the toolbar", 41 | "path": "Samples~/BasicElements" 42 | } 43 | ], 44 | "documentationUrl": "https://github.com/Sammmte/unity-toolbar-extender-ui-toolkit" 45 | } 46 | -------------------------------------------------------------------------------- /Assets/Package/package.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f38754497197c584ebcbe7d596c200e5 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/ProjectTools.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9c5735837cbe3af46886004cff0d20c2 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/ProjectTools/MenuItemsTools.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using UnityEditor; 3 | using UnityEngine; 4 | 5 | public class MenuItemsTools 6 | { 7 | private const string DISTRIBUTED_SAMPLES_DIRECTORY = "Assets/Package/Samples~"; 8 | private const string PROJECT_SAMPLES_DIRECTORY = "Assets/Samples"; 9 | private const string DISTRIBUTED_README_PATH = "Assets/Package/README.md"; 10 | private const string README_RESOURCES_PATH_FROM_PACKAGE = "Readme-Resources~"; 11 | private const string README_RESOURCES_PATH_FROM_ROOT = "Assets/Package/Readme-Resources~"; 12 | 13 | [MenuItem("Paps/Unity Toolbar Extender UI Toolkit/Update Samples And Readme", priority = 1)] 14 | public static void UpdateSamplesAndReadme() 15 | { 16 | DeletePreviousSamples(); 17 | CopyFilesRecursively(PROJECT_SAMPLES_DIRECTORY, DISTRIBUTED_SAMPLES_DIRECTORY); 18 | SyncPackageReadmeWithRoot(); 19 | } 20 | 21 | private static void DeletePreviousSamples() 22 | { 23 | var previousFiles = Directory.GetFiles(DISTRIBUTED_SAMPLES_DIRECTORY); 24 | var previousDirectories = Directory.GetDirectories(DISTRIBUTED_SAMPLES_DIRECTORY); 25 | 26 | foreach (var file in previousFiles) 27 | File.Delete(file); 28 | 29 | foreach (var directory in previousDirectories) 30 | Directory.Delete(directory, true); 31 | } 32 | 33 | private static void CopyFilesRecursively(string sourcePath, string targetPath) 34 | { 35 | foreach (string dirPath in Directory.GetDirectories(sourcePath, "*", SearchOption.AllDirectories)) 36 | { 37 | Directory.CreateDirectory(dirPath.Replace(sourcePath, targetPath)); 38 | } 39 | 40 | foreach (string filePath in Directory.GetFiles(sourcePath, "*.*", SearchOption.AllDirectories)) 41 | { 42 | if (filePath.EndsWith(".meta")) 43 | continue; 44 | 45 | File.Copy(filePath, filePath.Replace(sourcePath, targetPath), true); 46 | } 47 | } 48 | 49 | private static void SyncPackageReadmeWithRoot() 50 | { 51 | var markdownText = File.ReadAllText(DISTRIBUTED_README_PATH); 52 | 53 | markdownText = markdownText.Replace(README_RESOURCES_PATH_FROM_PACKAGE, 54 | README_RESOURCES_PATH_FROM_ROOT); 55 | 56 | var rootPath = Application.dataPath.Replace("/Assets", ""); 57 | var rootReadmePath = Path.Combine(rootPath, "README.md"); 58 | 59 | File.WriteAllText(rootReadmePath, markdownText); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /Assets/ProjectTools/MenuItemsTools.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5c7156c1d92f9b94881fac3fe099d239 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Samples.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 85bc4cbdb33b7254eba3158b8c09b95b 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6d1d77d45a7523c498d0d02d41063d2e 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/Paps.UnityToolbarExtenderUIToolkit.Samples.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Paps.UnityToolbarExtenderUIToolkit.Samples", 3 | "rootNamespace": "", 4 | "references": [ 5 | "GUID:8d62da4aabd2a19419c7378d23ea5849" 6 | ], 7 | "includePlatforms": [ 8 | "Editor" 9 | ], 10 | "excludePlatforms": [], 11 | "allowUnsafeCode": false, 12 | "overrideReferences": false, 13 | "precompiledReferences": [], 14 | "autoReferenced": true, 15 | "defineConstraints": [], 16 | "versionDefines": [], 17 | "noEngineReferences": false 18 | } -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/Paps.UnityToolbarExtenderUIToolkit.Samples.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1f801f5b66e0c754891db054cf8906e7 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/SampleButton.cs: -------------------------------------------------------------------------------- 1 | using Paps.UnityToolbarExtenderUIToolkit; 2 | using UnityEngine; 3 | using UnityEngine.UIElements; 4 | 5 | [MainToolbarElement(id: "SampleButton", alignment: ToolbarAlign.Left, order: 0)] 6 | public class SampleButton : Button 7 | { 8 | public void InitializeElement() 9 | { 10 | text = "Sample Button"; 11 | tooltip = "This is an example of a toolbar button"; 12 | clicked += () => Debug.Log("A debug log from sample button"); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/SampleButton.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 49979143e10671c479fd640196e85a0d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/SampleButtonToggle.cs: -------------------------------------------------------------------------------- 1 | using Paps.UnityToolbarExtenderUIToolkit; 2 | using UnityEditor.Toolbars; 3 | using UnityEngine; 4 | using UnityEngine.UIElements; 5 | 6 | [MainToolbarElement(id: "SampleButtonToggle", alignment: ToolbarAlign.Right, order: 0)] 7 | public class SampleButtonToggle : EditorToolbarToggle 8 | { 9 | public void InitializeElement() 10 | { 11 | text = "Sample Button Toggle"; 12 | tooltip = "This is an example of a toolbar button toggle"; 13 | RegisterCallback>(eventArgs => Debug.Log("Sample button toggle changed its value to " + eventArgs.newValue)); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/SampleButtonToggle.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 503abbcbde16c614c9947725eb2cd41e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/SampleButtonWithIcon.cs: -------------------------------------------------------------------------------- 1 | using Paps.UnityToolbarExtenderUIToolkit; 2 | using UnityEditor; 3 | using UnityEditor.Toolbars; 4 | using UnityEngine; 5 | 6 | [MainToolbarElement(id: "SampleButtonWithIcon", alignment: ToolbarAlign.Left, order: 2)] 7 | public class SampleButtonWithIcon : EditorToolbarButton 8 | { 9 | public void InitializeElement() 10 | { 11 | icon = (Texture2D)EditorGUIUtility.IconContent("_Popup@2x").image; 12 | tooltip = "This is an example of a toolbar button with an icon"; 13 | clicked += () => Debug.Log("A debug log from sample button with an icon"); 14 | } 15 | } -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/SampleButtonWithIcon.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 25df5ecd90db3c247b23ac0028200f1d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/SampleColorField.cs: -------------------------------------------------------------------------------- 1 | using Paps.UnityToolbarExtenderUIToolkit; 2 | using UnityEditor.UIElements; 3 | 4 | [MainToolbarElement("SampleColorField")] 5 | public class SampleColorField : ColorField 6 | { 7 | public void InitializeElement() 8 | { 9 | label = "Sample Color"; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/SampleColorField.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3618d0bbe79cb1347bd8635d546ad70a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/SampleComplexElement.cs: -------------------------------------------------------------------------------- 1 | using Paps.UnityToolbarExtenderUIToolkit; 2 | using UnityEngine; 3 | using UnityEngine.UIElements; 4 | using System.Collections.Generic; 5 | 6 | // Configured in Sample Group 7 | [MainToolbarElement(id: "SampleComplexElement")] 8 | public class SampleComplexElement : VisualElement 9 | { 10 | public void InitializeElement() 11 | { 12 | style.flexDirection = FlexDirection.Column; 13 | style.flexGrow = 1; 14 | 15 | var someLabel = new Label("This is a complex element"); 16 | Add(someLabel); 17 | 18 | for (int i = 0; i < 5; i++) 19 | { 20 | int elementNumber = i + 1; 21 | var button = new Button(() => Debug.Log("I am button " + elementNumber)); 22 | button.text = "Complex Button " + elementNumber; 23 | Add(button); 24 | } 25 | 26 | for (int i = 0; i < 5; i++) 27 | { 28 | int elementNumber = i + 1; 29 | var slider = new Slider("Complex Slider " + elementNumber, 0, 100); 30 | Add(slider); 31 | } 32 | 33 | for (int i = 0; i < 5; i++) 34 | { 35 | var options = new List() { "Option 1", "Option 2" }; 36 | int elementNumber = i + 1; 37 | var dropdown = new DropdownField("Complex Dropdown " + elementNumber, options, 0); 38 | Add(dropdown); 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/SampleComplexElement.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 56bfdcc19f26f8c4495e0875aff4754a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/SampleDropdownField.cs: -------------------------------------------------------------------------------- 1 | using Paps.UnityToolbarExtenderUIToolkit; 2 | using System.Collections.Generic; 3 | using UnityEngine.UIElements; 4 | 5 | // Configured in Sample Group 6 | [MainToolbarElement(id: "SampleDropdownField", alignment: ToolbarAlign.Left, order: 1)] 7 | public class SampleDropdownField : DropdownField 8 | { 9 | public void InitializeElement() 10 | { 11 | label = "Sample Dropdown"; 12 | choices = new List() { "Option 1", "Option 2" }; 13 | SetValueWithoutNotify(choices[0]); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/SampleDropdownField.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6f13d38f24cdefd4a813d6c0df9e34ec 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/SampleEnumField.cs: -------------------------------------------------------------------------------- 1 | using Paps.UnityToolbarExtenderUIToolkit; 2 | using UnityEngine; 3 | using UnityEngine.UIElements; 4 | 5 | [MainToolbarElement("SampleEnumField")] 6 | public class SampleEnumField : EnumField 7 | { 8 | public void InitializeElement() 9 | { 10 | label = "Sample Enum"; 11 | Init(KeyCode.A); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/SampleEnumField.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8e8bb54237d50e84dbad5d9450bc7717 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/SampleEnumFlagsField.cs: -------------------------------------------------------------------------------- 1 | using Paps.UnityToolbarExtenderUIToolkit; 2 | using System; 3 | using UnityEditor.UIElements; 4 | 5 | [MainToolbarElement("SampleEnumFlagsField")] 6 | public class SampleEnumFlagsField : EnumFlagsField 7 | { 8 | public void InitializeElement() 9 | { 10 | label = "Sample Enum Flags"; 11 | Init(MovementStates.None); 12 | } 13 | } 14 | 15 | [Flags] 16 | public enum MovementStates 17 | { 18 | None = 0, 19 | Idle = 1, 20 | Sitting = 2, 21 | Walking = 4, 22 | Running = 8, 23 | Crouching = 16, 24 | Crawling = 32 25 | } -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/SampleEnumFlagsField.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b4b68bdf70b9e6d4f95612c7e9fe8764 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/SampleFloatField.cs: -------------------------------------------------------------------------------- 1 | using Paps.UnityToolbarExtenderUIToolkit; 2 | using UnityEngine.UIElements; 3 | 4 | [MainToolbarElement("SampleFloatField", ToolbarAlign.Right)] 5 | public class SampleFloatField : FloatField 6 | { 7 | public void InitializeElement() 8 | { 9 | label = "Sample Float"; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/SampleFloatField.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ac574e2554598d140b826f89452a90ba 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/SampleIMGUIContainer.cs: -------------------------------------------------------------------------------- 1 | using Paps.UnityToolbarExtenderUIToolkit; 2 | using UnityEngine; 3 | using UnityEngine.UIElements; 4 | 5 | [MainToolbarElement(id: "SampleIMGUIContainer", alignment: ToolbarAlign.Right, order: 1)] 6 | public class SampleIMGUIContainer : IMGUIContainer 7 | { 8 | public void InitializeElement() 9 | { 10 | onGUIHandler = MyGUIMethod; 11 | } 12 | 13 | private void MyGUIMethod() 14 | { 15 | GUILayout.BeginHorizontal(); 16 | 17 | if (GUILayout.Button("GUI Button")) 18 | Debug.Log("GUI Button clicked"); 19 | 20 | GUILayout.EndHorizontal(); 21 | } 22 | } -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/SampleIMGUIContainer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: aa392bee3a28fc145bb82e9d8e3bd9c1 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/SampleIntegerField.cs: -------------------------------------------------------------------------------- 1 | using Paps.UnityToolbarExtenderUIToolkit; 2 | using UnityEngine.UIElements; 3 | 4 | [MainToolbarElement("SampleIntegerField", ToolbarAlign.Right)] 5 | public class SampleIntegerField : IntegerField 6 | { 7 | public void InitializeElement() 8 | { 9 | label = "Sample Integer"; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/SampleIntegerField.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6e5e4d836c1c35449acfc92f272300ab 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/SampleLayerField.cs: -------------------------------------------------------------------------------- 1 | using Paps.UnityToolbarExtenderUIToolkit; 2 | using UnityEditor.UIElements; 3 | 4 | [MainToolbarElement("SampleLayerField")] 5 | public class SampleLayerField : LayerField 6 | { 7 | public void InitializeElement() 8 | { 9 | label = "Sample Layer"; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/SampleLayerField.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2021d8a6184c3e44294e4cc1a4842ca0 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/SampleObjectField.cs: -------------------------------------------------------------------------------- 1 | using Paps.UnityToolbarExtenderUIToolkit; 2 | using UnityEditor.UIElements; 3 | 4 | [MainToolbarElement("SampleObjectField")] 5 | public class SampleObjectField : ObjectField 6 | { 7 | public void InitializeElement() 8 | { 9 | label = "Sample Object"; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/SampleObjectField.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 63e10654186e7144b9c0f8d0752b5bf0 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/SampleRootGroup.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: 6df7c06c2de586e41bb0c33bfd80766f, type: 3} 13 | m_Name: SampleRootGroup 14 | m_EditorClassIdentifier: 15 | _groupId: SampleRootGroup 16 | _groupName: Sample Root Group 17 | _alignment: 0 18 | _order: 0 19 | _toolbarElementsIds: 20 | - SampleComplexElement 21 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/SampleRootGroup.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2c99d7c1f57ad944f80b5260a273a67e 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/SampleSlider.cs: -------------------------------------------------------------------------------- 1 | using Paps.UnityToolbarExtenderUIToolkit; 2 | using UnityEngine; 3 | using UnityEngine.UIElements; 4 | 5 | [MainToolbarElement(id: "SampleSlider")] 6 | public class SampleSlider : Slider 7 | { 8 | public void InitializeElement() 9 | { 10 | label = "Sample Slider"; 11 | lowValue = 0; 12 | highValue = 100; 13 | 14 | RegisterCallback>(eventArgs => Debug.Log("Slider value is: " + eventArgs.newValue)); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/SampleSlider.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ba6d94de642a42e49a24fe252e395679 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/SampleTagField.cs: -------------------------------------------------------------------------------- 1 | using Paps.UnityToolbarExtenderUIToolkit; 2 | using UnityEditor.UIElements; 3 | 4 | [MainToolbarElement("SampleTagField")] 5 | public class SampleTagField : TagField 6 | { 7 | public void InitializeElement() 8 | { 9 | label = "Sample Tag"; 10 | } 11 | } -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/SampleTagField.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 992f0a5a637d70a4488ee233d0a188b0 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/SampleTextField.cs: -------------------------------------------------------------------------------- 1 | using Paps.UnityToolbarExtenderUIToolkit; 2 | using UnityEngine.UIElements; 3 | 4 | [MainToolbarElement("SampleTextField", ToolbarAlign.Right)] 5 | public class SampleTextField : TextField 6 | { 7 | public void InitializeElement() 8 | { 9 | label = "Sample Text"; 10 | } 11 | } -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/SampleTextField.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: feed54075d2331f4091b88480eeabfc0 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/SampleVector2Field.cs: -------------------------------------------------------------------------------- 1 | using Paps.UnityToolbarExtenderUIToolkit; 2 | using UnityEngine.UIElements; 3 | 4 | [MainToolbarElement("SampleVector2Field")] 5 | public class SampleVector2Field : Vector2Field 6 | { 7 | public void InitializeElement() 8 | { 9 | label = "Sample Vector 2"; 10 | } 11 | } -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/SampleVector2Field.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7ea5c0832723e944c9af541d0c3c4177 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/SampleVector3Field.cs: -------------------------------------------------------------------------------- 1 | using Paps.UnityToolbarExtenderUIToolkit; 2 | using UnityEngine.UIElements; 3 | 4 | [MainToolbarElement("SampleVector3Field")] 5 | public class SampleVector3Field : Vector3Field 6 | { 7 | public void InitializeElement() 8 | { 9 | label = "Sample Vector 3"; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/SampleVector3Field.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b782100c63a914844b7f25448de228dd 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/Subgroups.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dff9f5883fd44884fb40940fea69d008 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/Subgroups/ButtonSubgroup.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: 6df7c06c2de586e41bb0c33bfd80766f, type: 3} 13 | m_Name: ButtonSubgroup 14 | m_EditorClassIdentifier: 15 | _groupId: ButtonSubgroup 16 | _groupName: Buttons 17 | _alignment: 0 18 | _order: 0 19 | _toolbarElementsIds: 20 | - ButtonInGroup1 21 | - ButtonInGroup2 22 | - ButtonInGroup3 23 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/Subgroups/ButtonSubgroup.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cb41f5da7e9e228488a005cbfc81f3c1 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/Subgroups/ButtonsInGroup.cs: -------------------------------------------------------------------------------- 1 | using Paps.UnityToolbarExtenderUIToolkit; 2 | using UnityEngine.UIElements; 3 | 4 | [MainToolbarElement(nameof(ButtonInGroup1))] 5 | public class ButtonInGroup1 : Button 6 | { 7 | public ButtonInGroup1() 8 | { 9 | text = GetType().Name; 10 | } 11 | } 12 | 13 | [MainToolbarElement(nameof(ButtonInGroup2))] 14 | public class ButtonInGroup2 : Button 15 | { 16 | public ButtonInGroup2() 17 | { 18 | text = GetType().Name; 19 | } 20 | } 21 | 22 | [MainToolbarElement(nameof(ButtonInGroup3))] 23 | public class ButtonInGroup3 : Button 24 | { 25 | public ButtonInGroup3() 26 | { 27 | text = GetType().Name; 28 | } 29 | } -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/Subgroups/ButtonsInGroup.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ae343035aad21344abd5f1da1e23744c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/Subgroups/DropdownFieldSubgroup.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: 6df7c06c2de586e41bb0c33bfd80766f, type: 3} 13 | m_Name: DropdownFieldSubgroup 14 | m_EditorClassIdentifier: 15 | _groupId: DropdownFieldSubgroup 16 | _groupName: Dropdowns 17 | _alignment: 0 18 | _order: 0 19 | _toolbarElementsIds: 20 | - DropdownFieldInGroup1 21 | - DropdownFieldInGroup2 22 | - DropdownFieldInGroup3 23 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/Subgroups/DropdownFieldSubgroup.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ba39d33df5076ee48bd0e47142b91aee 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/Subgroups/DropdownFieldsInGroup.cs: -------------------------------------------------------------------------------- 1 | using Paps.UnityToolbarExtenderUIToolkit; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using UnityEngine; 5 | using UnityEngine.UIElements; 6 | 7 | [MainToolbarElement(nameof(DropdownFieldInGroup1))] 8 | public class DropdownFieldInGroup1 : DropdownField 9 | { 10 | public DropdownFieldInGroup1() : base( 11 | nameof(DropdownFieldInGroup1), 12 | new List() { "Option 1", "Option 2" }, 13 | 0) 14 | { 15 | 16 | } 17 | } 18 | 19 | [MainToolbarElement(nameof(DropdownFieldInGroup2))] 20 | public class DropdownFieldInGroup2 : DropdownField 21 | { 22 | public DropdownFieldInGroup2() : base( 23 | nameof(DropdownFieldInGroup2), 24 | new List() { "Option 1", "Option 2" }, 25 | 0) 26 | { 27 | 28 | } 29 | } 30 | 31 | [MainToolbarElement(nameof(DropdownFieldInGroup3))] 32 | public class DropdownFieldInGroup3 : DropdownField 33 | { 34 | public DropdownFieldInGroup3() : base( 35 | nameof(DropdownFieldInGroup3), 36 | new List() { "Option 1", "Option 2" }, 37 | 0) 38 | { 39 | 40 | } 41 | } -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/Subgroups/DropdownFieldsInGroup.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d2c4e4ed83dd7b34a8fbf19fb62d061a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/Subgroups/DropdownInGroupWithPopupWindow.cs: -------------------------------------------------------------------------------- 1 | using Paps.UnityToolbarExtenderUIToolkit; 2 | using UnityEditor; 3 | using UnityEditor.Toolbars; 4 | using UnityEngine; 5 | using UnityEngine.UIElements; 6 | 7 | [MainToolbarElement(nameof(DropdownInGroupWithPopupWindow))] 8 | public class DropdownInGroupWithPopupWindow : EditorToolbarDropdown 9 | { 10 | public DropdownInGroupWithPopupWindow() 11 | { 12 | text = nameof(DropdownInGroupWithPopupWindow); 13 | clicked += ShowPopupWindow; 14 | } 15 | 16 | private void ShowPopupWindow() 17 | { 18 | UnityEditor.PopupWindow.Show(worldBound, new PopupWindowContentThatWorksInASubgroup()); 19 | } 20 | } 21 | 22 | [GroupPopupSubWindow] 23 | public class PopupWindowContentThatWorksInASubgroup : PopupWindowContent 24 | { 25 | public override void OnOpen() 26 | { 27 | var debugButton = new Button(() => Debug.Log("What a debug!")); 28 | debugButton.text = "Debug"; 29 | 30 | var closeButton = new Button(() => editorWindow.Close()); 31 | closeButton.text = "Close"; 32 | 33 | editorWindow.rootVisualElement.Add(debugButton); 34 | editorWindow.rootVisualElement.Add(closeButton); 35 | } 36 | 37 | public override void OnGUI(Rect rect) 38 | { 39 | 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/Subgroups/DropdownInGroupWithPopupWindow.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a5019b6d4e1989e4d83d4bdd904dca24 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/Subgroups/DropdownInGroupWithWindow.cs: -------------------------------------------------------------------------------- 1 | using Paps.UnityToolbarExtenderUIToolkit; 2 | using UnityEditor; 3 | using UnityEditor.Toolbars; 4 | using UnityEngine; 5 | using UnityEngine.UIElements; 6 | 7 | [MainToolbarElement(nameof(DropdownInGroupWithWindow))] 8 | public class DropdownInGroupWithWindow : EditorToolbarDropdown 9 | { 10 | public DropdownInGroupWithWindow() 11 | { 12 | text = nameof(DropdownInGroupWithWindow); 13 | clicked += ShowDropdownWindow; 14 | } 15 | 16 | private void ShowDropdownWindow() 17 | { 18 | var newWindowDropdown = ScriptableObject.CreateInstance(); 19 | newWindowDropdown.ShowAsDropdownForMainToolbar(worldBound, new Vector2(200, 200)); 20 | } 21 | } 22 | 23 | [GroupPopupSubWindow] 24 | public class DropdownWindow : EditorWindow 25 | { 26 | private void CreateGUI() 27 | { 28 | var debugButton = new Button(() => Debug.Log("What a debug!")); 29 | debugButton.text = "Debug"; 30 | 31 | var closeButton = new Button(() => Close()); 32 | closeButton.text = "Close"; 33 | 34 | rootVisualElement.Add(debugButton); 35 | rootVisualElement.Add(closeButton); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/Subgroups/DropdownInGroupWithWindow.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c55bc54cb2a6de74b845d1a3a028bb9a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/Subgroups/DropdownWithSubWindowSubgroup.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: 6df7c06c2de586e41bb0c33bfd80766f, type: 3} 13 | m_Name: DropdownWithSubWindowSubgroup 14 | m_EditorClassIdentifier: 15 | _groupId: DropdownWithSubWindowSubgroup 16 | _groupName: Dropdowns With Window 17 | _alignment: 0 18 | _order: 0 19 | _toolbarElementsIds: 20 | - DropdownInGroupWithWindow 21 | - DropdownInGroupWithPopupWindow 22 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/Subgroups/DropdownWithSubWindowSubgroup.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 127441037abbc8147a8ad3126b6d6809 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/Subgroups/SampleGroupWithSubgroups.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: 6df7c06c2de586e41bb0c33bfd80766f, type: 3} 13 | m_Name: SampleGroupWithSubgroups 14 | m_EditorClassIdentifier: 15 | _groupId: SampleGroupWithSubgroups 16 | _groupName: Group With Subgroups 17 | _alignment: 1 18 | _order: 0 19 | _toolbarElementsIds: 20 | - ButtonSubgroup 21 | - DropdownFieldSubgroup 22 | - DropdownWithSubWindowSubgroup 23 | - SliderSubgroup 24 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/Subgroups/SampleGroupWithSubgroups.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8a67095b3e0b20e4db957224505686c8 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/Subgroups/SliderSubgroup.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: 6df7c06c2de586e41bb0c33bfd80766f, type: 3} 13 | m_Name: SliderSubgroup 14 | m_EditorClassIdentifier: 15 | _groupId: SliderSubgroup 16 | _groupName: Sliders 17 | _alignment: 0 18 | _order: 0 19 | _toolbarElementsIds: 20 | - SliderInGroup1 21 | - SliderInGroup2 22 | - SliderInGroup3 23 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/Subgroups/SliderSubgroup.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9319677d3dbce024891fe25b6b87b506 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/Subgroups/SlidersInGroup.cs: -------------------------------------------------------------------------------- 1 | using Paps.UnityToolbarExtenderUIToolkit; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using UnityEngine; 5 | using UnityEngine.UIElements; 6 | 7 | [MainToolbarElement(nameof(SliderInGroup1))] 8 | public class SliderInGroup1 : Slider 9 | { 10 | public SliderInGroup1() : base(nameof(SliderInGroup1), 0, 100) 11 | { 12 | 13 | } 14 | } 15 | 16 | [MainToolbarElement(nameof(SliderInGroup2))] 17 | public class SliderInGroup2 : Slider 18 | { 19 | public SliderInGroup2() : base(nameof(SliderInGroup2), 0, 100) 20 | { 21 | 22 | } 23 | } 24 | 25 | [MainToolbarElement(nameof(SliderInGroup3))] 26 | public class SliderInGroup3 : Slider 27 | { 28 | public SliderInGroup3() : base(nameof(SliderInGroup3), 0, 100) 29 | { 30 | 31 | } 32 | } -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/Subgroups/SlidersInGroup.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: db2145b4c0b7f0d4a8ebe3ea885440f4 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/UnityTypeElementsGroup.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: 6df7c06c2de586e41bb0c33bfd80766f, type: 3} 13 | m_Name: UnityTypeElementsGroup 14 | m_EditorClassIdentifier: 15 | _groupId: UnityTypesElementsGroup 16 | _groupName: Elements to work with Unity types 17 | _alignment: 0 18 | _order: 0 19 | _toolbarElementsIds: 20 | - SampleVector2Field 21 | - SampleVector3Field 22 | - SampleColorField 23 | - SampleLayerField 24 | - SampleTagField 25 | - SampleObjectField 26 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/UnityTypeElementsGroup.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4edd9dc01d245c142901d11806ce4c77 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/WithSerialization.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bf8b7055f44e3b84e97f56c8d4812ee9 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/WithSerialization/ElementsWithSerialization.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: 6df7c06c2de586e41bb0c33bfd80766f, type: 3} 13 | m_Name: ElementsWithSerialization 14 | m_EditorClassIdentifier: 15 | _groupId: ElementsWithSerialization 16 | _groupName: Elements With Serialization 17 | _alignment: 1 18 | _order: 0 19 | _toolbarElementsIds: 20 | - SampleToggleWithSerialization 21 | - SampleRigidbodyFieldWithSerialization 22 | - SampleScriptableObjectWithSerialization 23 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/WithSerialization/ElementsWithSerialization.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 02daaf28c2f37f549ae61675b7dd7faf 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/WithSerialization/SamplePrefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9c172263637586c44839d28a41af3f0d 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/WithSerialization/SamplePrefab/SamplePrefab.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3e527a9e634f0a34d9a21647ff24c9b2 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/WithSerialization/SampleRigidbodyFieldWithSerialization.cs: -------------------------------------------------------------------------------- 1 | using Paps.UnityToolbarExtenderUIToolkit; 2 | using UnityEditor.UIElements; 3 | using UnityEngine; 4 | using UnityEngine.UIElements; 5 | 6 | // VERY IMPORTANT NOTE: When desired Unity Object type is derived from Component (like Rigidbody or any MonoBehaviour) 7 | // and the ObjectField is inside a group popup window 8 | // you need to use the new Advanced Object Picker tool 9 | // otherwise classic ObjectSelector window won't be able to find Component derived classes serialized in prefabs 10 | // You can enable new Advanced Object Picker at Preferences -> Search -> Search Engines -> Object Selector Dropdown -> Select 'Advanced' 11 | 12 | // You can serialize any Unity Object through ObjectField, even a prefab (GameObject) component, like Rigidbody 13 | // Also any custom Monobehaviour or ScriptableObject 14 | [MainToolbarElement("SampleRigidbodyFieldWithSerialization")] 15 | public class SampleRigidbodyFieldWithSerialization : VisualElement 16 | { 17 | [Serialize] private Rigidbody _rigidbodyValue; 18 | 19 | private ObjectField _rigidbodyField; 20 | private Button _instantiateButton; 21 | 22 | // Don't use constructors, use this method instead. 23 | // Toolbar extender will try to find this method and execute it 24 | public void InitializeElement() 25 | { 26 | _rigidbodyField = new ObjectField("Sample Rigidbody"); 27 | 28 | _rigidbodyField.value = _rigidbodyValue; 29 | 30 | // Specify Unity Object type for the field to get the right component 31 | // Also this helps to filter when using the search tool 32 | _rigidbodyField.objectType = typeof(Rigidbody); 33 | 34 | // Why this method and not simply RegisterCallback like the other examples? 35 | // Because RegisterCallback does not work in this case for some strange reason 36 | // This alternative is practically the same 37 | _rigidbodyField.RegisterValueChangedCallback(ev => 38 | { 39 | // You need to cast newValue to your Unity Object specific type 40 | _rigidbodyValue = (Rigidbody)ev.newValue; 41 | }); 42 | 43 | _instantiateButton = new Button(); 44 | 45 | _instantiateButton.text = "Instantiate"; 46 | 47 | _instantiateButton.clicked += () => 48 | { 49 | if(_rigidbodyValue == null) 50 | { 51 | Debug.Log("Rigidbody value is null and could not be instantiated. Assign a valid value and try again."); 52 | return; 53 | } 54 | 55 | Object.Instantiate(_rigidbodyValue); 56 | }; 57 | 58 | Add(_rigidbodyField); 59 | Add(_instantiateButton); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/WithSerialization/SampleRigidbodyFieldWithSerialization.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: eef474f7b3bf47d45a99556025d493d7 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/WithSerialization/SampleScriptableObject.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5395dcd267be9b14980eb488c7779cdf 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/WithSerialization/SampleScriptableObject/SampleScriptableObject.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: 21f2d390c5ef6ed46bfee9e5ca989d31, type: 3} 13 | m_Name: SampleScriptableObject 14 | m_EditorClassIdentifier: 15 | SomeInt: 56 16 | SomeString: Some String Here 17 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/WithSerialization/SampleScriptableObject/SampleScriptableObject.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 63669904d2f3f5646a1ad8e46a5ccc01 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/WithSerialization/SampleScriptableObject/SampleScriptableObject.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class SampleScriptableObject : ScriptableObject 6 | { 7 | [SerializeField] public int SomeInt; 8 | [SerializeField] public string SomeString; 9 | } 10 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/WithSerialization/SampleScriptableObject/SampleScriptableObject.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 21f2d390c5ef6ed46bfee9e5ca989d31 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/WithSerialization/SampleScriptableObjectWithSerialization.cs: -------------------------------------------------------------------------------- 1 | using Paps.UnityToolbarExtenderUIToolkit; 2 | using UnityEditor.UIElements; 3 | using UnityEngine.UIElements; 4 | 5 | [MainToolbarElement("SampleScriptableObjectWithSerialization")] 6 | public class SampleScriptableObjectWithSerialization : ObjectField 7 | { 8 | [Serialize] private SampleScriptableObject _scriptableObjectValue; 9 | 10 | // Don't use constructors, use this method instead. 11 | // Toolbar extender will try to find this method and execute it 12 | public void InitializeElement() 13 | { 14 | value = _scriptableObjectValue; 15 | label = "Sample ScriptableObject"; 16 | 17 | objectType = typeof(SampleScriptableObject); 18 | 19 | this.RegisterValueChangedCallback(ev => 20 | { 21 | _scriptableObjectValue = (SampleScriptableObject)ev.newValue; 22 | }); 23 | } 24 | } -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/WithSerialization/SampleScriptableObjectWithSerialization.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fa820ad71780d83498cb87420b959fb6 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/WithSerialization/SampleToggleWithSerialization.cs: -------------------------------------------------------------------------------- 1 | using Paps.UnityToolbarExtenderUIToolkit; 2 | using UnityEngine.UIElements; 3 | 4 | [MainToolbarElement("SampleToggleWithSerialization")] 5 | public class SampleToggleWithSerialization : Toggle 6 | { 7 | [Serialize] private bool _toggleValue; 8 | 9 | // Don't use constructors, use this method instead. 10 | // Toolbar extender will try to find this method and execute it 11 | public void InitializeElement() 12 | { 13 | label = "Toggle With Serialization"; 14 | value = _toggleValue; 15 | 16 | RegisterCallback>(ev => _toggleValue = ev.newValue); 17 | } 18 | } -------------------------------------------------------------------------------- /Assets/Samples/BasicElements/WithSerialization/SampleToggleWithSerialization.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 68175509f4c9f9c41b0525d56eb427cb 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: abb0e7f5264f2104b83396d2ab5aae09 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Scenes/SampleScene.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2cda990e2423bbf4892e6590ba056729 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.ide.visualstudio": "2.0.18", 4 | "com.unity.serialization": "3.1.2", 5 | "com.unity.modules.ai": "1.0.0", 6 | "com.unity.modules.androidjni": "1.0.0", 7 | "com.unity.modules.animation": "1.0.0", 8 | "com.unity.modules.assetbundle": "1.0.0", 9 | "com.unity.modules.audio": "1.0.0", 10 | "com.unity.modules.cloth": "1.0.0", 11 | "com.unity.modules.director": "1.0.0", 12 | "com.unity.modules.imageconversion": "1.0.0", 13 | "com.unity.modules.imgui": "1.0.0", 14 | "com.unity.modules.jsonserialize": "1.0.0", 15 | "com.unity.modules.particlesystem": "1.0.0", 16 | "com.unity.modules.physics": "1.0.0", 17 | "com.unity.modules.physics2d": "1.0.0", 18 | "com.unity.modules.screencapture": "1.0.0", 19 | "com.unity.modules.terrain": "1.0.0", 20 | "com.unity.modules.terrainphysics": "1.0.0", 21 | "com.unity.modules.tilemap": "1.0.0", 22 | "com.unity.modules.ui": "1.0.0", 23 | "com.unity.modules.uielements": "1.0.0", 24 | "com.unity.modules.umbra": "1.0.0", 25 | "com.unity.modules.unityanalytics": "1.0.0", 26 | "com.unity.modules.unitywebrequest": "1.0.0", 27 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 28 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 29 | "com.unity.modules.unitywebrequesttexture": "1.0.0", 30 | "com.unity.modules.unitywebrequestwww": "1.0.0", 31 | "com.unity.modules.vehicles": "1.0.0", 32 | "com.unity.modules.video": "1.0.0", 33 | "com.unity.modules.vr": "1.0.0", 34 | "com.unity.modules.wind": "1.0.0", 35 | "com.unity.modules.xr": "1.0.0" 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Volume: 1 8 | Rolloff Scale: 1 9 | Doppler Factor: 1 10 | Default Speaker Mode: 2 11 | m_SampleRate: 0 12 | m_DSPBufferSize: 1024 13 | m_VirtualVoiceCount: 512 14 | m_RealVoiceCount: 32 15 | m_SpatializerPlugin: 16 | m_AmbisonicDecoderPlugin: 17 | m_DisableAudio: 0 18 | m_VirtualizeEffects: 1 19 | m_RequestedDSPBufferSize: 0 20 | -------------------------------------------------------------------------------- /ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!236 &1 4 | ClusterInputManager: 5 | m_ObjectHideFlags: 0 6 | m_Inputs: [] 7 | -------------------------------------------------------------------------------- /ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!55 &1 4 | PhysicsManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 13 7 | m_Gravity: {x: 0, y: -9.81, z: 0} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_BounceThreshold: 2 10 | m_DefaultMaxDepenetrationVelocity: 10 11 | m_SleepThreshold: 0.005 12 | m_DefaultContactOffset: 0.01 13 | m_DefaultSolverIterations: 6 14 | m_DefaultSolverVelocityIterations: 1 15 | m_QueriesHitBackfaces: 0 16 | m_QueriesHitTriggers: 1 17 | m_EnableAdaptiveForce: 0 18 | m_ClothInterCollisionDistance: 0.1 19 | m_ClothInterCollisionStiffness: 0.2 20 | m_ContactsGeneration: 1 21 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 22 | m_AutoSimulation: 1 23 | m_AutoSyncTransforms: 0 24 | m_ReuseCollisionCallbacks: 1 25 | m_ClothInterCollisionSettingsToggle: 0 26 | m_ClothGravity: {x: 0, y: -9.81, z: 0} 27 | m_ContactPairsMode: 0 28 | m_BroadphaseType: 0 29 | m_WorldBounds: 30 | m_Center: {x: 0, y: 0, z: 0} 31 | m_Extent: {x: 250, y: 250, z: 250} 32 | m_WorldSubdivisions: 8 33 | m_FrictionType: 0 34 | m_EnableEnhancedDeterminism: 0 35 | m_EnableUnifiedHeightmaps: 1 36 | m_SolverType: 0 37 | m_DefaultMaxAngularSpeed: 50 38 | -------------------------------------------------------------------------------- /ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1045 &1 4 | EditorBuildSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Scenes: 8 | - enabled: 1 9 | path: Assets/Scenes/SampleScene.unity 10 | guid: 2cda990e2423bbf4892e6590ba056729 11 | m_configObjects: {} 12 | -------------------------------------------------------------------------------- /ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!159 &1 4 | EditorSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 11 7 | m_SerializationMode: 2 8 | m_LineEndingsForNewScripts: 0 9 | m_DefaultBehaviorMode: 1 10 | m_PrefabRegularEnvironment: {fileID: 0} 11 | m_PrefabUIEnvironment: {fileID: 0} 12 | m_SpritePackerMode: 5 13 | m_SpritePackerPaddingPower: 1 14 | m_EtcTextureCompressorBehavior: 1 15 | m_EtcTextureFastCompressor: 1 16 | m_EtcTextureNormalCompressor: 2 17 | m_EtcTextureBestCompressor: 4 18 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;asmref;rsp 19 | m_ProjectGenerationRootNamespace: 20 | m_EnableTextureStreamingInEditMode: 1 21 | m_EnableTextureStreamingInPlayMode: 1 22 | m_AsyncShaderCompilation: 1 23 | m_CachingShaderPreprocessor: 1 24 | m_PrefabModeAllowAutoSave: 1 25 | m_EnterPlayModeOptionsEnabled: 0 26 | m_EnterPlayModeOptions: 3 27 | m_GameObjectNamingDigits: 1 28 | m_GameObjectNamingScheme: 0 29 | m_AssetNamingUsesSpace: 1 30 | m_UseLegacyProbeSampleCount: 0 31 | m_SerializeInlineMappingsOnOneLine: 1 32 | m_DisableCookiesInLightmapper: 1 33 | m_AssetPipelineMode: 1 34 | m_CacheServerMode: 0 35 | m_CacheServerEndpoint: 36 | m_CacheServerNamespacePrefix: default 37 | m_CacheServerEnableDownload: 1 38 | m_CacheServerEnableUpload: 1 39 | m_CacheServerEnableAuth: 0 40 | m_CacheServerEnableTls: 0 41 | -------------------------------------------------------------------------------- /ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!30 &1 4 | GraphicsSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 13 7 | m_Deferred: 8 | m_Mode: 1 9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} 10 | m_DeferredReflections: 11 | m_Mode: 1 12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} 13 | m_ScreenSpaceShadows: 14 | m_Mode: 1 15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} 16 | m_LegacyDeferred: 17 | m_Mode: 1 18 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} 19 | m_DepthNormals: 20 | m_Mode: 1 21 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} 22 | m_MotionVectors: 23 | m_Mode: 1 24 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} 25 | m_LightHalo: 26 | m_Mode: 1 27 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} 28 | m_LensFlare: 29 | m_Mode: 1 30 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} 31 | m_VideoShadersIncludeMode: 2 32 | m_AlwaysIncludedShaders: 33 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 34 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} 35 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} 36 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} 37 | - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} 38 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 39 | - {fileID: 10783, guid: 0000000000000000f000000000000000, type: 0} 40 | m_PreloadedShaders: [] 41 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} 42 | m_CustomRenderPipeline: {fileID: 0} 43 | m_TransparencySortMode: 0 44 | m_TransparencySortAxis: {x: 0, y: 0, z: 1} 45 | m_DefaultRenderingPath: 1 46 | m_DefaultMobileRenderingPath: 1 47 | m_TierSettings: [] 48 | m_LightmapStripping: 0 49 | m_FogStripping: 0 50 | m_InstancingStripping: 0 51 | m_LightmapKeepPlain: 1 52 | m_LightmapKeepDirCombined: 1 53 | m_LightmapKeepDynamicPlain: 1 54 | m_LightmapKeepDynamicDirCombined: 1 55 | m_LightmapKeepShadowMask: 1 56 | m_LightmapKeepSubtractive: 1 57 | m_FogKeepLinear: 1 58 | m_FogKeepExp: 1 59 | m_FogKeepExp2: 1 60 | m_AlbedoSwatchInfos: [] 61 | m_LightsUseLinearIntensity: 0 62 | m_LightsUseColorTemperature: 0 63 | m_DefaultRenderingLayerMask: 1 64 | m_LogWhenShaderIsCompiled: 0 65 | -------------------------------------------------------------------------------- /ProjectSettings/MemorySettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!387306366 &1 4 | MemorySettings: 5 | m_ObjectHideFlags: 0 6 | m_EditorMemorySettings: 7 | m_MainAllocatorBlockSize: -1 8 | m_ThreadAllocatorBlockSize: -1 9 | m_MainGfxBlockSize: -1 10 | m_ThreadGfxBlockSize: -1 11 | m_CacheBlockSize: -1 12 | m_TypetreeBlockSize: -1 13 | m_ProfilerBlockSize: -1 14 | m_ProfilerEditorBlockSize: -1 15 | m_BucketAllocatorGranularity: -1 16 | m_BucketAllocatorBucketsCount: -1 17 | m_BucketAllocatorBlockSize: -1 18 | m_BucketAllocatorBlockCount: -1 19 | m_ProfilerBucketAllocatorGranularity: -1 20 | m_ProfilerBucketAllocatorBucketsCount: -1 21 | m_ProfilerBucketAllocatorBlockSize: -1 22 | m_ProfilerBucketAllocatorBlockCount: -1 23 | m_TempAllocatorSizeMain: -1 24 | m_JobTempAllocatorBlockSize: -1 25 | m_BackgroundJobTempAllocatorBlockSize: -1 26 | m_JobTempAllocatorReducedBlockSize: -1 27 | m_TempAllocatorSizeGIBakingWorker: -1 28 | m_TempAllocatorSizeNavMeshWorker: -1 29 | m_TempAllocatorSizeAudioWorker: -1 30 | m_TempAllocatorSizeCloudWorker: -1 31 | m_TempAllocatorSizeGfx: -1 32 | m_TempAllocatorSizeJobWorker: -1 33 | m_TempAllocatorSizeBackgroundWorker: -1 34 | m_TempAllocatorSizePreloadManager: -1 35 | m_PlatformMemorySettings: {} 36 | -------------------------------------------------------------------------------- /ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshProjectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | areas: 8 | - name: Walkable 9 | cost: 1 10 | - name: Not Walkable 11 | cost: 1 12 | - name: Jump 13 | cost: 2 14 | - name: 15 | cost: 1 16 | - name: 17 | cost: 1 18 | - name: 19 | cost: 1 20 | - name: 21 | cost: 1 22 | - name: 23 | cost: 1 24 | - name: 25 | cost: 1 26 | - name: 27 | cost: 1 28 | - name: 29 | cost: 1 30 | - name: 31 | cost: 1 32 | - name: 33 | cost: 1 34 | - name: 35 | cost: 1 36 | - name: 37 | cost: 1 38 | - name: 39 | cost: 1 40 | - name: 41 | cost: 1 42 | - name: 43 | cost: 1 44 | - name: 45 | cost: 1 46 | - name: 47 | cost: 1 48 | - name: 49 | cost: 1 50 | - name: 51 | cost: 1 52 | - name: 53 | cost: 1 54 | - name: 55 | cost: 1 56 | - name: 57 | cost: 1 58 | - name: 59 | cost: 1 60 | - name: 61 | cost: 1 62 | - name: 63 | cost: 1 64 | - name: 65 | cost: 1 66 | - name: 67 | cost: 1 68 | - name: 69 | cost: 1 70 | - name: 71 | cost: 1 72 | m_LastAgentTypeID: -887442657 73 | m_Settings: 74 | - serializedVersion: 2 75 | agentTypeID: 0 76 | agentRadius: 0.5 77 | agentHeight: 2 78 | agentSlope: 45 79 | agentClimb: 0.75 80 | ledgeDropHeight: 0 81 | maxJumpAcrossDistance: 0 82 | minRegionArea: 2 83 | manualCellSize: 0 84 | cellSize: 0.16666667 85 | manualTileSize: 0 86 | tileSize: 256 87 | accuratePlacement: 0 88 | maxJobWorkers: 0 89 | preserveTilesOutsideBounds: 0 90 | debug: 91 | m_Flags: 0 92 | m_SettingNames: 93 | - Humanoid 94 | -------------------------------------------------------------------------------- /ProjectSettings/NetworkManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!149 &1 4 | NetworkManager: 5 | m_ObjectHideFlags: 0 6 | m_DebugLevel: 0 7 | m_Sendrate: 15 8 | m_AssetToPrefab: {} 9 | -------------------------------------------------------------------------------- /ProjectSettings/PackageManagerSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &1 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 61 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 13964, guid: 0000000000000000e000000000000000, type: 0} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | m_EnablePreReleasePackages: 0 16 | m_EnablePackageDependencies: 0 17 | m_AdvancedSettingsExpanded: 1 18 | m_ScopedRegistriesSettingsExpanded: 1 19 | m_SeeAllPackageVersions: 0 20 | oneTimeWarningShown: 0 21 | m_Registries: 22 | - m_Id: main 23 | m_Name: 24 | m_Url: https://packages.unity.com 25 | m_Scopes: [] 26 | m_IsDefault: 1 27 | m_Capabilities: 7 28 | m_UserSelectedRegistryName: 29 | m_UserAddingNewScopedRegistry: 0 30 | m_RegistryInfoDraft: 31 | m_ErrorMessage: 32 | m_Original: 33 | m_Id: 34 | m_Name: 35 | m_Url: 36 | m_Scopes: [] 37 | m_IsDefault: 0 38 | m_Capabilities: 0 39 | m_Modified: 0 40 | m_Name: 41 | m_Url: 42 | m_Scopes: 43 | - 44 | m_SelectedScopeIndex: 0 45 | -------------------------------------------------------------------------------- /ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 5 7 | m_Gravity: {x: 0, y: -9.81} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_VelocityIterations: 8 10 | m_PositionIterations: 3 11 | m_VelocityThreshold: 1 12 | m_MaxLinearCorrection: 0.2 13 | m_MaxAngularCorrection: 8 14 | m_MaxTranslationSpeed: 100 15 | m_MaxRotationSpeed: 360 16 | m_BaumgarteScale: 0.2 17 | m_BaumgarteTimeOfImpactScale: 0.75 18 | m_TimeToSleep: 0.5 19 | m_LinearSleepTolerance: 0.01 20 | m_AngularSleepTolerance: 2 21 | m_DefaultContactOffset: 0.01 22 | m_JobOptions: 23 | serializedVersion: 2 24 | useMultithreading: 0 25 | useConsistencySorting: 0 26 | m_InterpolationPosesPerJob: 100 27 | m_NewContactsPerJob: 30 28 | m_CollideContactsPerJob: 100 29 | m_ClearFlagsPerJob: 200 30 | m_ClearBodyForcesPerJob: 200 31 | m_SyncDiscreteFixturesPerJob: 50 32 | m_SyncContinuousFixturesPerJob: 50 33 | m_FindNearestContactsPerJob: 100 34 | m_UpdateTriggerContactsPerJob: 100 35 | m_IslandSolverCostThreshold: 100 36 | m_IslandSolverBodyCostScale: 1 37 | m_IslandSolverContactCostScale: 10 38 | m_IslandSolverJointCostScale: 10 39 | m_IslandSolverBodiesPerJob: 50 40 | m_IslandSolverContactsPerJob: 50 41 | m_SimulationMode: 0 42 | m_QueriesHitTriggers: 1 43 | m_QueriesStartInColliders: 1 44 | m_CallbacksOnDisable: 1 45 | m_ReuseCollisionCallbacks: 1 46 | m_AutoSyncTransforms: 0 47 | m_AlwaysShowColliders: 0 48 | m_ShowColliderSleep: 1 49 | m_ShowColliderContacts: 0 50 | m_ShowColliderAABB: 0 51 | m_ContactArrowScale: 0.2 52 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 53 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 54 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 55 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 56 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 57 | -------------------------------------------------------------------------------- /ProjectSettings/PresetManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1386491679 &1 4 | PresetManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_DefaultPresets: {} 8 | -------------------------------------------------------------------------------- /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2022.3.10f1 2 | m_EditorVersionWithRevision: 2022.3.10f1 (ff3792e53c62) 3 | -------------------------------------------------------------------------------- /ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!78 &1 4 | TagManager: 5 | serializedVersion: 2 6 | tags: [] 7 | layers: 8 | - Default 9 | - TransparentFX 10 | - Ignore Raycast 11 | - 12 | - Water 13 | - UI 14 | - 15 | - 16 | - 17 | - 18 | - 19 | - 20 | - 21 | - 22 | - 23 | - 24 | - 25 | - 26 | - 27 | - 28 | - 29 | - 30 | - 31 | - 32 | - 33 | - 34 | - 35 | - 36 | - 37 | - 38 | - 39 | - 40 | m_SortingLayers: 41 | - name: Default 42 | uniqueID: 0 43 | locked: 0 44 | -------------------------------------------------------------------------------- /ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!5 &1 4 | TimeManager: 5 | m_ObjectHideFlags: 0 6 | Fixed Timestep: 0.02 7 | Maximum Allowed Timestep: 0.33333334 8 | m_TimeScale: 1 9 | Maximum Particle Timestep: 0.03 10 | -------------------------------------------------------------------------------- /ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!310 &1 4 | UnityConnectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 1 7 | m_Enabled: 0 8 | m_TestMode: 0 9 | m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events 10 | m_EventUrl: https://cdp.cloud.unity3d.com/v1/events 11 | m_ConfigUrl: https://config.uca.cloud.unity3d.com 12 | m_DashboardUrl: https://dashboard.unity3d.com 13 | m_TestInitMode: 0 14 | CrashReportingSettings: 15 | m_EventUrl: https://perf-events.cloud.unity3d.com 16 | m_Enabled: 0 17 | m_LogBufferSize: 10 18 | m_CaptureEditorExceptions: 1 19 | UnityPurchasingSettings: 20 | m_Enabled: 0 21 | m_TestMode: 0 22 | UnityAnalyticsSettings: 23 | m_Enabled: 0 24 | m_TestMode: 0 25 | m_InitializeOnStartup: 1 26 | m_PackageRequiringCoreStatsPresent: 0 27 | UnityAdsSettings: 28 | m_Enabled: 0 29 | m_InitializeOnStartup: 1 30 | m_TestMode: 0 31 | m_IosGameId: 32 | m_AndroidGameId: 33 | m_GameIds: {} 34 | m_GameId: 35 | PerformanceReportingSettings: 36 | m_Enabled: 0 37 | -------------------------------------------------------------------------------- /ProjectSettings/VFXManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!937362698 &1 4 | VFXManager: 5 | m_ObjectHideFlags: 0 6 | m_IndirectShader: {fileID: 0} 7 | m_CopyBufferShader: {fileID: 0} 8 | m_SortShader: {fileID: 0} 9 | m_StripUpdateShader: {fileID: 0} 10 | m_RenderPipeSettingsPath: 11 | m_FixedTimeStep: 0.016666668 12 | m_MaxDeltaTime: 0.05 13 | m_CompiledVersion: 0 14 | m_RuntimeVersion: 0 15 | -------------------------------------------------------------------------------- /ProjectSettings/VersionControlSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!890905787 &1 4 | VersionControlSettings: 5 | m_ObjectHideFlags: 0 6 | m_Mode: Visible Meta Files 7 | m_CollabEditorSettings: 8 | inProgressEnabled: 1 9 | -------------------------------------------------------------------------------- /ProjectSettings/XRSettings.asset: -------------------------------------------------------------------------------- 1 | { 2 | "m_SettingKeys": [ 3 | "VR Device Disabled", 4 | "VR Device User Alert" 5 | ], 6 | "m_SettingValues": [ 7 | "False", 8 | "False" 9 | ] 10 | } --------------------------------------------------------------------------------