├── .github └── workflows │ └── upm-ci.yml ├── .gitignore ├── Assets ├── instance.id.meta └── instance.id │ ├── ElementAnimationToolkit.meta │ └── ElementAnimationToolkit │ ├── LICENSE.md │ ├── LICENSE.md.meta │ ├── README.md │ ├── README.md.meta │ ├── Runtime.meta │ ├── Runtime │ ├── Animations.meta │ ├── Animations │ │ ├── AnimationExtensions.cs │ │ ├── AnimationExtensions.cs.meta │ │ ├── AnimationSequences.cs │ │ ├── AnimationSequences.cs.meta │ │ ├── ContinuousAnimations.cs │ │ ├── ContinuousAnimations.cs.meta │ │ ├── Easy.cs │ │ ├── Easy.cs.meta │ │ ├── HoverAnimations.cs │ │ ├── HoverAnimations.cs.meta │ │ ├── VisualElementBaseAnimation.cs │ │ └── VisualElementBaseAnimation.cs.meta │ ├── Elements.meta │ ├── Elements │ │ ├── AnimatedFoldout.meta │ │ ├── AnimatedFoldout │ │ │ ├── AnimatedFoldout.cs │ │ │ ├── AnimatedFoldout.cs.meta │ │ │ ├── Resources.meta │ │ │ ├── Resources │ │ │ │ ├── Style.meta │ │ │ │ └── Style │ │ │ │ │ ├── AnimatedFoldoutStyle.sass │ │ │ │ │ ├── AnimatedFoldoutStyle.sass.meta │ │ │ │ │ ├── AnimatedFoldoutStyle.uss │ │ │ │ │ ├── AnimatedFoldoutStyle.uss.meta │ │ │ │ │ ├── elements.meta │ │ │ │ │ └── elements │ │ │ │ │ ├── _containers.sass │ │ │ │ │ ├── _containers.sass.meta │ │ │ │ │ ├── _index.sass │ │ │ │ │ └── _index.sass.meta │ │ │ ├── UIElementExpander.cs │ │ │ └── UIElementExpander.cs.meta │ │ ├── AnimatedLabel.meta │ │ ├── AnimatedLabel │ │ │ ├── AnimatedLabel.cs │ │ │ ├── AnimatedLabel.cs.meta │ │ │ ├── Style.meta │ │ │ └── Style │ │ │ │ ├── AnimatedLabel.uss │ │ │ │ └── AnimatedLabel.uss.meta │ │ ├── Attributes.meta │ │ ├── Attributes │ │ │ ├── EditorFieldAttribute.cs │ │ │ └── EditorFieldAttribute.cs.meta │ │ ├── BetterTextField.meta │ │ └── BetterTextField │ │ │ ├── MaskedInputField.cs │ │ │ ├── MaskedInputField.cs.meta │ │ │ ├── Style.meta │ │ │ └── Style │ │ │ ├── MaskedInputField.uss │ │ │ └── MaskedInputField.uss.meta │ ├── Enhancements.meta │ ├── Enhancements │ │ ├── Events.meta │ │ ├── Events │ │ │ └── Scenes.meta │ │ ├── Tasks.meta │ │ └── Tasks │ │ │ ├── ITaskSequence.cs │ │ │ ├── ITaskSequence.cs.meta │ │ │ ├── SingleTask.cs │ │ │ ├── SingleTask.cs.meta │ │ │ ├── WaitUntil.cs │ │ │ └── WaitUntil.cs.meta │ ├── Scripts.meta │ ├── Scripts │ │ ├── Extensions.meta │ │ ├── Extensions │ │ │ ├── AssetFileExtensions.cs │ │ │ ├── AssetFileExtensions.cs.meta │ │ │ ├── CollectionExtensions.cs │ │ │ ├── CollectionExtensions.cs.meta │ │ │ ├── Color.meta │ │ │ ├── Color │ │ │ │ ├── ColorExtensions.cs │ │ │ │ ├── ColorExtensions.cs.meta │ │ │ │ ├── ColorTool.cs │ │ │ │ ├── ColorTool.cs.meta │ │ │ │ ├── Colors.cs │ │ │ │ ├── Colors.cs.meta │ │ │ │ ├── GetColor.cs │ │ │ │ ├── GetColor.cs.meta │ │ │ │ ├── MathEx.cs │ │ │ │ └── MathEx.cs.meta │ │ │ ├── DataTypes.meta │ │ │ ├── DataTypes │ │ │ │ ├── AnimColorStore.cs │ │ │ │ ├── AnimColorStore.cs.meta │ │ │ │ ├── AnimTime.cs │ │ │ │ ├── AnimTime.cs.meta │ │ │ │ ├── AnimValueStore.cs │ │ │ │ ├── AnimValueStore.cs.meta │ │ │ │ ├── AnimateElement.cs │ │ │ │ ├── AnimateElement.cs.meta │ │ │ │ ├── AnimatedItems.cs │ │ │ │ ├── AnimatedItems.cs.meta │ │ │ │ ├── ClassData.cs │ │ │ │ ├── ClassData.cs.meta │ │ │ │ ├── Editor.meta │ │ │ │ ├── Editor │ │ │ │ │ ├── SerializedDictionaryEditor.cs │ │ │ │ │ └── SerializedDictionaryEditor.cs.meta │ │ │ │ ├── FieldData.cs │ │ │ │ ├── FieldData.cs.meta │ │ │ │ ├── GetEasing.cs │ │ │ │ ├── GetEasing.cs.meta │ │ │ │ ├── ImageAsset.cs │ │ │ │ ├── ImageAsset.cs.meta │ │ │ │ ├── ListPool.cs │ │ │ │ ├── ListPool.cs.meta │ │ │ │ ├── SerializedDictionary.cs │ │ │ │ ├── SerializedDictionary.cs.meta │ │ │ │ ├── VersionElement.meta │ │ │ │ ├── VersionElement │ │ │ │ │ ├── VersionElement.cs │ │ │ │ │ └── VersionElement.cs.meta │ │ │ │ ├── VisualElementStyleStore.cs │ │ │ │ └── VisualElementStyleStore.cs.meta │ │ │ ├── ElementGeneration.meta │ │ │ ├── ElementGeneration │ │ │ │ ├── ContainerData.cs │ │ │ │ ├── ContainerData.cs.meta │ │ │ │ ├── ContainerStyle.cs │ │ │ │ ├── ContainerStyle.cs.meta │ │ │ │ ├── ContainerType.cs │ │ │ │ ├── ContainerType.cs.meta │ │ │ │ ├── ElementGeneration.cs │ │ │ │ ├── ElementGeneration.cs.meta │ │ │ │ ├── IMGuiObject.cs │ │ │ │ ├── IMGuiObject.cs.meta │ │ │ │ ├── UIElementsEditorHelper.cs │ │ │ │ └── UIElementsEditorHelper.cs.meta │ │ │ ├── Elements.meta │ │ │ ├── Elements │ │ │ │ ├── VisualElementExtension.cs │ │ │ │ └── VisualElementExtension.cs.meta │ │ │ ├── JumpTarget.meta │ │ │ ├── JumpTarget │ │ │ │ ├── JumpTarget.cs │ │ │ │ ├── JumpTarget.cs.meta │ │ │ │ ├── JumpType.cs │ │ │ │ └── JumpType.cs.meta │ │ │ ├── LinqExtensions.cs │ │ │ ├── LinqExtensions.cs.meta │ │ │ ├── ParseElements.cs │ │ │ ├── ParseElements.cs.meta │ │ │ ├── PropertyExtensions.cs │ │ │ ├── PropertyExtensions.cs.meta │ │ │ ├── ReflectionExten.cs │ │ │ ├── ReflectionExten.cs.meta │ │ │ ├── Timer.cs │ │ │ ├── Timer.cs.meta │ │ │ ├── VisualElementEvents.meta │ │ │ ├── VisualElementEvents │ │ │ │ ├── VisualElementEvents.cs │ │ │ │ └── VisualElementEvents.cs.meta │ │ │ ├── VisualElementExtension.cs │ │ │ └── VisualElementExtension.cs.meta │ │ ├── ScriptableObjects.meta │ │ ├── ScriptableObjects │ │ │ ├── AssetInstance.cs │ │ │ ├── AssetInstance.cs.meta │ │ │ ├── StyleAssets.meta │ │ │ └── StyleAssets │ │ │ │ ├── EATKStyleAsset.cs │ │ │ │ └── EATKStyleAsset.cs.meta │ │ ├── UI.meta │ │ └── UI │ │ │ ├── EATKEditor.cs │ │ │ ├── EATKEditor.cs.meta │ │ │ ├── ElementData.meta │ │ │ ├── ElementData │ │ │ ├── ObjectElementData.cs │ │ │ └── ObjectElementData.cs.meta │ │ │ ├── Style.meta │ │ │ ├── Style │ │ │ ├── EATKEditor.uss │ │ │ ├── EATKEditor.uss.meta │ │ │ ├── Resources.meta │ │ │ └── Resources │ │ │ │ ├── Fonts.meta │ │ │ │ └── Fonts │ │ │ │ ├── SourceCodePro--iMedium-It.otf │ │ │ │ ├── SourceCodePro--iMedium-It.otf.meta │ │ │ │ ├── SourceCodePro-Black.otf │ │ │ │ ├── SourceCodePro-Black.otf.meta │ │ │ │ ├── SourceCodePro-BlackIt.otf │ │ │ │ ├── SourceCodePro-BlackIt.otf.meta │ │ │ │ ├── SourceCodePro-Bold.otf │ │ │ │ ├── SourceCodePro-Bold.otf.meta │ │ │ │ ├── SourceCodePro-BoldIt.otf │ │ │ │ ├── SourceCodePro-BoldIt.otf.meta │ │ │ │ ├── SourceCodePro-ExtraLight.otf │ │ │ │ ├── SourceCodePro-ExtraLight.otf.meta │ │ │ │ ├── SourceCodePro-ExtraLightIt.otf │ │ │ │ ├── SourceCodePro-ExtraLightIt.otf.meta │ │ │ │ ├── SourceCodePro-It.otf │ │ │ │ ├── SourceCodePro-It.otf.meta │ │ │ │ ├── SourceCodePro-Light.otf │ │ │ │ ├── SourceCodePro-Light.otf.meta │ │ │ │ ├── SourceCodePro-LightIt.otf │ │ │ │ ├── SourceCodePro-LightIt.otf.meta │ │ │ │ ├── SourceCodePro-Medium.otf │ │ │ │ ├── SourceCodePro-Medium.otf.meta │ │ │ │ ├── SourceCodePro-Regular.otf │ │ │ │ ├── SourceCodePro-Regular.otf.meta │ │ │ │ ├── SourceCodePro-Semibold.otf │ │ │ │ ├── SourceCodePro-Semibold.otf.meta │ │ │ │ ├── SourceCodePro-SemiboldIt.otf │ │ │ │ └── SourceCodePro-SemiboldIt.otf.meta │ │ │ ├── Windows.meta │ │ │ └── Windows │ │ │ ├── BaseEditorWindow.meta │ │ │ ├── BaseEditorWindow │ │ │ ├── Style.meta │ │ │ ├── Style │ │ │ │ ├── elements.meta │ │ │ │ ├── elements │ │ │ │ │ ├── _containers.sass │ │ │ │ │ ├── _containers.sass.meta │ │ │ │ │ ├── _fields.sass │ │ │ │ │ ├── _fields.sass.meta │ │ │ │ │ ├── _index.sass │ │ │ │ │ └── _index.sass.meta │ │ │ │ ├── idEditorWindowStyle.sass │ │ │ │ ├── idEditorWindowStyle.sass.meta │ │ │ │ ├── idEditorWindowStyle.uss │ │ │ │ └── idEditorWindowStyle.uss.meta │ │ │ ├── idEditorWindow.cs │ │ │ └── idEditorWindow.cs.meta │ │ │ ├── EATKEditor.meta │ │ │ └── EATKEditor │ │ │ ├── EATKEditor.cs │ │ │ ├── EATKEditor.cs.meta │ │ │ ├── Style.meta │ │ │ └── Style │ │ │ ├── EATKEditor.uss │ │ │ ├── EATKEditor.uss.meta │ │ │ ├── Resources.meta │ │ │ └── Resources │ │ │ ├── Fonts.meta │ │ │ └── Fonts │ │ │ ├── SourceCodePro--iMedium-It.otf │ │ │ ├── SourceCodePro--iMedium-It.otf.meta │ │ │ ├── SourceCodePro-Black.otf │ │ │ ├── SourceCodePro-Black.otf.meta │ │ │ ├── SourceCodePro-BlackIt.otf │ │ │ ├── SourceCodePro-BlackIt.otf.meta │ │ │ ├── SourceCodePro-Bold.otf │ │ │ ├── SourceCodePro-Bold.otf.meta │ │ │ ├── SourceCodePro-BoldIt.otf │ │ │ ├── SourceCodePro-BoldIt.otf.meta │ │ │ ├── SourceCodePro-ExtraLight.otf │ │ │ ├── SourceCodePro-ExtraLight.otf.meta │ │ │ ├── SourceCodePro-ExtraLightIt.otf │ │ │ ├── SourceCodePro-ExtraLightIt.otf.meta │ │ │ ├── SourceCodePro-It.otf │ │ │ ├── SourceCodePro-It.otf.meta │ │ │ ├── SourceCodePro-Light.otf │ │ │ ├── SourceCodePro-Light.otf.meta │ │ │ ├── SourceCodePro-LightIt.otf │ │ │ ├── SourceCodePro-LightIt.otf.meta │ │ │ ├── SourceCodePro-Medium.otf │ │ │ ├── SourceCodePro-Medium.otf.meta │ │ │ ├── SourceCodePro-Regular.otf │ │ │ ├── SourceCodePro-Regular.otf.meta │ │ │ ├── SourceCodePro-Semibold.otf │ │ │ ├── SourceCodePro-Semibold.otf.meta │ │ │ ├── SourceCodePro-SemiboldIt.otf │ │ │ └── SourceCodePro-SemiboldIt.otf.meta │ ├── Util.meta │ ├── Util │ │ ├── ColorUtil.cs │ │ └── ColorUtil.cs.meta │ ├── id.instance.elementanimationtoolkit.asmdef │ └── id.instance.elementanimationtoolkit.asmdef.meta │ ├── Samples.meta │ ├── Samples │ ├── Example_Scene.unity │ ├── Example_Scene.unity.meta │ ├── Objects.meta │ ├── Objects │ │ ├── Example_Categories.prefab │ │ ├── Example_Categories.prefab.meta │ │ ├── Weapons.meta │ │ └── Weapons │ │ │ ├── BroadSword.asset │ │ │ ├── BroadSword.asset.meta │ │ │ ├── Sword.asset │ │ │ └── Sword.asset.meta │ ├── Resources.meta │ ├── Scripts.meta │ └── Scripts │ │ ├── Editor.meta │ │ ├── Editor │ │ ├── ExampleComponentEditor.cs │ │ ├── ExampleComponentEditor.cs.meta │ │ ├── Style.meta │ │ └── Style │ │ │ ├── ExampleComponentEditor.uss │ │ │ ├── ExampleComponentEditor.uss.meta │ │ │ ├── HighlighterStyle.uss │ │ │ └── HighlighterStyle.uss.meta │ │ ├── ExampleComponent.cs │ │ ├── ExampleComponent.cs.meta │ │ ├── Items.meta │ │ ├── Items │ │ ├── Axe.cs │ │ ├── Axe.cs.meta │ │ ├── Sword.cs │ │ ├── Sword.cs.meta │ │ ├── WeaponsBase.cs │ │ └── WeaponsBase.cs.meta │ │ ├── SecondComponent.cs │ │ └── SecondComponent.cs.meta │ ├── package.json │ └── package.json.meta ├── LICENSE.md ├── Packages ├── manifest.json └── packages-lock.json ├── ProjectSettings ├── MemorySettings.asset ├── ProjectVersion.txt └── VersionControlSettings.asset ├── README.md ├── SelectionGroups └── SelectionGroups.asset ├── UserSettings ├── EditorUserSettings.asset └── Layouts │ └── default-2022.dwlt ├── media ├── background_fade_example.gif ├── fade_example.gif ├── hoverborderpulse_example.gif ├── intro_animation.gif ├── intro_animation.mp4 ├── jumptomenu.png └── rowbuttons.png └── removed-from.manifest.json /.github/workflows/upm-ci.yml: -------------------------------------------------------------------------------- 1 | name: upm-ci 2 | on: 3 | push: 4 | branches: 5 | - main 6 | jobs: 7 | copy-readme: 8 | name: copy-readme 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions/checkout@v2 12 | - name: copy file 13 | uses: canastro/copy-file-action@master 14 | with: 15 | source: "README.md" 16 | target: "Assets/instance.id/ElementAnimationToolkit/README.md" 17 | 18 | split-upm: 19 | name: split upm branch 20 | runs-on: ubuntu-latest 21 | steps: 22 | - uses: actions/checkout@v2 23 | with: 24 | fetch-depth: 0 25 | - name: split upm branch 26 | run: | 27 | git subtree split -P "$PKG_ROOT" -b upm 28 | git push -u origin upm 29 | env: 30 | PKG_ROOT: Assets/instance.id/ElementAnimationToolkit 31 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # This .gitignore file should be placed at the root of your Unity project directory 2 | # 3 | # Get latest from https://github.com/github/gitignore/blob/master/Unity.gitignore 4 | # 5 | /[Ll]ibrary/ 6 | /[Tt]emp/ 7 | /[Oo]bj/ 8 | /[Bb]uild/ 9 | /[Bb]uilds/ 10 | /[Ll]ogs/ 11 | /[Mm]emoryCaptures/ 12 | /[Aa]ssetStoreTools/ 13 | 14 | # Never ignore Asset meta data 15 | !/[Aa]ssets/**/*.meta 16 | 17 | # Uncomment this line if you wish to ignore the asset store tools plugin 18 | # /[Aa]ssets/AssetStoreTools* 19 | 20 | # TextMesh Pro files 21 | [Aa]ssets/TextMesh*Pro/ 22 | 23 | # Autogenerated Jetbrains Rider plugin 24 | [Aa]ssets/Plugins/Editor/JetBrains* 25 | 26 | # Visual Studio cache directory 27 | .vs/ 28 | 29 | # Gradle cache directory 30 | .gradle/ 31 | 32 | # Autogenerated VS/MD/Consulo solution and project files 33 | ExportedObj/ 34 | .consulo/ 35 | *.csproj 36 | *.unityproj 37 | *.sln 38 | *.suo 39 | *.tmp 40 | *.user 41 | *.userprefs 42 | *.pidb 43 | *.booproj 44 | *.svd 45 | *.pdb 46 | *.mdb 47 | *.opendb 48 | *.VC.db 49 | 50 | # Unity3D generated meta files 51 | *.pidb.meta 52 | *.pdb.meta 53 | *.mdb.meta 54 | 55 | # Unity3D generated file on crash reports 56 | sysinfo.txt 57 | 58 | # Builds 59 | *.apk 60 | *.unitypackage 61 | 62 | # Crashlytics generated file 63 | crashlytics-build.properties 64 | 65 | .idea/ 66 | /ProjectSettings/NavMeshAreas.asset 67 | /ProjectSettings/ClusterInputManager.asset 68 | /ProjectSettings/UnityConnectSettings.asset 69 | /ProjectSettings/QualitySettings.asset 70 | /ProjectSettings/DynamicsManager.asset 71 | /ProjectSettings/ProjectSettings.asset 72 | /ProjectSettings/PresetManager.asset 73 | /ProjectSettings/XRSettings.asset 74 | /ProjectSettings/InputManager.asset 75 | /ProjectSettings/VFXManager.asset 76 | /ProjectSettings/AudioManager.asset 77 | /ProjectSettings/TimeManager.asset 78 | /ProjectSettings/EditorBuildSettings.asset 79 | /ProjectSettings/GraphicsSettings.asset 80 | /ProjectSettings/TagManager.asset 81 | /ProjectSettings/PackageManagerSettings.asset 82 | /ProjectSettings/EditorSettings.asset 83 | /ProjectSettings/Physics2DSettings.asset 84 | /Assets/Standard Assets/ 85 | /Assets/Standard Assets.meta 86 | /Assets/HierarchyHeaderSettings.asset 87 | /Assets/HierarchyHeaderSettings.asset.meta 88 | /Assets/Research/ 89 | /Assets/Research.meta 90 | /Assets/Profiles/ 91 | /Assets/Profiles.meta 92 | /Assets/Scenes/ 93 | /Assets/Scenes.meta 94 | /Assets/AssetStoreTools/ 95 | /Assets/AssetStoreTools.meta 96 | /Assembly-CSharp-Editor.csproj 97 | /Assembly-CSharp-firstpass.csproj 98 | /Assembly-CSharp.csproj 99 | /AV.Editor.Hierarchy.csproj 100 | /com.id.instance.hierarchyheader.csproj 101 | /com.id.instance.hierarchyheader.Editor.csproj 102 | /ElementAnimationToolkit.sln 103 | /id.instance.elementanimationtoolkit.csproj 104 | /id.instance.elementanimationtoolkit.Editor.csproj 105 | /packages.config 106 | /Packages/AngleSharp.1.0.0-alpha-844/ 107 | /Packages/System.Runtime.CompilerServices.Unsafe.4.5.0/ 108 | /Packages/System.Text.Encoding.CodePages.4.5.0/ 109 | /Documentation/ 110 | /removed-from.manifest.json 111 | /_site/ 112 | **/obj/* 113 | .bak/ 114 | 115 | .unitybackup 116 | -------------------------------------------------------------------------------- /Assets/instance.id.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 670c8a29792005448803cf943f38d054 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ea8c8ac6ba064fb0a6a7200d7c001bc3 3 | timeCreated: 1605410422 -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 instance.id 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/instance.id/ElementAnimationToolkit/LICENSE.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 24ea00810259af444aa315d9992b2250 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/README.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5c637b5026ab671478dfa84b7c7fe557 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b8cad17cbb9cb2e41af48a375f923175 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Animations.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b7560ffbe5b349c69ed650903f3d0d7f 3 | timeCreated: 1627084437 -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Animations/AnimationExtensions.cs: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // -- Project : https://github.com/instance-id/ElementAnimationToolkit -- 3 | // -- instance.id 2020 | http://github.com/instance-id | http://instance.id -- 4 | // ---------------------------------------------------------------------------- 5 | 6 | #if UNITY_EDITOR 7 | using System; 8 | using UnityEngine.UIElements; 9 | 10 | namespace instance.id.EATK 11 | { 12 | public static class AnimationExtensions 13 | { 14 | /// 15 | /// Shorter extension in which to specify when an action should be started, and then proceed start it after specified amount of time. 16 | /// 17 | /// The target element in which to register the callback 18 | /// The action to perform 19 | /// The amount of time in milliseconds that should be waited until the action begins 20 | public static void ExecuteIn(this VisualElement element, Action action, long delayMs = 0) 21 | { 22 | element.parent.schedule.Execute(action).StartingIn(delayMs); 23 | } 24 | 25 | /// 26 | /// Shorter extension in which to specify when an action should be started, and then proceed start it after specified amount of time. 27 | /// 28 | /// The action to perform 29 | /// The target element in which to register the callback 30 | /// The amount of time in milliseconds that should be waited until the action begins 31 | public static void ExecuteIn(this Action action, VisualElement element, long delayMs = 0) 32 | { 33 | element.parent.schedule.Execute(action).StartingIn(delayMs); 34 | } 35 | } 36 | } 37 | #endif 38 | -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Animations/AnimationExtensions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a966a2e1775ebb175bf0da08c7acc7e9 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Animations/AnimationSequences.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f917f23d0d6a11d70a8df25935fc87de 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Animations/ContinuousAnimations.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ae8f37542b1f4a5beb5d5ae5eab8c857 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Animations/Easy.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d5992efa274c95d3288e72d437bc7ec5 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Animations/HoverAnimations.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3c99477eb0badf41ea23ce66311d2340 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Animations/VisualElementBaseAnimation.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7daebc746d4b79eb8aa9be9bfce73cb2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Elements.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: facd88093d48418f84ec164ff7314b0b 3 | timeCreated: 1621477552 -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Elements/AnimatedFoldout.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7fe32b164027cdd86b486cc2642ae2a5 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Elements/AnimatedFoldout/AnimatedFoldout.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a10d3a1d836a41fd89a218dff6d658b2 3 | timeCreated: 1604837748 -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Elements/AnimatedFoldout/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e599d94cc6e558f8aaa56ee90748ea9c 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Elements/AnimatedFoldout/Resources/Style.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 84741c9d29a745da8994ffa3d99299bd 3 | timeCreated: 1653517994 -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Elements/AnimatedFoldout/Resources/Style/AnimatedFoldoutStyle.sass: -------------------------------------------------------------------------------- 1 | @use 'elements' 2 | 3 | /* -- AnimatedFoldoutStyle ---------------------- 4 | /* ---------------------------------------------- 5 | -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Elements/AnimatedFoldout/Resources/Style/AnimatedFoldoutStyle.sass.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b6bc274cfe24acc92a42adce2c8da7ec 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Elements/AnimatedFoldout/Resources/Style/AnimatedFoldoutStyle.uss: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------- */ 2 | /* containers */ 3 | /* ---------------------------------------------- */ 4 | .variables { 5 | --headerBorderWidth: 0px; 6 | } 7 | 8 | .animatedFoldout { 9 | border-radius: 4px; 10 | } 11 | 12 | .headerBorderLine { 13 | margin: -4px 0px 8px; 14 | height: 1px; 15 | width: var(--headerBorderWidth); 16 | border-bottom-width: 1px; 17 | border-bottom-color: rgba(150, 150, 150, 0.2); 18 | } 19 | 20 | .headerBorderLineExpanded { 21 | border-bottom-color: rgba(255, 255, 255, 0.2); 22 | } 23 | 24 | .expandToggleContainerHeader { 25 | padding: 1px 0 3px 3px; 26 | margin-left: 0; 27 | } 28 | 29 | .expandContainerItem { 30 | flex-shrink: 0; 31 | flex-grow: 1; 32 | } 33 | 34 | .expandToggle { 35 | margin-left: 0; 36 | border-top-left-radius: 4px; 37 | border-top-right-radius: 4px; 38 | } 39 | 40 | .spacerColumn { 41 | min-height: 100%; 42 | } 43 | 44 | /* -- AnimatedFoldoutStyle ---------------------- */ 45 | /* ---------------------------------------------- */ 46 | -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Elements/AnimatedFoldout/Resources/Style/AnimatedFoldoutStyle.uss.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3cdb5451820618b5781a8d2f03efdb5c 3 | ScriptedImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 2 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | script: {fileID: 12385, guid: 0000000000000000e000000000000000, type: 0} 11 | disableValidation: 0 12 | -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Elements/AnimatedFoldout/Resources/Style/elements.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5fb710c90af821254ba44df640330777 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Elements/AnimatedFoldout/Resources/Style/elements/_containers.sass: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------- 2 | /* containers 3 | /* ---------------------------------------------- 4 | 5 | .variables 6 | --headerBorderWidth: 0px 7 | 8 | .animatedFoldout 9 | border-radius: 4px 10 | 11 | .headerBorderLine 12 | margin: -4px 0px 8px 13 | height: 1px 14 | width: var(--headerBorderWidth) 15 | border-bottom-width: 1px 16 | border-bottom-color: rgba(150, 150, 150, 0.2) 17 | 18 | .headerBorderLineExpanded 19 | border-bottom-color: rgba(255, 255, 255, 0.2) 20 | 21 | .expandToggleContainerHeader 22 | padding: 1px 0 3px 3px 23 | margin-left: 0 24 | 25 | .expandContainerItem 26 | flex-shrink: 0 27 | flex-grow: 1 28 | 29 | .expandToggle 30 | margin-left: 0 31 | border-top-left-radius: 4px 32 | border-top-right-radius: 4px 33 | 34 | .spacerColumn 35 | min-height: 100% 36 | -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Elements/AnimatedFoldout/Resources/Style/elements/_containers.sass.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cc03930e4ecc09628a1aedbe44740cd1 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Elements/AnimatedFoldout/Resources/Style/elements/_index.sass: -------------------------------------------------------------------------------- 1 | //!source ../AnimatedFoldoutStyle.sass 2 | 3 | @use 'containers' 4 | -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Elements/AnimatedFoldout/Resources/Style/elements/_index.sass.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 06ba65432e6b1049ba298ca81de1d259 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Elements/AnimatedFoldout/UIElementExpander.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dac336bc00fb4212bfc13fffb7c79e93 3 | timeCreated: 1604837748 -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Elements/AnimatedLabel.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 27a6b9aa77169b4c2aaa64cdebf1553f 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Elements/AnimatedLabel/AnimatedLabel.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 47d44b2fae75452ab2ad6d9e10c2a3cd 3 | timeCreated: 1605150709 -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Elements/AnimatedLabel/Style.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 019fd5d3fdf848e9b8bcb824b40a628d 3 | timeCreated: 1605151373 -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Elements/AnimatedLabel/Style/AnimatedLabel.uss: -------------------------------------------------------------------------------- 1 | /* -------------------------------------------------------- 2 | AnimatedLabel -- 3 | ----------------------------------------------------- */ 4 | 5 | /* --------------------------------- */ 6 | /* Container ----------------------- */ 7 | /**/ 8 | 9 | .animated-label-container { 10 | flex-direction: row; 11 | } 12 | 13 | .animatedLabel { 14 | padding: 0; 15 | } 16 | 17 | 18 | /* Container*/ 19 | 20 | /* -------------------------------- */ 21 | /* Unity default Overrides -------- */ 22 | /**/ 23 | 24 | .unity-scroll-view { 25 | flex: 1 0 0; 26 | } 27 | 28 | .unity-box { 29 | flex: 1 0 0; 30 | margin: 0; 31 | } 32 | 33 | .unity-popup-window { 34 | padding: 5px 10px 12px; 35 | } 36 | 37 | /**/ 38 | -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Elements/AnimatedLabel/Style/AnimatedLabel.uss.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8eb220a547c14a1fb7e5d27e8e78bc4a 3 | timeCreated: 1605151383 -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Elements/Attributes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ba509363ef2ae4490881bb78927247e4 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Elements/Attributes/EditorFieldAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices.WindowsRuntime; 3 | using UnityEngine; 4 | using UnityEngine.UIElements; 5 | 6 | namespace instance.id.EATK.Extensions 7 | { 8 | /// 9 | /// Attribute providing easier creation of custom internal editor windows 10 | /// 11 | [Serializable, AttributeUsage(AttributeTargets.Field | AttributeTargets.Interface)] 12 | public class EditorFieldAttribute : PropertyAttribute, IEquatable 13 | { 14 | public string description; 15 | public string toolTip; 16 | public VisualElement element; 17 | public ContainerData container; 18 | 19 | /// 20 | /// Attribute providing easier creation of custom internal editor windows 21 | /// 22 | public EditorFieldAttribute() { } 23 | 24 | /// 25 | /// Attribute providing easier creation of custom internal editor windows 26 | /// 27 | /// 28 | /// 29 | /// 30 | /// 31 | /// 32 | /// 33 | /// Should foldout be closed by default 34 | public EditorFieldAttribute(string Description = default, ContainerType ContainerType = default, string ContainerName = default, 35 | int ContainerId = -1, 36 | int Order = -1, 37 | string ToolTip = default, 38 | bool foldoutOpen = false) 39 | { 40 | if (Description == default) 41 | { 42 | description = "Field Description Missing!"; 43 | toolTip = "Please fill out the field description in the EditorField attribute!"; 44 | } 45 | else 46 | { 47 | description = Description; 48 | toolTip = default ? Description : ToolTip; 49 | } 50 | 51 | container = new ContainerData 52 | { 53 | order = Order, 54 | foldoutOpen = foldoutOpen, 55 | containerId = ContainerId, 56 | containerType = ContainerType, 57 | containerName = ContainerName, 58 | containerClass = ContainerName?.Replace(" ", string.Empty) 59 | }; 60 | } 61 | 62 | #region Equality Methods 63 | 64 | /// 65 | public bool Equals(EditorFieldAttribute other) 66 | { 67 | if (ReferenceEquals(null, other)) return false; 68 | if (ReferenceEquals(this, other)) return true; 69 | return base.Equals(other) && description == other.description && toolTip == other.toolTip && Equals(element, other.element); 70 | } 71 | 72 | /// 73 | public override bool Equals(object obj) 74 | { 75 | if (ReferenceEquals(null, obj)) return false; 76 | if (ReferenceEquals(this, obj)) return true; 77 | if (obj.GetType() != this.GetType()) return false; 78 | return Equals((EditorFieldAttribute)obj); 79 | } 80 | 81 | /// 82 | public override int GetHashCode() 83 | { 84 | unchecked 85 | { 86 | int hashCode = base.GetHashCode(); 87 | hashCode = (hashCode * 397) ^ (description != null ? description.GetHashCode() : 0); 88 | hashCode = (hashCode * 397) ^ (toolTip != null ? toolTip.GetHashCode() : 0); 89 | hashCode = (hashCode * 397) ^ (element != null ? element.GetHashCode() : 0); 90 | return hashCode; 91 | } 92 | } 93 | 94 | #endregion 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Elements/Attributes/EditorFieldAttribute.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1176e90beaa76215297160e049434a1e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Elements/BetterTextField.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c533ce28fa8415d8d92f9a46999ba5f3 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Elements/BetterTextField/MaskedInputField.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9e4a7b3bb6cc4b0f898b497d79c2f454 3 | timeCreated: 1599914806 -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Elements/BetterTextField/Style.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 77fbddc398c84ce9afbbbf2a37fbda80 3 | timeCreated: 1605010608 -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Elements/BetterTextField/Style/MaskedInputField.uss: -------------------------------------------------------------------------------- 1 | /* BetterTextField Styles */ 2 | 3 | * { 4 | --standard-margin: 8px; 5 | --half-standard-margin: 4px; 6 | --quarter-standard-margin: 2px; 7 | --standard-padding: var(--standard-margin); 8 | 9 | --icon-size: 16px; 10 | --half-icon-size: 8px; 11 | --large-icon-size: 22px; 12 | --half-large-icon-size: 11px; 13 | --icon-standard-margin: var(--half-standard-margin); 14 | 15 | --list-entry-height: 25px; 16 | --list-entry-path-font-size: 10px; 17 | --dark-list-entry-path-text-color: #949494; 18 | --light-list-entry-path-text-color: #6B6B6B; 19 | 20 | --profile-icon-font-size: 13px; 21 | 22 | --no-color: rgba(0, 0, 0, 0); 23 | --dark-placeholder-text-color: #7D7D7D; 24 | --light-placeholder-text-color: #7D7D7D; 25 | 26 | /* Colours used for custom buttons that don't have a border */ 27 | --dark-button-hover-focus-bg-color: #303030; 28 | --light-button-hover-focus-bg-color: #B2B2B2; 29 | --dark-button-active-bg-color: #484848; 30 | --light-button-active-bg-color: #8F8F8F; 31 | 32 | --divider-dark: #5F5F5F; 33 | --divider-light: #9A9A9A; 34 | 35 | --fixed-size: 0 0 auto; 36 | } 37 | 38 | .textInputBase{ 39 | background-color: initial; 40 | border-width: 2px; 41 | border-color: initial; 42 | border-radius: 4px; 43 | } 44 | 45 | .maskedText{ 46 | flex: auto; 47 | background-color: initial; 48 | border-width: 2px; 49 | border-color: initial; 50 | border-radius: 4px; 51 | } 52 | .maskedInput{ 53 | background-color: initial; 54 | padding-bottom: 2px; 55 | border-width: 2px; 56 | border-color: initial; 57 | border-radius: 4px; 58 | } 59 | 60 | .unity-masked-text-field__placeholder { 61 | align-self: center; 62 | position: absolute; 63 | margin: 0; 64 | padding-left: 5px; 65 | color: var(--dark-placeholder-text-color); 66 | } 67 | 68 | .hidden { 69 | display: none; 70 | } 71 | 72 | .unity-masked-text-field #unity-text-input { 73 | overflow: hidden; 74 | } 75 | -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Elements/BetterTextField/Style/MaskedInputField.uss.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b3851db4eb2105d14b9327f691b85635 3 | timeCreated: 1599914936 -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Enhancements.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 96d9c9647ce0248478c346ab44863afb 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Enhancements/Events.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 253d88577a2f7274580acc895f3ef118 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Enhancements/Events/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 78339b25202e64423b35f94a2e1933ae 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Enhancements/Tasks.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 273a1d1ea17f2044ab0cb98ed945ba55 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Enhancements/Tasks/ITaskSequence.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | 4 | namespace instance.id.EATK 5 | { 6 | public interface ITaskSequence : IEnumerable 7 | { 8 | // --| Add a task to the sequence ----------------- 9 | void Add(string text, Action task); 10 | 11 | // --| Run the task sequence ---------------------- 12 | void Run(string text, Action onCompleted); 13 | } 14 | 15 | 16 | // --| A class that manages type extension methods 17 | public static class ITaskSequenceExtended 18 | { 19 | // --| Add a task to the sequence ----------------- 20 | public static void Add(this ITaskSequence self, Action task) => self.Add(string.Empty, task); 21 | 22 | // --| Run the task sequence ---------------------- 23 | public static void Run(this ITaskSequence self) => self.Run(onCompleted: null); 24 | 25 | // --| Run the task sequence ---------------------- 26 | public static void Run(this ITaskSequence self, string text) => self.Run(text, null); 27 | 28 | // --| Run the task sequence ---------------------- 29 | public static void Run(this ITaskSequence self, Action onCompleted) => self.Run(string.Empty, onCompleted); 30 | 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Enhancements/Tasks/ITaskSequence.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 630a3d1152ec4f2b9e6bb347ae579fe0 3 | timeCreated: 1653451712 -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Enhancements/Tasks/SingleTask.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | 5 | namespace instance.id.EATK 6 | { 7 | public sealed class SingleTask : ITaskSequence 8 | { 9 | private readonly List> m_list = new List>(); 10 | private readonly bool m_isReuse; 11 | private bool m_isPlaying; 12 | 13 | public SingleTask() : this(false) { } 14 | public SingleTask(bool isReuse) => m_isReuse = isReuse; 15 | 16 | public void Add(string text, Action task) 17 | { 18 | if (task == null || m_isPlaying) return; 19 | m_list.Add(task); 20 | } 21 | 22 | public void Run(string text, Action onCompleted) 23 | { 24 | if (m_list.Count <= 0) 25 | { 26 | onCompleted?.Invoke(); 27 | return; 28 | } 29 | 30 | int count = 0; 31 | 32 | Action task = null; 33 | task = () => 34 | { 35 | if (m_list.Count <= count) 36 | { 37 | m_isPlaying = false; 38 | 39 | if (!m_isReuse) m_list.Clear(); 40 | onCompleted?.Invoke(); 41 | return; 42 | } 43 | 44 | Action nextTask = task; 45 | m_list[count++](() => 46 | { 47 | if (nextTask == null) return; 48 | nextTask(); 49 | nextTask = null; 50 | }); 51 | }; 52 | m_isPlaying = true; 53 | task(); 54 | } 55 | 56 | // --------------------------------------- GetEnumerator 57 | public IEnumerator GetEnumerator() 58 | { 59 | throw new NotImplementedException(); 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Enhancements/Tasks/SingleTask.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d9df67ee53c54fd98e7fc539365daf42 3 | timeCreated: 1653451712 -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Enhancements/Tasks/WaitUntil.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | 4 | namespace instance.id.EATK 5 | { 6 | public static class Wait 7 | { 8 | /// 9 | /// Blocks while condition is true or timeout occurs. 10 | /// 11 | /// The condition that will perpetuate the block. 12 | /// The frequency at which the condition will be check, in milliseconds. 13 | /// Timeout in milliseconds. 14 | /// 15 | /// 16 | public static async Task While(Func condition, int frequency = 25, int timeout = -1) 17 | { 18 | var waitTask = Task.Run(async () => 19 | { 20 | while (condition()) await Task.Delay(frequency); 21 | }); 22 | 23 | if (waitTask != await Task.WhenAny(waitTask, Task.Delay(timeout))) 24 | throw new TimeoutException(); 25 | } 26 | 27 | /// 28 | /// Blocks until condition is true or timeout occurs. 29 | /// 30 | /// The break condition. 31 | /// The frequency at which the condition will be checked. 32 | /// The timeout in milliseconds. 33 | /// 34 | public static async Task Until(Func condition, int frequency = 25, int timeout = -1) 35 | { 36 | var waitTask = Task.Run(async () => 37 | { 38 | while (!condition()) await Task.Delay(frequency); 39 | }); 40 | 41 | if (waitTask != await Task.WhenAny(waitTask, 42 | Task.Delay(timeout))) 43 | throw new TimeoutException(); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Enhancements/Tasks/WaitUntil.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 27a106d0a95a4084a0ab720ee51d5c7b 3 | timeCreated: 1653451712 -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bfa6ab8854e6c664c8915cb3b3d007af 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Scripts/Extensions.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 80d986d78639fcf42a7467673e3ab814 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Scripts/Extensions/AssetFileExtensions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 96ae55756c6b8df038ba1254b119d0e1 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Scripts/Extensions/CollectionExtensions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 234b6433887847034b56fa5d88c4aa5e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Scripts/Extensions/Color.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2ceacb1b4d8449408e97e1c52b70711f 3 | timeCreated: 1649209399 -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Scripts/Extensions/Color/ColorExtensions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0efa1d13cb18483c968b0b0e040df107 3 | timeCreated: 1649209399 -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Scripts/Extensions/Color/ColorTool.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.Globalization; 5 | using System.Linq; 6 | using System.Reflection; 7 | using UnityEngine; 8 | 9 | namespace instance.id.EATK.Extensions 10 | { 11 | public static class ColorTool 12 | { 13 | public static Dictionary KnownColors { get; private set; } 14 | 15 | static ColorTool() => Init(); 16 | 17 | /// 18 | /// Initialize the list of known colors so that we don't have to use reflection all the time. 19 | /// 20 | public static void Init() 21 | { 22 | Type t = typeof(Color); 23 | Type c = typeof(Colors); 24 | 25 | KnownColors = new Dictionary(); 26 | 27 | /* Find all public static properties and attempt to get a color out of them */ 28 | foreach (PropertyInfo prop in t.GetProperties(BindingFlags.Public | BindingFlags.Static)) 29 | { 30 | /* Make sure the property can return a color type */ 31 | if (prop.PropertyType == t) 32 | { 33 | string name = prop.Name.ToLowerInvariant(); 34 | Color color = (Color) prop.GetValue(null, null); 35 | KnownColors.Add(name, color); 36 | } 37 | } 38 | 39 | var type = typeof(Colors); 40 | var fields = type.GetFields().ToDictionary(f => f.Name, f => (Color) f.GetValue(f)); 41 | 42 | foreach (var color in fields) KnownColors.Add(color.Key, color.Value); 43 | } 44 | /// 45 | /// Allows you to convert either a known name or hexidecimal representation into a potential color object. 46 | /// 47 | /// 48 | /// 49 | public static Color ReadColor(string colorString) 50 | { 51 | colorString = colorString.ToLowerInvariant(); 52 | 53 | if (KnownColors.ContainsKey(colorString)) return KnownColors[colorString]; 54 | 55 | else if (colorString.Contains("#")) 56 | { 57 | int r, g, b, a = 0; 58 | var style = NumberStyles.HexNumber; 59 | 60 | colorString = colorString.Replace("#", ""); 61 | 62 | switch (colorString.Length) 63 | { 64 | case 3: 65 | /* rgb */ 66 | r = int.Parse(colorString.Substring(0, 1) + colorString.Substring(0, 1), style); 67 | g = int.Parse(colorString.Substring(1, 1) + colorString.Substring(1, 1), style); 68 | b = int.Parse(colorString.Substring(2, 1) + colorString.Substring(2, 1), style); 69 | return new Color(r, g, b); 70 | case 4: 71 | /* rgba */ 72 | r = int.Parse(colorString.Substring(0, 1) + colorString.Substring(0, 1), style); 73 | g = int.Parse(colorString.Substring(1, 1) + colorString.Substring(1, 1), style); 74 | b = int.Parse(colorString.Substring(2, 1) + colorString.Substring(2, 1), style); 75 | a = int.Parse(colorString.Substring(3, 1) + colorString.Substring(2, 1), style); 76 | return new Color(r, g, b, a); 77 | case 6: 78 | /* rrggbb */ 79 | r = int.Parse(colorString.Substring(0, 2), style); 80 | g = int.Parse(colorString.Substring(2, 2), style); 81 | b = int.Parse(colorString.Substring(4, 2), style); 82 | return new Color(r, g, b); 83 | case 8: 84 | /* rrggbbaa */ 85 | r = int.Parse(colorString.Substring(0, 2), style); 86 | g = int.Parse(colorString.Substring(2, 2), style); 87 | b = int.Parse(colorString.Substring(4, 2), style); 88 | a = int.Parse(colorString.Substring(6, 2), style); 89 | return new Color(r, g, b, a); 90 | default: 91 | throw new ArgumentException("Invalid hex string."); 92 | } 93 | } 94 | 95 | throw new ArgumentException("Invalid color string."); 96 | } 97 | 98 | /// 99 | /// Lua does not support overloads, so this utility class provides a special global function rgb(). 100 | /// 101 | public static Color ReadRGB(byte r, byte g, byte b) 102 | { 103 | return new Color(r, g, b); 104 | } 105 | 106 | 107 | /// 108 | /// Lua does not support overloads, so this utility class provides a special global function rgba(). 109 | /// 110 | public static Color ReadRGBA(byte r, byte g, byte b, byte alpha) 111 | { 112 | return new Color(r, g, b, alpha); 113 | } 114 | } 115 | } 116 | -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Scripts/Extensions/Color/ColorTool.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f582b502a340496a8e484875f123dab0 3 | timeCreated: 1649209399 -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Scripts/Extensions/Color/Colors.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0b45e7da69174ce6bfb766ce79cdd76a 3 | timeCreated: 1649209399 -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Scripts/Extensions/Color/GetColor.cs: -------------------------------------------------------------------------------- 1 | // using System; 2 | // using System.Globalization; 3 | // using UnityEngine; 4 | // 5 | // #if !USING_EATK 6 | // namespace instance.id.EATK.Extensions 7 | // { 8 | // // public static class GetColor 9 | // // { 10 | // // /// 11 | // // /// Converts a hexadecimal color string to a Unity RGBA Color value 12 | // // /// 13 | // // /// var color = GetColor.FromHex("#CCCCCC"); 14 | // // /// The string parameter must be a hexadecimal string, can beginning with # 15 | // // /// Returns a Unity Color parameter converted from a HTML/hexadecimal color string 16 | // // /// The string parameter must be a hexadecimal string beginning with # 17 | // // public static Color FromHex(this string color) 18 | // // { 19 | // // if (color.StartsWith("#")) color = color.Replace("#", ""); 20 | // // if (Int32.TryParse(color, NumberStyles.HexNumber, CultureInfo.CurrentCulture, out _)) 21 | // // if (!color.StartsWith("#")) 22 | // // color = $"#{color}"; 23 | // // 24 | // // ColorUtility.TryParseHtmlString(color, out var outColor); 25 | // // return outColor; 26 | // // } 27 | // // } 28 | // // } 29 | // 30 | // #else 31 | // namespace instance.id.Extensions 32 | // { 33 | // internal static class GetColor 34 | // { 35 | // /// 36 | // /// Converts a hexadecimal color string to a Unity RGBA Color value 37 | // /// 38 | // /// var color = GetColor.FromHex("#CCCCCC"); 39 | // /// The string parameter must be a hexadecimal string, can beginning with # 40 | // /// Returns a Unity Color parameter converted from a HTML/hexadecimal color string 41 | // /// The string parameter must be a hexadecimal string beginning with # 42 | // public static Color FromHex(this string color) 43 | // { 44 | // if (color.StartsWith("#")) color = color.Replace("#", ""); 45 | // if (Int32.TryParse(color, NumberStyles.HexNumber, CultureInfo.CurrentCulture, out _)) 46 | // if (!color.StartsWith("#")) 47 | // color = $"#{color}"; 48 | // 49 | // ColorUtility.TryParseHtmlString(color, out var outColor); 50 | // return outColor; 51 | // } 52 | // } 53 | // } 54 | // #endif 55 | -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Scripts/Extensions/Color/GetColor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d0e5bf698dbf4098a0cf4cadbda39f7f 3 | timeCreated: 1649209399 -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Scripts/Extensions/Color/MathEx.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace instance.id.EATK.Extensions 4 | { 5 | public static class MathEx 6 | { 7 | public static int Clamp(int v, int min, int max) 8 | { 9 | return (v < min) ? min : ((v > max) ? max : v); 10 | } 11 | 12 | public static float Clamp01(float v) 13 | { 14 | return (v < 0f) ? 0f : ((v > 1f) ? 1f : v); 15 | } 16 | 17 | public static double Clamp01(double v) 18 | { 19 | return (v < 0.0) ? 0.0 : ((v > 1.0) ? 1.0 : v); 20 | } 21 | 22 | public static float Clamp(float v, float min, float max) 23 | { 24 | return (v < min) ? min : ((v > max) ? max : v); 25 | } 26 | 27 | public static double Clamp(double v, double min, double max) 28 | { 29 | return (v < min) ? min : ((v > max) ? max : v); 30 | } 31 | 32 | public static float Lerp(float from, float to, float t) 33 | { 34 | return from + (to - from) * MathEx.Clamp01(t); 35 | } 36 | 37 | public static double Lerp(double from, double to, double t) 38 | { 39 | return from + (to - from) * MathEx.Clamp01(t); 40 | } 41 | 42 | public static float Repeat(float t, float length) 43 | { 44 | return t - (float)Math.Floor((double)(t / length)) * length; 45 | } 46 | 47 | public static double Repeat(double t, double length) 48 | { 49 | return t - Math.Floor(t / length) * length; 50 | } 51 | 52 | public static float LerpAngle(float a, float b, float t) 53 | { 54 | float num = MathEx.Repeat(b - a, 360f); 55 | bool flag = num <= 180f; 56 | if (!flag) 57 | { 58 | num -= 360f; 59 | } 60 | return a + num * MathEx.Clamp01(t); 61 | } 62 | 63 | public static double LerpAngle(double a, double b, double t) 64 | { 65 | double num = MathEx.Repeat(b - a, 360.0); 66 | bool flag = num <= 180.0; 67 | if (!flag) 68 | { 69 | num -= 360.0; 70 | } 71 | return a + num * MathEx.Clamp01(t); 72 | } 73 | 74 | public static float Distance(float a, float b) 75 | { 76 | return Math.Abs(a - b); 77 | } 78 | 79 | public static double Distance(double a, double b) 80 | { 81 | return Math.Abs(a - b); 82 | } 83 | 84 | public static int IsRange(float value, float min, float max) 85 | { 86 | return (value < min) ? -1 : ((value > max) ? 1 : 0); 87 | } 88 | 89 | public static int IsRange(double value, double min, double max) 90 | { 91 | return (value < min) ? -1 : ((value > max) ? 1 : 0); 92 | } 93 | 94 | public static float Max(float a, float b) 95 | { 96 | return (a <= b) ? b : a; 97 | } 98 | 99 | public static double Max(double a, double b) 100 | { 101 | return (a <= b) ? b : a; 102 | } 103 | 104 | public static float Min(float a, float b) 105 | { 106 | return (a <= b) ? a : b; 107 | } 108 | 109 | public static double Min(double a, double b) 110 | { 111 | return (a <= b) ? a : b; 112 | } 113 | 114 | public static bool Approximately(float a, float b) 115 | { 116 | return Math.Abs(b - a) < MathEx.Max(1E-06f * MathEx.Max(Math.Abs(a), Math.Abs(b)), 1.1E-44f); 117 | } 118 | 119 | public static bool Approximately(double a, double b) 120 | { 121 | return Math.Abs(b - a) < MathEx.Max(1E-06 * MathEx.Max(Math.Abs(a), Math.Abs(b)), 1.121039E-44); 122 | } 123 | } 124 | } 125 | -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Scripts/Extensions/Color/MathEx.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f83cea8d4b284726bcc6ef7a061e606e 3 | timeCreated: 1649209399 -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Scripts/Extensions/DataTypes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 66aacad204524d6ab7d721033af17792 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Scripts/Extensions/DataTypes/AnimColorStore.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using instance.id.EATK.Extensions; 3 | using UnityEngine; 4 | 5 | namespace instance.id.EATK 6 | { 7 | [Serializable] 8 | public class AnimColorStore 9 | { 10 | [SerializeField] public Color initial; 11 | [SerializeField] public Color final; 12 | [SerializeField] public int duration; 13 | [SerializeField] public int delay; 14 | 15 | public Action callback; 16 | public Action reverseCallback; 17 | 18 | public AnimColorStore(Color initial, Color final, int duration, int delay, Action callback = default, Action reverseCallback = default) 19 | { 20 | this.initial = initial; 21 | this.final = final; 22 | this.duration = duration; 23 | this.delay = delay; 24 | this.callback = callback; 25 | this.reverseCallback = reverseCallback; 26 | } 27 | 28 | public AnimColorStore(string initial, string final, int duration, int delay, Action callback = default, Action reverseCallback = default) 29 | { 30 | this.initial = initial.FromHex(); 31 | this.final = final.FromHex(); 32 | this.duration = duration; 33 | this.delay = delay; 34 | this.callback = callback; 35 | this.reverseCallback = reverseCallback; 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Scripts/Extensions/DataTypes/AnimColorStore.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 487dc27018d486c4ba849e561e577a64 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Scripts/Extensions/DataTypes/AnimTime.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace instance.id.EATK 5 | { 6 | [Serializable] 7 | public class AnimTime 8 | { 9 | public int startValue; 10 | public int duration; 11 | public int delay; 12 | [SerializeField] private Easing easing; 13 | 14 | public Func Easings => GetEasing.Get(easing); 15 | 16 | public AnimTime(int duration = default, int delay = default, Easing easing = Easing.InOutCubic) 17 | { 18 | this.duration = duration; 19 | this.delay = delay; 20 | this.easing = easing; 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Scripts/Extensions/DataTypes/AnimTime.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 64a1657286f5c5928b0e9d60f759cab7 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Scripts/Extensions/DataTypes/AnimValueStore.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6643fbce68193d724ad62ceeeaa1ad1f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Scripts/Extensions/DataTypes/AnimateElement.cs: -------------------------------------------------------------------------------- 1 | namespace instance.id.EATK 2 | { 3 | public enum AnimateElement 4 | { 5 | Custom = -2, // 0xFFFFFFFE 6 | Unknown = -1, // 0xFFFFFFFF 7 | Color = 0, 8 | FontSize = 1, 9 | UnityFont = 2, 10 | UnityFontStyleAndWeight = 3, 11 | UnityTextAlign = 4, 12 | Visibility = 5, 13 | WhiteSpace = 6, 14 | AlignContent = 65536, // 0x00010000 15 | AlignItems = 65537, // 0x00010001 16 | AlignSelf = 65538, // 0x00010002 17 | BackgroundColor = 65539, // 0x00010003 18 | BackgroundImage = 65540, // 0x00010004 19 | BorderBottomColor = 65541, // 0x00010005 20 | BorderBottomLeftRadius = 65542, // 0x00010006 21 | BorderBottomRightRadius = 65543, // 0x00010007 22 | BorderBottomWidth = 65544, // 0x00010008 23 | BorderLeftColor = 65545, // 0x00010009 24 | BorderLeftWidth = 65546, // 0x0001000A 25 | BorderRightColor = 65547, // 0x0001000B 26 | BorderRightWidth = 65548, // 0x0001000C 27 | BorderTopColor = 65549, // 0x0001000D 28 | BorderTopLeftRadius = 65550, // 0x0001000E 29 | BorderTopRightRadius = 65551, // 0x0001000F 30 | BorderTopWidth = 65552, // 0x00010010 31 | Bottom = 65553, // 0x00010011 32 | Cursor = 65554, // 0x00010012 33 | Display = 65555, // 0x00010013 34 | FlexBasis = 65556, // 0x00010014 35 | FlexDirection = 65557, // 0x00010015 36 | FlexGrow = 65558, // 0x00010016 37 | FlexShrink = 65559, // 0x00010017 38 | FlexWrap = 65560, // 0x00010018 39 | Height = 65561, // 0x00010019 40 | JustifyContent = 65562, // 0x0001001A 41 | Left = 65563, // 0x0001001B 42 | MarginBottom = 65564, // 0x0001001C 43 | MarginLeft = 65565, // 0x0001001D 44 | MarginRight = 65566, // 0x0001001E 45 | MarginTop = 65567, // 0x0001001F 46 | MaxHeight = 65568, // 0x00010020 47 | MaxWidth = 65569, // 0x00010021 48 | MinHeight = 65570, // 0x00010022 49 | MinWidth = 65571, // 0x00010023 50 | Opacity = 65572, // 0x00010024 51 | Overflow = 65573, // 0x00010025 52 | PaddingBottom = 65574, // 0x00010026 53 | PaddingLeft = 65575, // 0x00010027 54 | PaddingRight = 65576, // 0x00010028 55 | PaddingTop = 65577, // 0x00010029 56 | Position = 65578, // 0x0001002A 57 | Right = 65579, // 0x0001002B 58 | TextOverflow = 65580, // 0x0001002C 59 | Top = 65581, // 0x0001002D 60 | UnityBackgroundImageTintColor = 65582, // 0x0001002E 61 | UnityBackgroundScaleMode = 65583, // 0x0001002F 62 | UnityOverflowClipBox = 65584, // 0x00010030 63 | UnitySliceBottom = 65585, // 0x00010031 64 | UnitySliceLeft = 65586, // 0x00010032 65 | UnitySliceRight = 65587, // 0x00010033 66 | UnitySliceTop = 65588, // 0x00010034 67 | UnityTextOverflowPosition = 65589, // 0x00010035 68 | Width = 65590, // 0x00010036 69 | BorderColor = 131072, // 0x00020000 70 | BorderRadius = 131073, // 0x00020001 71 | BorderWidth = 131074, // 0x00020002 72 | Flex = 131075, // 0x00020003 73 | Margin = 131076, // 0x00020004 74 | Padding = 131077, // 0x00020005 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Scripts/Extensions/DataTypes/AnimateElement.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 967ad09357d34ea638cbe4c5b640e435 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Scripts/Extensions/DataTypes/AnimatedItems.cs: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // -- Project : https://github.com/instance-id/ProjectSetup -- 3 | // -- instance.id 2020 | http://github.com/instance-id | http://instance.id -- 4 | // ---------------------------------------------------------------------------- 5 | 6 | using System.Collections.Generic; 7 | using UnityEngine.UIElements; 8 | using UnityEngine.UIElements.Experimental; 9 | 10 | namespace instance.id.EATK 11 | { 12 | public class AnimatedItems 13 | { 14 | private string elementName; 15 | private VisualElement element; 16 | private List> animatedItemList; 17 | private ValueAnimation[] animatedItemArray; 18 | 19 | // -- Default to allowing the animation to run, but allows for manually 20 | // -- setting false to prevent animation from running until set back to true 21 | private bool allowRun = true; 22 | 23 | // --------------------------------------------------- Constructor 24 | // --------------------------------------------------------------- 25 | public AnimatedItems(VisualElement ele) 26 | { 27 | element = ele; 28 | elementName = ele.name; 29 | animatedItemList = new List>(); 30 | } 31 | 32 | public void CopyToArray() => animatedItemArray = animatedItemList.ToArray(); 33 | 34 | // ---------------------------------------------------- Properties 35 | // --------------------------------------------------------------- 36 | public string ElementName 37 | { 38 | get => elementName; 39 | set => elementName = value; 40 | } 41 | 42 | public VisualElement Element 43 | { 44 | get => element; 45 | set => element = value; 46 | } 47 | 48 | public List> AnimatedItemList 49 | { 50 | get => animatedItemList; 51 | set => animatedItemList = value; 52 | } 53 | 54 | public ValueAnimation[] AnimatedItemArray 55 | { 56 | get => animatedItemArray; 57 | set => animatedItemArray = value; 58 | } 59 | 60 | public bool AllowRun 61 | { 62 | get => allowRun; 63 | set => allowRun = value; 64 | } 65 | } 66 | 67 | public class AnimatedItems : AnimatedItems 68 | { 69 | private EventCallback eventCallback; 70 | public EventCallback EventCallback 71 | { 72 | get => eventCallback; 73 | set => eventCallback = value; 74 | } 75 | 76 | private List> eventCallbacks; 77 | public List> EventCallbacks 78 | { 79 | get => eventCallbacks; 80 | set => eventCallbacks = value; 81 | } 82 | 83 | public AnimatedItems(VisualElement ele) : base(ele) { } 84 | } 85 | 86 | public class AnimatedItems : AnimatedItems 87 | { 88 | private (EventCallback mouseOverEvent, EventCallback mouseOutEvent) eventCallbacks; 89 | public (EventCallback mouseOverEvent, EventCallback mouseOutEvent) EventCallbacks 90 | { 91 | get => eventCallbacks; 92 | set => eventCallbacks = value; 93 | } 94 | 95 | public AnimatedItems(VisualElement ele) : base(ele) { } 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Scripts/Extensions/DataTypes/AnimatedItems.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bf3ca64982bf4a8dbec161e4c76910dd 3 | timeCreated: 1606144523 -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Scripts/Extensions/DataTypes/ClassData.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace instance.id.EATK.Extensions 6 | { 7 | [Serializable] 8 | public class ClassData : ClassData where T : Attribute, new() 9 | { 10 | [SerializeField] public List fieldList = new List(); 11 | public new Dictionary> fieldDatas = new Dictionary>(); 12 | 13 | public ClassData(Type type) : base(type) { } 14 | } 15 | 16 | [Serializable] 17 | public class ClassData 18 | { 19 | [SerializeField] public string typeName; 20 | public Dictionary fieldDatas = new Dictionary(); 21 | public ClassData(Type type) => typeName = type.Name; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Scripts/Extensions/DataTypes/ClassData.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e516142a2bc80d0cdbda05ef7f6209e3 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Scripts/Extensions/DataTypes/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7fc13d4ea4ef73f55811362ad006d438 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Scripts/Extensions/DataTypes/Editor/SerializedDictionaryEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9d633161def743a4b8c92bdc925f8274 3 | timeCreated: 1656799054 -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Scripts/Extensions/DataTypes/FieldData.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Reflection; 5 | using UnityEngine; 6 | 7 | namespace instance.id.EATK.Extensions 8 | { 9 | [Serializable] 10 | public class FieldData : FieldData where T : Attribute, new() 11 | { 12 | [SerializeField] public T attributeData; 13 | 14 | public FieldData(FieldInfo fieldInfo) : base(fieldInfo) 15 | { 16 | CheckForAttributes(fieldInfo); 17 | } 18 | 19 | public FieldData() : base() 20 | { 21 | CheckForAttributes(fieldInfo); 22 | } 23 | 24 | private void CheckForAttributes(FieldInfo fieldInfo) 25 | { 26 | var catAttrib = (T)Attribute.GetCustomAttribute(fieldInfo ?? throw new ArgumentNullException(nameof(fieldInfo)), typeof(T)); 27 | attributeData = catAttrib ?? new T(); 28 | } 29 | } 30 | 31 | [Serializable] 32 | public class FieldData 33 | { 34 | public Type fieldType; 35 | public FieldInfo fieldInfo; 36 | [SerializeField] public string name; 37 | [SerializeField] public string fieldTypeString; 38 | [SerializeField] public List fieldTypeParametersString; 39 | [SerializeField] public List fieldTypeParameters; 40 | 41 | public FieldData() { } 42 | 43 | public FieldData(FieldInfo fieldInfo) 44 | { 45 | this.fieldInfo = fieldInfo; 46 | name = fieldInfo.Name; 47 | fieldType = fieldInfo.FieldType; 48 | fieldTypeString = fieldInfo.FieldType.GetRealTypeName(); 49 | fieldTypeParameters = fieldInfo.FieldType 50 | .GetGenericArguments() 51 | .Select(x => x) 52 | .ToList(); 53 | 54 | fieldTypeParametersString = fieldInfo.FieldType 55 | .GetGenericArguments() 56 | .Select(x => x.Name.ToString()) 57 | .ToList(); 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Scripts/Extensions/DataTypes/FieldData.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: aebf2779aa04383d2a621c8a3da09d71 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Scripts/Extensions/DataTypes/GetEasing.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace instance.id.EATK 4 | { 5 | public enum Easing 6 | { 7 | Step, Linear, InSine, OutSine, InOutSine, InQuad, OutQuad, OutExpo, InOutQuad, InCubic, 8 | OutCubic, InOutCubic, InPower, OutPower, InOutPower, InBounce, OutBounce, InOutBounce, 9 | InElastic, OutElastic, InOutElastic, InBack, OutBack, InOutBack, InCirc, OutCirc, 10 | InOutCirc, EaseInOutQuint 11 | } 12 | 13 | [Serializable] public abstract class GetEasing 14 | { 15 | public static Func Get(Easing easingType) 16 | { 17 | switch (easingType) 18 | { 19 | case Easing.Step: return Easy.Step; 20 | case Easing.Linear: return Easy.Linear; 21 | case Easing.InSine: return Easy.InSine; 22 | case Easing.OutSine: return Easy.OutSine; 23 | case Easing.InOutSine: return Easy.InOutSine; 24 | case Easing.InQuad: return Easy.InQuad; 25 | case Easing.OutQuad: return Easy.OutQuad; 26 | case Easing.OutExpo: return Easy.OutExpo; 27 | case Easing.InOutQuad: return Easy.InOutQuad; 28 | case Easing.InCubic: return Easy.InCubic; 29 | case Easing.OutCubic: return Easy.OutCubic; 30 | case Easing.InOutCubic: return Easy.InOutCubic; 31 | case Easing.InBounce: return Easy.InBounce; 32 | case Easing.OutBounce: return Easy.OutBounce; 33 | case Easing.InOutBounce: return Easy.InOutBounce; 34 | case Easing.InElastic: return Easy.InElastic; 35 | case Easing.OutElastic: return Easy.OutElastic; 36 | case Easing.InOutElastic: return Easy.InOutElastic; 37 | case Easing.InBack: return Easy.InBack; 38 | case Easing.OutBack: return Easy.OutBack; 39 | case Easing.InOutBack: return Easy.InOutBack; 40 | case Easing.InCirc: return Easy.InCirc; 41 | case Easing.OutCirc: return Easy.OutCirc; 42 | case Easing.InOutCirc: return Easy.InOutCirc; 43 | case Easing.EaseInOutQuint: return Easy.EaseInOutQuint; 44 | // case Easing.InPower: return e = floatVal => Easy.InPower(floatVal); break; 45 | // case Easing.OutPower: return e = floatVal => Easy.OutPower(floatVal); break; 46 | // case Easing.InOutPower: return e = floatVal => Easy.InOutPower(floatVal); break; 47 | default: throw new ArgumentOutOfRangeException(); 48 | } 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Scripts/Extensions/DataTypes/GetEasing.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 730e50ff334902f1ba14575a0c010dd4 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Scripts/Extensions/DataTypes/ImageAsset.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using UnityEngine; 3 | 4 | namespace instance.id.EATK 5 | { 6 | #if IS_DEV 7 | [CreateAssetMenu(fileName = "ImageAsset.asset", menuName = "instance.id/ProStream/Collections/ImageAsset", order = 0)] 8 | #endif 9 | public class ImageAsset : AssetInstance 10 | { 11 | public Texture2D[] imageFrames; 12 | public readonly Dictionary imageLookup = new Dictionary(); 13 | 14 | private void OnEnable() 15 | { 16 | imageLookup.Clear(); 17 | for (int i = 0; i < imageFrames.Length; i++) 18 | { 19 | imageLookup.TryAdd(imageFrames[i].name, imageFrames[i]); 20 | } 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Scripts/Extensions/DataTypes/ImageAsset.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 515440d9a8bde968bacafe986cbf4744 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Scripts/Extensions/DataTypes/ListPool.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace instance.id.EATK.Extensions 5 | { 6 | public static class ListPool 7 | { 8 | private static readonly object @lock = new object(); 9 | private static readonly Stack> free = new Stack>(); 10 | private static readonly HashSet> busy = new HashSet>(); 11 | 12 | public static List New() 13 | { 14 | lock (@lock) 15 | { 16 | if (free.Count == 0) 17 | { 18 | free.Push(new List()); 19 | } 20 | 21 | var list = free.Pop(); 22 | 23 | busy.Add(list); 24 | 25 | return list; 26 | } 27 | } 28 | 29 | public static void Free(List list) 30 | { 31 | lock (@lock) 32 | { 33 | if (!busy.Remove(list)) 34 | { 35 | throw new ArgumentException("The list to free is not in use by the pool.", nameof(list)); 36 | } 37 | 38 | list.Clear(); 39 | 40 | free.Push(list); 41 | } 42 | } 43 | } 44 | 45 | public static class XListPool 46 | { 47 | public static List ToListPooled(this IEnumerable source) 48 | { 49 | var list = ListPool.New(); 50 | 51 | foreach (var item in source) 52 | { 53 | list.Add(item); 54 | } 55 | 56 | return list; 57 | } 58 | 59 | public static void Free(this List list) 60 | { 61 | ListPool.Free(list); 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Scripts/Extensions/DataTypes/ListPool.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: acf2ea081c624d7085363db9c33dc6c8 3 | timeCreated: 1648266079 -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Scripts/Extensions/DataTypes/SerializedDictionary.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace instance.id.EATK 6 | { 7 | [Serializable] 8 | public class SerializedDictionary : Dictionary, ISerializationCallbackReceiver 9 | { 10 | public bool isCustomEditor = false; 11 | public const string KeyProperty = nameof(_keys); 12 | public const string ValueProperty = nameof(_values); 13 | 14 | [SerializeField] internal List> serializedData 15 | = new List>(); 16 | [SerializeField] internal KeyType editorAddKey; 17 | [SerializeField] internal TValue editorAddValue; 18 | 19 | // These are protected so they can be found by the editor. 20 | [SerializeField] protected List _keys = new List(); 21 | [SerializeField] protected List _values = new List(); // @formatter:off 22 | 23 | public SerializedDictionary() { } 24 | public SerializedDictionary(IDictionary dictionary) // @formatter:on 25 | { 26 | if (dictionary != null) 27 | foreach (KeyValuePair keyValuePair in (IEnumerable>) dictionary) 28 | this.Add(keyValuePair.Key, keyValuePair.Value); 29 | } 30 | 31 | public SerializedDictionary(IDictionary dictionary, IEqualityComparer comparer) 32 | { 33 | if (dictionary != null) 34 | foreach (KeyValuePair keyValuePair in (IEnumerable>) dictionary) 35 | this.Add(keyValuePair.Key, keyValuePair.Value); 36 | } 37 | 38 | 39 | void ISerializationCallbackReceiver.OnBeforeSerialize() => ConvertToLists(); 40 | void ISerializationCallbackReceiver.OnAfterDeserialize() => ConvertFromLists(); 41 | 42 | private void ConvertToLists() 43 | { 44 | _keys.Clear(); 45 | _values.Clear(); 46 | serializedData.Clear(); 47 | 48 | foreach (var entry in this) 49 | { 50 | _keys.Add(entry.Key); 51 | _values.Add(entry.Value); 52 | serializedData.Add(new SerializedKeyValuePair(entry.Key, entry.Value)); 53 | } 54 | } 55 | 56 | private void ConvertFromLists() // @formatter:off 57 | { 58 | Clear(); 59 | 60 | var count = Math.Min(_keys.Count, _values.Count); 61 | var failed = 0; 62 | try { for (var i = 0; i < count; i++) { failed = i; Add(_keys[i], _values[i]); } } 63 | catch (Exception e) { Debug.Log(e.ToString()); throw; } 64 | } // @formatter:on 65 | } 66 | 67 | [Serializable] 68 | public struct SerializedKeyValuePair 69 | { 70 | public TKey Key; 71 | public TValue Value; 72 | 73 | public SerializedKeyValuePair(TKey key, TValue value) 74 | { 75 | this.Key = key; 76 | this.Value = value; 77 | } 78 | 79 | public static implicit operator KeyValuePair(SerializedKeyValuePair data) => new KeyValuePair(data.Key, data.Value); 80 | public static implicit operator SerializedKeyValuePair(KeyValuePair data) => new SerializedKeyValuePair(data.Key, data.Value); 81 | 82 | public override string ToString() => $"key: {Key}, value: {Value}"; 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Scripts/Extensions/DataTypes/SerializedDictionary.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0b237ebfdc4e5db88af8faf7091e6ec9 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Scripts/Extensions/DataTypes/VersionElement.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e02365e5586418a72b2565979a6d712d 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/instance.id/ElementAnimationToolkit/Runtime/Scripts/Extensions/DataTypes/VersionElement/VersionElement.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | using UnityEngine.UIElements; 4 | 5 | namespace instance.id.EATK.Extensions 6 | { 7 | /// 8 | /// Visual Element to display a semantic version number with MAJOR.MINOR.PATCH format consisting of a row of three text input fields separated by dots. 9 | /// 10 | [Serializable] 11 | public class VersionElement : VisualElement 12 | { 13 | private Label label; 14 | private TextField majorField; 15 | private TextField minorField; 16 | private TextField patchField; 17 | 18 | private Version _version = new Version(); 19 | private Vector3 internalValue; 20 | 21 | public Version Value 22 | { 23 | set => _version = value; 24 | get => _version; 25 | } 26 | 27 | public VersionElement(string label = default) 28 | { 29 | // Initialize TextFields with labels 30 | majorField = new TextField("Major"); 31 | minorField = new TextField("Minor"); 32 | patchField = new TextField("Patch"); 33 | 34 | this.label = new Label(label).ToUSS("versionElementLabel"); 35 | this.label.style.alignSelf = new StyleEnum(Align.Center); 36 | 37 | new VisualElement().CreateRow(out var versionElementFieldContainer).ToUSS(nameof(versionElementFieldContainer), "containerRow").AddAll(new VisualElement[] 38 | { 39 | majorField, minorField, patchField 40 | }); 41 | versionElementFieldContainer.style.paddingRight = 0; 42 | 43 | new VisualElement().CreateRow(out var versionElementContainer).ToUSS(nameof(versionElementContainer), "containerRow").AddAll(new VisualElement[] 44 | { 45 | this.label, 46 | versionElementFieldContainer 47 | }); 48 | versionElementContainer.style.paddingRight = 0; 49 | versionElementContainer.style.justifyContent = new StyleEnum(Justify.FlexEnd); 50 | 51 | // Add TextFields to the VisualElement 52 | Add(versionElementContainer); 53 | 54 | // Register value changed events 55 | majorField.RegisterValueChangedCallback(OnValueChanged); 56 | minorField.RegisterValueChangedCallback(OnValueChanged); 57 | patchField.RegisterValueChangedCallback(OnValueChanged); 58 | 59 | versionElementFieldContainer.Query