From 6a0a71f22059b5041764cff38e2d1a2a8819ce76 Mon Sep 17 00:00:00 2001 From: Felipe Date: Thu, 21 Sep 2023 00:12:28 +0100 Subject: [PATCH] [Chore] Unity project with UPM embedded structure Also: [VSCode] - Migrate to use the new extension "visualstudiotoolsforunity.vstuc" - Added a default Unity editor debug configuration to `.vscode/launch.json` [WebGL] - Refactoring to a more "vanilla" Javascript approach using a `Vibration` singleton class - Added `IsVibrateSupported()` method to main `.jslib` - Added `repeat` parameter to `VibrateWithPattern()` method on main `.jslib` - Added a package.json file to the root embedded Unity project, to run and test WebGL builds [Android] - Added a generic static C# class for `AndroidBuild` to get Android API level [Unity/C#] - Refactorings to better accomplish the scene example script `VibrationExample.cs` - Added Editor unit tests in order to test `MobileTimeUnit.cs` class - Refactoring on `Samples/VibrationExample` to consider use WebGL implementations as well --- .github/scripts/functions.sh | 72 ++ .github/workflows/main.yml | 63 +- .gitignore | 224 ++++- .idea/.idea.Vibration/.idea/.gitignore | 13 + .idea/.idea.Vibration/.idea/vcs.xml | 6 + .vscode/extensions.json | 3 +- .vscode/launch.json | 10 + .../lib/consumer-rules.pro => Assets/.gitkeep | 0 MobileProjects~/Android/.idea/.name | 1 - .../Android/.idea/codeStyles/Project.xml | 122 --- .../.idea/codeStyles/codeStyleConfig.xml | 5 - .../Android/.idea/jarRepositories.xml | 30 - MobileProjects~/Android/.idea/misc.xml | 9 - .../com.benoitfreslon.vibration/.gitignore | 72 ++ .../MobileProjects~}/Android/.gitignore | 8 +- .../MobileProjects~/Android/README.md | 7 + .../MobileProjects~}/Android/app/.gitignore | 2 +- .../MobileProjects~}/Android/app/build.gradle | 136 +-- .../Android/app}/proguard-rules.pro | 42 +- .../plugin/ExampleInstrumentedTest.kt | 48 +- .../Android/app/src/main/AndroidManifest.xml | 42 +- .../vibrations/plugin/views/MainActivity.kt | 0 .../vibrations/plugin/views/MainViewModel.kt | 0 .../drawable-v24/ic_launcher_foreground.xml | 58 +- .../res/drawable/ic_launcher_background.xml | 340 +++---- .../app/src/main/res/layout/activity_main.xml | 120 +-- .../res/mipmap-anydpi-v26/ic_launcher.xml | 8 +- .../mipmap-anydpi-v26/ic_launcher_round.xml | 8 +- .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin .../res/mipmap-hdpi/ic_launcher_round.png | Bin .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin .../res/mipmap-mdpi/ic_launcher_round.png | Bin .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin .../res/mipmap-xhdpi/ic_launcher_round.png | Bin .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin .../res/mipmap-xxhdpi/ic_launcher_round.png | Bin .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin .../res/mipmap-xxxhdpi/ic_launcher_round.png | Bin .../app/src/main/res/values/colors.xml | 12 +- .../app/src/main/res/values/strings.xml | 8 +- .../app/src/main/res/values/styles.xml | 22 +- .../vibrations/plugin/ExampleUnitTest.kt | 34 +- .../MobileProjects~}/Android/build.gradle | 80 +- .../Android/gradle.properties | 48 +- .../Android/gradle/wrapper/gradle-wrapper.jar | Bin .../gradle/wrapper/gradle-wrapper.properties | 12 +- .../MobileProjects~}/Android/gradlew | 0 .../MobileProjects~}/Android/gradlew.bat | 168 ++-- .../MobileProjects~}/Android/lib/.gitignore | 2 +- .../MobileProjects~}/Android/lib/build.gradle | 110 +-- .../Android/lib/consumer-rules.pro | 0 .../Android/lib}/proguard-rules.pro | 42 +- .../com/benoitfreslon/unity/vibrations.meta | 0 .../benoitfreslon/unity/vibrations/lib.meta | 0 .../vibrations/lib/ExampleInstrumentedTest.kt | 48 +- .../lib/ExampleInstrumentedTest.kt.meta | 0 .../vibrations/lib/EnumExtensionsTest.kt | 0 .../MobileProjects~}/Android/settings.gradle | 6 +- .../MobileProjects~/iOS}/.gitignore | 51 +- .../MobileProjects~/iOS/README.md | 3 + .../com.benoitfreslon.vibration/Runtime.meta | 0 .../Runtime}/Plugins.meta | 2 +- .../Runtime}/Plugins/Android.meta | 0 .../Plugins/Android/AndroidManifest.xml | 8 +- .../Plugins/Android/AndroidManifest.xml.meta | 0 .../Plugins/Android/gradleTemplate.properties | 0 .../Android/gradleTemplate.properties.meta | 0 .../Runtime}/Plugins/Android/java.meta | 0 .../Runtime}/Plugins/Android/java/com.meta | 0 .../Android/java/com/benoitfreslon.meta | 0 .../Android/java/com/benoitfreslon/unity.meta | 0 .../com/benoitfreslon/unity/vibrations.meta | 0 .../benoitfreslon/unity/vibrations/lib.meta | 0 .../unity/vibrations/lib/Vibration.kt | 506 +++++----- .../unity/vibrations/lib/Vibration.kt.meta | 0 .../unity/vibrations/lib/entities.meta | 0 .../vibrations/lib/entities/HapticData.kt | 0 .../lib/entities/HapticData.kt.meta | 0 .../vibrations/lib/entities/HapticPattern.kt | 10 +- .../lib/entities/HapticPattern.kt.meta | 0 .../unity/vibrations/lib/entities/README.md | 0 .../vibrations/lib/entities/README.md.meta | 0 .../lib/entities/VibrationResult.kt | 0 .../lib/entities/VibrationResult.kt.meta | 0 .../unity/vibrations/lib/enums.meta | 0 .../vibrations/lib/enums/IVibrationType.kt | 0 .../lib/enums/IVibrationType.kt.meta | 0 .../vibrations/lib/enums/VibrationRepeat.kt | 0 .../lib/enums/VibrationRepeat.kt.meta | 0 .../vibrations/lib/enums/VibrationType.kt | 0 .../lib/enums/VibrationType.kt.meta | 0 .../unity/vibrations/lib/extended.meta | 0 .../lib/extended/VibrationExtended.kt | 5 +- .../lib/extended/VibrationExtended.kt.meta | 0 .../vibrations/lib/extended/entities.meta | 0 .../extended/entities/HapticDataExtended.kt | 0 .../entities/HapticDataExtended.kt.meta | 0 .../unity/vibrations/lib/extended/enums.meta | 0 .../extended/enums/VibrationTypeExtended.kt | 0 .../enums/VibrationTypeExtended.kt.meta | 0 .../unity/vibrations/lib/extensions.meta | 0 .../lib/extensions/AudioAttributes.kt | 0 .../lib/extensions/AudioAttributes.kt.meta | 0 .../unity/vibrations/lib/extensions/Enum.kt | 0 .../vibrations/lib/extensions/Enum.kt.meta | 0 .../lib/extensions/VibrationAttributes.kt | 0 .../extensions/VibrationAttributes.kt.meta | 0 .../vibrations/lib/extensions/Vibrator.kt | 0 .../lib/extensions/Vibrator.kt.meta | 0 .../vibrations/lib/extensions/functions.meta | 0 .../functions/VibrationFunctions.kt | 0 .../functions/VibrationFunctions.kt.meta | 0 .../Runtime}/Plugins/WebGL.meta | 0 .../Runtime}/Plugins/WebGL/Lib.meta | 0 .../Plugins/WebGL/Lib/global_functions.jspre | 0 .../WebGL/Lib/global_functions.jspre.meta | 0 .../Plugins/WebGL/Lib/vibration_library.jspre | 156 ++- .../WebGL/Lib/vibration_library.jspre.meta | 0 .../Runtime}/Plugins/WebGL/README.md | 0 .../Runtime}/Plugins/WebGL/README.md.meta | 0 .../Runtime/Plugins/WebGL/vibration.jslib | 60 ++ .../Plugins/WebGL/vibration.jslib.meta | 0 .../Runtime}/Plugins/iOS.meta | 0 .../Runtime}/Plugins/iOS/Vibration.meta | 0 .../Plugins/iOS/Vibration/Vibration.h | 0 .../Plugins/iOS/Vibration/Vibration.h.meta | 0 .../Plugins/iOS/Vibration/Vibration.mm | 0 .../Plugins/iOS/Vibration/Vibration.mm.meta | 0 .../Runtime/Resources.meta | 8 + .../Runtime/Resources/ScriptableObjects.meta | 0 .../ScriptableObjects}/ConfigOptions.asset | 0 .../ConfigOptions.asset.meta | 0 .../Runtime/Scripts.meta | 8 + .../Runtime/Scripts}/Enums.meta | 0 .../Runtime/Scripts}/Enums/Enumeration.cs | 15 + .../Scripts}/Enums/Enumeration.cs.meta | 0 .../Runtime/Scripts}/Enums/MobileTimeUnit.cs | 32 +- .../Scripts}/Enums/MobileTimeUnit.cs.meta | 0 .../Runtime/Scripts}/Enums/VibrationRepeat.cs | 0 .../Scripts}/Enums/VibrationRepeat.cs.meta | 0 .../Runtime/Scripts}/Enums/VibrationType.cs | 0 .../Scripts}/Enums/VibrationType.cs.meta | 0 .../Runtime/Scripts/Mobile.meta | 8 + .../Runtime/Scripts/Mobile/AndroidBuild.cs | 71 ++ .../Scripts/Mobile/AndroidBuild.cs.meta | 11 + .../Runtime/Scripts}/Save.meta | 0 .../Runtime/Scripts}/Save/Options.cs | 30 +- .../Runtime/Scripts}/Save/Options.cs.meta | 0 .../Runtime/Scripts}/Vibration.cs | 206 ++-- .../Runtime/Scripts}/Vibration.cs.meta | 0 .../Runtime/Scripts}/VibrationComponent.cs | 874 +++++++++-------- .../Scripts}/VibrationComponent.cs.meta | 0 .../Runtime}/Vibration.asmdef | 0 .../Runtime}/Vibration.asmdef.meta | 0 .../com.benoitfreslon.vibration/Samples.meta | 0 .../Samples/Vibration.Samples.asmref | 3 + .../Samples/Vibration.Samples.asmref.meta | 7 + .../Samples}/VibrationExample.meta | 0 .../VibrationExample/VibrationExample.cs | 83 ++ .../VibrationExample/VibrationExample.cs.meta | 0 .../VibrationExample/VibrationExample.unity | 132 ++- .../VibrationExample.unity.meta | 0 .../com.benoitfreslon.vibration/Tests.meta | 8 + .../Tests/Editor.meta | 8 + .../Tests/Editor/MobileTimeUnitTest.cs | 91 ++ .../Tests/Editor/MobileTimeUnitTest.cs.meta | 11 + .../Editor/Vibration.Editor.Tests.asmdef | 21 + .../Editor/Vibration.Editor.Tests.asmdef.meta | 7 + .../com.benoitfreslon.vibration/package.json | 20 + .../package.json.meta | 0 Packages/manifest.json | 45 + Packages/packages-lock.json | 465 +++++++++ ProjectSettings/AudioManager.asset | 19 + ProjectSettings/BurstAotSettings_WebGL.json | 16 + ProjectSettings/ClusterInputManager.asset | 6 + ProjectSettings/CommonBurstAotSettings.json | 6 + ProjectSettings/DynamicsManager.asset | 37 + ProjectSettings/EditorBuildSettings.asset | 11 + ProjectSettings/EditorSettings.asset | 40 + ProjectSettings/GraphicsSettings.asset | 64 ++ ProjectSettings/InputManager.asset | 487 ++++++++++ ProjectSettings/MemorySettings.asset | 35 + ProjectSettings/NavMeshAreas.asset | 93 ++ ProjectSettings/NetworkManager.asset | 8 + ProjectSettings/PackageManagerSettings.asset | 44 + ProjectSettings/Physics2DSettings.asset | 56 ++ ProjectSettings/PresetManager.asset | 7 + ProjectSettings/ProjectSettings.asset | 895 ++++++++++++++++++ ProjectSettings/ProjectVersion.txt | 2 + ProjectSettings/QualitySettings.asset | 239 +++++ ProjectSettings/SceneTemplateSettings.json | 167 ++++ ProjectSettings/TagManager.asset | 43 + ProjectSettings/TimeManager.asset | 9 + ProjectSettings/UnityConnectSettings.asset | 36 + ProjectSettings/VFXManager.asset | 14 + ProjectSettings/VersionControlSettings.asset | 8 + ProjectSettings/XRSettings.asset | 10 + Runtime/Plugins/WebGL/vibration.jslib | 70 -- Samples/VibrationExample/VibrationExample.cs | 85 -- package-lock.json | 455 +++++++++ package.json | 40 +- 201 files changed, 6140 insertions(+), 1868 deletions(-) create mode 100755 .github/scripts/functions.sh create mode 100644 .idea/.idea.Vibration/.idea/.gitignore create mode 100644 .idea/.idea.Vibration/.idea/vcs.xml create mode 100644 .vscode/launch.json rename MobileProjects~/Android/lib/consumer-rules.pro => Assets/.gitkeep (100%) delete mode 100644 MobileProjects~/Android/.idea/.name delete mode 100644 MobileProjects~/Android/.idea/codeStyles/Project.xml delete mode 100644 MobileProjects~/Android/.idea/codeStyles/codeStyleConfig.xml delete mode 100644 MobileProjects~/Android/.idea/jarRepositories.xml delete mode 100644 MobileProjects~/Android/.idea/misc.xml create mode 100644 Packages/com.benoitfreslon.vibration/.gitignore rename {MobileProjects~ => Packages/com.benoitfreslon.vibration/MobileProjects~}/Android/.gitignore (86%) create mode 100644 Packages/com.benoitfreslon.vibration/MobileProjects~/Android/README.md rename {MobileProjects~ => Packages/com.benoitfreslon.vibration/MobileProjects~}/Android/app/.gitignore (87%) rename {MobileProjects~ => Packages/com.benoitfreslon.vibration/MobileProjects~}/Android/app/build.gradle (96%) rename {MobileProjects~/Android/lib => Packages/com.benoitfreslon.vibration/MobileProjects~/Android/app}/proguard-rules.pro (97%) rename {MobileProjects~ => Packages/com.benoitfreslon.vibration/MobileProjects~}/Android/app/src/androidTest/java/com/benoitfreslon/unity/vibrations/plugin/ExampleInstrumentedTest.kt (96%) rename {MobileProjects~ => Packages/com.benoitfreslon.vibration/MobileProjects~}/Android/app/src/main/AndroidManifest.xml (97%) rename {MobileProjects~ => Packages/com.benoitfreslon.vibration/MobileProjects~}/Android/app/src/main/java/com/benoitfreslon/unity/vibrations/plugin/views/MainActivity.kt (100%) rename {MobileProjects~ => Packages/com.benoitfreslon.vibration/MobileProjects~}/Android/app/src/main/java/com/benoitfreslon/unity/vibrations/plugin/views/MainViewModel.kt (100%) rename {MobileProjects~ => Packages/com.benoitfreslon.vibration/MobileProjects~}/Android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml (98%) rename {MobileProjects~ => Packages/com.benoitfreslon.vibration/MobileProjects~}/Android/app/src/main/res/drawable/ic_launcher_background.xml (97%) rename {MobileProjects~ => Packages/com.benoitfreslon.vibration/MobileProjects~}/Android/app/src/main/res/layout/activity_main.xml (97%) rename {MobileProjects~ => Packages/com.benoitfreslon.vibration/MobileProjects~}/Android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml (98%) rename {MobileProjects~ => Packages/com.benoitfreslon.vibration/MobileProjects~}/Android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml (98%) rename {MobileProjects~ => Packages/com.benoitfreslon.vibration/MobileProjects~}/Android/app/src/main/res/mipmap-hdpi/ic_launcher.png (100%) rename {MobileProjects~ => Packages/com.benoitfreslon.vibration/MobileProjects~}/Android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png (100%) rename {MobileProjects~ => Packages/com.benoitfreslon.vibration/MobileProjects~}/Android/app/src/main/res/mipmap-mdpi/ic_launcher.png (100%) rename {MobileProjects~ => Packages/com.benoitfreslon.vibration/MobileProjects~}/Android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png (100%) rename {MobileProjects~ => Packages/com.benoitfreslon.vibration/MobileProjects~}/Android/app/src/main/res/mipmap-xhdpi/ic_launcher.png (100%) rename {MobileProjects~ => Packages/com.benoitfreslon.vibration/MobileProjects~}/Android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png (100%) rename {MobileProjects~ => Packages/com.benoitfreslon.vibration/MobileProjects~}/Android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png (100%) rename {MobileProjects~ => Packages/com.benoitfreslon.vibration/MobileProjects~}/Android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png (100%) rename {MobileProjects~ => Packages/com.benoitfreslon.vibration/MobileProjects~}/Android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png (100%) rename {MobileProjects~ => Packages/com.benoitfreslon.vibration/MobileProjects~}/Android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png (100%) rename {MobileProjects~ => Packages/com.benoitfreslon.vibration/MobileProjects~}/Android/app/src/main/res/values/colors.xml (97%) rename {MobileProjects~ => Packages/com.benoitfreslon.vibration/MobileProjects~}/Android/app/src/main/res/values/strings.xml (97%) rename {MobileProjects~ => Packages/com.benoitfreslon.vibration/MobileProjects~}/Android/app/src/main/res/values/styles.xml (97%) rename {MobileProjects~ => Packages/com.benoitfreslon.vibration/MobileProjects~}/Android/app/src/test/java/com/benoitfreslon/unity/vibrations/plugin/ExampleUnitTest.kt (95%) rename {MobileProjects~ => Packages/com.benoitfreslon.vibration/MobileProjects~}/Android/build.gradle (96%) rename {MobileProjects~ => Packages/com.benoitfreslon.vibration/MobileProjects~}/Android/gradle.properties (98%) rename {MobileProjects~ => Packages/com.benoitfreslon.vibration/MobileProjects~}/Android/gradle/wrapper/gradle-wrapper.jar (100%) rename {MobileProjects~ => Packages/com.benoitfreslon.vibration/MobileProjects~}/Android/gradle/wrapper/gradle-wrapper.properties (97%) rename {MobileProjects~ => Packages/com.benoitfreslon.vibration/MobileProjects~}/Android/gradlew (100%) rename {MobileProjects~ => Packages/com.benoitfreslon.vibration/MobileProjects~}/Android/gradlew.bat (96%) rename {MobileProjects~ => Packages/com.benoitfreslon.vibration/MobileProjects~}/Android/lib/.gitignore (87%) rename {MobileProjects~ => Packages/com.benoitfreslon.vibration/MobileProjects~}/Android/lib/build.gradle (96%) create mode 100644 Packages/com.benoitfreslon.vibration/MobileProjects~/Android/lib/consumer-rules.pro rename {MobileProjects~/Android/app => Packages/com.benoitfreslon.vibration/MobileProjects~/Android/lib}/proguard-rules.pro (97%) rename {MobileProjects~ => Packages/com.benoitfreslon.vibration/MobileProjects~}/Android/lib/src/androidTest/java/com/benoitfreslon/unity/vibrations.meta (100%) rename {MobileProjects~ => Packages/com.benoitfreslon.vibration/MobileProjects~}/Android/lib/src/androidTest/java/com/benoitfreslon/unity/vibrations/lib.meta (100%) rename {MobileProjects~ => Packages/com.benoitfreslon.vibration/MobileProjects~}/Android/lib/src/androidTest/java/com/benoitfreslon/unity/vibrations/lib/ExampleInstrumentedTest.kt (96%) rename {MobileProjects~ => Packages/com.benoitfreslon.vibration/MobileProjects~}/Android/lib/src/androidTest/java/com/benoitfreslon/unity/vibrations/lib/ExampleInstrumentedTest.kt.meta (100%) rename {MobileProjects~ => Packages/com.benoitfreslon.vibration/MobileProjects~}/Android/lib/src/test/java/com/benoitfreslon/unity/vibrations/lib/EnumExtensionsTest.kt (100%) rename {MobileProjects~ => Packages/com.benoitfreslon.vibration/MobileProjects~}/Android/settings.gradle (96%) rename {MobileProjects~ => Packages/com.benoitfreslon.vibration/MobileProjects~/iOS}/.gitignore (58%) create mode 100644 Packages/com.benoitfreslon.vibration/MobileProjects~/iOS/README.md rename Runtime.meta => Packages/com.benoitfreslon.vibration/Runtime.meta (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Plugins.meta (77%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Plugins/Android.meta (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Plugins/Android/AndroidManifest.xml (97%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Plugins/Android/AndroidManifest.xml.meta (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Plugins/Android/gradleTemplate.properties (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Plugins/Android/gradleTemplate.properties.meta (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Plugins/Android/java.meta (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Plugins/Android/java/com.meta (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Plugins/Android/java/com/benoitfreslon.meta (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Plugins/Android/java/com/benoitfreslon/unity.meta (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Plugins/Android/java/com/benoitfreslon/unity/vibrations.meta (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib.meta (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/Vibration.kt (97%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/Vibration.kt.meta (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/entities.meta (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/entities/HapticData.kt (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/entities/HapticData.kt.meta (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/entities/HapticPattern.kt (78%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/entities/HapticPattern.kt.meta (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/entities/README.md (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/entities/README.md.meta (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/entities/VibrationResult.kt (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/entities/VibrationResult.kt.meta (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/enums.meta (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/enums/IVibrationType.kt (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/enums/IVibrationType.kt.meta (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/enums/VibrationRepeat.kt (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/enums/VibrationRepeat.kt.meta (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/enums/VibrationType.kt (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/enums/VibrationType.kt.meta (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/extended.meta (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/extended/VibrationExtended.kt (96%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/extended/VibrationExtended.kt.meta (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/extended/entities.meta (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/extended/entities/HapticDataExtended.kt (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/extended/entities/HapticDataExtended.kt.meta (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/extended/enums.meta (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/extended/enums/VibrationTypeExtended.kt (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/extended/enums/VibrationTypeExtended.kt.meta (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/extensions.meta (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/extensions/AudioAttributes.kt (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/extensions/AudioAttributes.kt.meta (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/extensions/Enum.kt (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/extensions/Enum.kt.meta (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/extensions/VibrationAttributes.kt (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/extensions/VibrationAttributes.kt.meta (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/extensions/Vibrator.kt (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/extensions/Vibrator.kt.meta (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/extensions/functions.meta (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/extensions/functions/VibrationFunctions.kt (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/extensions/functions/VibrationFunctions.kt.meta (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Plugins/WebGL.meta (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Plugins/WebGL/Lib.meta (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Plugins/WebGL/Lib/global_functions.jspre (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Plugins/WebGL/Lib/global_functions.jspre.meta (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Plugins/WebGL/Lib/vibration_library.jspre (54%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Plugins/WebGL/Lib/vibration_library.jspre.meta (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Plugins/WebGL/README.md (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Plugins/WebGL/README.md.meta (100%) create mode 100644 Packages/com.benoitfreslon.vibration/Runtime/Plugins/WebGL/vibration.jslib rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Plugins/WebGL/vibration.jslib.meta (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Plugins/iOS.meta (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Plugins/iOS/Vibration.meta (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Plugins/iOS/Vibration/Vibration.h (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Plugins/iOS/Vibration/Vibration.h.meta (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Plugins/iOS/Vibration/Vibration.mm (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Plugins/iOS/Vibration/Vibration.mm.meta (100%) create mode 100644 Packages/com.benoitfreslon.vibration/Runtime/Resources.meta rename ScriptableObjects.meta => Packages/com.benoitfreslon.vibration/Runtime/Resources/ScriptableObjects.meta (100%) rename {ScriptableObjects => Packages/com.benoitfreslon.vibration/Runtime/Resources/ScriptableObjects}/ConfigOptions.asset (100%) rename {ScriptableObjects => Packages/com.benoitfreslon.vibration/Runtime/Resources/ScriptableObjects}/ConfigOptions.asset.meta (100%) create mode 100644 Packages/com.benoitfreslon.vibration/Runtime/Scripts.meta rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime/Scripts}/Enums.meta (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime/Scripts}/Enums/Enumeration.cs (90%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime/Scripts}/Enums/Enumeration.cs.meta (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime/Scripts}/Enums/MobileTimeUnit.cs (53%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime/Scripts}/Enums/MobileTimeUnit.cs.meta (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime/Scripts}/Enums/VibrationRepeat.cs (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime/Scripts}/Enums/VibrationRepeat.cs.meta (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime/Scripts}/Enums/VibrationType.cs (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime/Scripts}/Enums/VibrationType.cs.meta (100%) create mode 100644 Packages/com.benoitfreslon.vibration/Runtime/Scripts/Mobile.meta create mode 100644 Packages/com.benoitfreslon.vibration/Runtime/Scripts/Mobile/AndroidBuild.cs create mode 100644 Packages/com.benoitfreslon.vibration/Runtime/Scripts/Mobile/AndroidBuild.cs.meta rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime/Scripts}/Save.meta (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime/Scripts}/Save/Options.cs (97%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime/Scripts}/Save/Options.cs.meta (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime/Scripts}/Vibration.cs (50%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime/Scripts}/Vibration.cs.meta (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime/Scripts}/VibrationComponent.cs (83%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime/Scripts}/VibrationComponent.cs.meta (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Vibration.asmdef (100%) rename {Runtime => Packages/com.benoitfreslon.vibration/Runtime}/Vibration.asmdef.meta (100%) rename Samples.meta => Packages/com.benoitfreslon.vibration/Samples.meta (100%) create mode 100644 Packages/com.benoitfreslon.vibration/Samples/Vibration.Samples.asmref create mode 100644 Packages/com.benoitfreslon.vibration/Samples/Vibration.Samples.asmref.meta rename {Samples => Packages/com.benoitfreslon.vibration/Samples}/VibrationExample.meta (100%) create mode 100644 Packages/com.benoitfreslon.vibration/Samples/VibrationExample/VibrationExample.cs rename {Samples => Packages/com.benoitfreslon.vibration/Samples}/VibrationExample/VibrationExample.cs.meta (100%) rename {Samples => Packages/com.benoitfreslon.vibration/Samples}/VibrationExample/VibrationExample.unity (96%) rename {Samples => Packages/com.benoitfreslon.vibration/Samples}/VibrationExample/VibrationExample.unity.meta (100%) create mode 100644 Packages/com.benoitfreslon.vibration/Tests.meta create mode 100644 Packages/com.benoitfreslon.vibration/Tests/Editor.meta create mode 100644 Packages/com.benoitfreslon.vibration/Tests/Editor/MobileTimeUnitTest.cs create mode 100644 Packages/com.benoitfreslon.vibration/Tests/Editor/MobileTimeUnitTest.cs.meta create mode 100644 Packages/com.benoitfreslon.vibration/Tests/Editor/Vibration.Editor.Tests.asmdef create mode 100644 Packages/com.benoitfreslon.vibration/Tests/Editor/Vibration.Editor.Tests.asmdef.meta create mode 100644 Packages/com.benoitfreslon.vibration/package.json rename package.json.meta => Packages/com.benoitfreslon.vibration/package.json.meta (100%) create mode 100644 Packages/manifest.json create mode 100644 Packages/packages-lock.json create mode 100644 ProjectSettings/AudioManager.asset create mode 100644 ProjectSettings/BurstAotSettings_WebGL.json create mode 100644 ProjectSettings/ClusterInputManager.asset create mode 100644 ProjectSettings/CommonBurstAotSettings.json create mode 100644 ProjectSettings/DynamicsManager.asset create mode 100644 ProjectSettings/EditorBuildSettings.asset create mode 100644 ProjectSettings/EditorSettings.asset create mode 100644 ProjectSettings/GraphicsSettings.asset create mode 100644 ProjectSettings/InputManager.asset create mode 100644 ProjectSettings/MemorySettings.asset create mode 100644 ProjectSettings/NavMeshAreas.asset create mode 100644 ProjectSettings/NetworkManager.asset create mode 100644 ProjectSettings/PackageManagerSettings.asset create mode 100644 ProjectSettings/Physics2DSettings.asset create mode 100644 ProjectSettings/PresetManager.asset create mode 100644 ProjectSettings/ProjectSettings.asset create mode 100644 ProjectSettings/ProjectVersion.txt create mode 100644 ProjectSettings/QualitySettings.asset create mode 100644 ProjectSettings/SceneTemplateSettings.json create mode 100644 ProjectSettings/TagManager.asset create mode 100644 ProjectSettings/TimeManager.asset create mode 100644 ProjectSettings/UnityConnectSettings.asset create mode 100644 ProjectSettings/VFXManager.asset create mode 100644 ProjectSettings/VersionControlSettings.asset create mode 100644 ProjectSettings/XRSettings.asset delete mode 100644 Runtime/Plugins/WebGL/vibration.jslib delete mode 100644 Samples/VibrationExample/VibrationExample.cs create mode 100644 package-lock.json diff --git a/.github/scripts/functions.sh b/.github/scripts/functions.sh new file mode 100755 index 0000000..465ef43 --- /dev/null +++ b/.github/scripts/functions.sh @@ -0,0 +1,72 @@ +#!/bin/bash + +# USAGE: packageVersion "[PATH]/package.json" +packageVersion() { + local PACKAGE_JSON_FILE=$1 + VERSION="" + while read a b ; do + [ "$a" = '"version":' ] && { b="${b%\"*}" ; VERSION="${b#\"}" ; break ; } + done < $PACKAGE_JSON_FILE + echo $VERSION +} + +githubActionsOutputs() { + CURRENT_TAG=$(git describe --tags $(git rev-list --tags --max-count=1)) + COMMIT_MESSAGE=$(git log -1 --pretty=%B) + echo ::set-output name=tag::$CURRENT_TAG + echo ::set-output name=commit_message::$COMMIT_MESSAGE +} + +copyPackagesContent() { + shopt -s extglob dotglob + cp -rvf "Packages/$PKG_NAME/." "$PKG_ROOT" + rm -rf ./Packages +} + +commitAndPush() { + # Incrementing LAST_RELEASE_TAG+1. + # Keep here just to store the history, and if need this to the future/others repositories + # + # PS: Keep in mind that not always you would like to increment the git tag version (e.g rewriting with force an existent git tag) + # [[ "$LAST_RELEASE_TAG" =~ (.*[^0-9])([0-9]+)$ ]] && LAST_RELEASE_TAG="${BASH_REMATCH[1]}$((${BASH_REMATCH[2]} + 1))"; + + RELEASE_VERSION=$(packageVersion "./package.json") + + echo "New version: $RELEASE_VERSION" + + if [[ -d "Samples" ]]; then + mv Samples Samples~ + rm -f Samples.meta + fi + if [[ -d "Documentation" ]]; then + mv Documentation Documentation~ + rm -f Documentation.meta + fi + git config --global user.name 'github-bot' + git config --global user.email 'github-bot@users.noreply.github.com' + git add . + git commit --allow-empty -am "$COMMIT_MESSAGE" + + echo $RELEASE_VERSION > VERSION.md~ + git add VERSION.md~ + git commit -am "fix: Samples => Samples~ and commit a new version: $RELEASE_VERSION" + git push -f -u origin "$PKG_BRANCH" +} + +run() { + if [ $1 == "push" ] + then + commitAndPush + elif [ $1 == "movePackagesFolder" ] + then + copyPackagesContent + elif [ $1 == "githubActionsVariables" ] + then + githubActionsOutputs + else + echo "[ERROR] INVALID SCRIPT OPERATION" + exit 1 + fi +} + +run $1 \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ee987c8..dbaa53a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,38 +2,41 @@ name: Unity Package CI on: push: branches: - - upm-android-haptics + - upm-package-embedded + repository_dispatch: + types: [on-demand-test] env: - PKG_ROOT: ./ + PKG_BRANCH: upm + PKG_NAME: com.benoitfreslon.vibration + PKG_ROOT: ./ jobs: split-upm: - name: Split upm branch (force) + name: Create upm package branch (force) runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - name: Split package folder to upm branch - run: | - if [ "$PKG_ROOT" == "./" ] - then - git checkout -b upm - else - git subtree split -P "$PKG_ROOT" -b upm - fi - - name: Create samples~ folder - run: | - git checkout upm - if [[ -d "Samples" ]]; then - git mv Samples Samples~ - rm -f Samples.meta - git config --global user.name 'github-bot' - git config --global user.email 'github-bot@users.noreply.github.com' - git commit -am "fix: Samples => Samples~" - fi - - name: Push changes to upm branch - uses: ad-m/github-push-action@master - with: - force: true - branch: upm - github_token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Set output git tag and commit message + id: vars + run: ./.github/scripts/functions.sh githubActionsVariables + - name: Check output git variables + env: + LAST_RELEASE_TAG: ${{ steps.vars.outputs.tag }} + COMMIT_MESSAGE: ${{ steps.vars.outputs.commit_message }} + run: | + echo $LAST_RELEASE_TAG + echo $COMMIT_MESSAGE + - name: Checkout orphan [${{ env.PKG_BRANCH }}] branch + run: | + git checkout --orphan "$PKG_BRANCH" + shopt -s extglob dotglob + rm -rf !(Packages|.github|.git|README.md|README.md.meta|LICENSE|LICENSE.meta|.|..) + ls -la ./ + - name: Move ./Packages content to root + run: ./.github/scripts/functions.sh movePackagesFolder + - name: Create Samples~ and Documentation~ folders + run: ./.github/scripts/functions.sh push + env: + LAST_RELEASE_TAG: ${{ steps.vars.outputs.tag }} + COMMIT_MESSAGE: ${{ steps.vars.outputs.commit_message }} diff --git a/.gitignore b/.gitignore index 72c27e4..9f86c35 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ # This .gitignore file should be placed at the root of your Unity project directory # -# Get latest from https://github.com/github/gitignore/blob/master/Unity.gitignore +# Get latest from https://github.com/github/gitignore/blob/main/Unity.gitignore # /[Ll]ibrary/ /[Tt]emp/ @@ -14,8 +14,8 @@ # They also could contain extremely sensitive data /[Mm]emoryCaptures/ -# Asset meta data should only be ignored when the corresponding asset is also ignored -!/[Aa]ssets/**/*.meta +# Recordings can get excessive in size +/[Rr]ecordings/ # Uncomment this line if you wish to ignore the asset store tools plugin # /[Aa]ssets/AssetStoreTools* @@ -59,6 +59,7 @@ sysinfo.txt *.apk *.aab *.unitypackage +*.app # Crashlytics generated file crashlytics-build.properties @@ -69,3 +70,220 @@ crashlytics-build.properties # Temporary auto-generated Android Assets /[Aa]ssets/[Ss]treamingAssets/aa.meta /[Aa]ssets/[Ss]treamingAssets/aa/* + +# --------------------- +# Global/JetBrains.gitignore +# --------------------- + +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# AWS User-specific +.idea/**/aws.xml + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/artifacts +# .idea/compiler.xml +# .idea/jarRepositories.xml +# .idea/modules.xml +# .idea/*.iml +# .idea/modules +# *.iml +# *.ipr + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# SonarLint plugin +.idea/sonarlint/ + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser + +# --------------------- +# Node.gitignore +# --------------------- + +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* +.pnpm-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# Snowpack dependency directory (https://snowpack.dev/) +web_modules/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional stylelint cache +.stylelintcache + +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variable files +.env +.env.development.local +.env.test.local +.env.production.local +.env.local + +# parcel-bundler cache (https://parceljs.org/) +.cache +.parcel-cache + +# Next.js build output +.next +out + +# Nuxt.js build / generate output +.nuxt +dist + +# Gatsby files +.cache/ +# Comment in the public line in if your project uses Gatsby and not Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public + +# vuepress build output +.vuepress/dist + +# vuepress v2.x temp and cache directory +.temp +.cache + +# Docusaurus cache and generated files +.docusaurus + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# TernJS port file +.tern-port + +# Stores VSCode versions used for testing VSCode extensions +.vscode-test + +# yarn v2 +.yarn/cache +.yarn/unplugged +.yarn/build-state.yml +.yarn/install-state.gz +.pnp.* \ No newline at end of file diff --git a/.idea/.idea.Vibration/.idea/.gitignore b/.idea/.idea.Vibration/.idea/.gitignore new file mode 100644 index 0000000..34ffbf2 --- /dev/null +++ b/.idea/.idea.Vibration/.idea/.gitignore @@ -0,0 +1,13 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Rider ignored files +/projectSettingsUpdater.xml +/.idea.Vibration.iml +/modules.xml +/contentModel.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/.idea.Vibration/.idea/vcs.xml b/.idea/.idea.Vibration/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/.idea.Vibration/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 6075de1..a8f196b 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,5 +1,6 @@ { "recommendations": [ - "xabikos.javascriptsnippets" + "xabikos.javascriptsnippets", + "visualstudiotoolsforunity.vstuc" ] } \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..da60e25 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,10 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Attach to Unity", + "type": "vstuc", + "request": "attach" + } + ] +} \ No newline at end of file diff --git a/MobileProjects~/Android/lib/consumer-rules.pro b/Assets/.gitkeep similarity index 100% rename from MobileProjects~/Android/lib/consumer-rules.pro rename to Assets/.gitkeep diff --git a/MobileProjects~/Android/.idea/.name b/MobileProjects~/Android/.idea/.name deleted file mode 100644 index 2b9ffe3..0000000 --- a/MobileProjects~/Android/.idea/.name +++ /dev/null @@ -1 +0,0 @@ -Unity Vibrations Plugin \ No newline at end of file diff --git a/MobileProjects~/Android/.idea/codeStyles/Project.xml b/MobileProjects~/Android/.idea/codeStyles/Project.xml deleted file mode 100644 index a8fce2b..0000000 --- a/MobileProjects~/Android/.idea/codeStyles/Project.xml +++ /dev/null @@ -1,122 +0,0 @@ - - - - - - - - - -
- - - - xmlns:android - - ^$ - - - -
-
- - - - xmlns:.* - - ^$ - - - BY_NAME - -
-
- - - - .*:id - - http://schemas.android.com/apk/res/android - - - -
-
- - - - .*:name - - http://schemas.android.com/apk/res/android - - - -
-
- - - - name - - ^$ - - - -
-
- - - - style - - ^$ - - - -
-
- - - - .* - - ^$ - - - BY_NAME - -
-
- - - - .* - - http://schemas.android.com/apk/res/android - - - ANDROID_ATTRIBUTE_ORDER - -
-
- - - - .* - - .* - - - BY_NAME - -
-
-
-
- - -
-
\ No newline at end of file diff --git a/MobileProjects~/Android/.idea/codeStyles/codeStyleConfig.xml b/MobileProjects~/Android/.idea/codeStyles/codeStyleConfig.xml deleted file mode 100644 index 307554b..0000000 --- a/MobileProjects~/Android/.idea/codeStyles/codeStyleConfig.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/MobileProjects~/Android/.idea/jarRepositories.xml b/MobileProjects~/Android/.idea/jarRepositories.xml deleted file mode 100644 index 52a77b6..0000000 --- a/MobileProjects~/Android/.idea/jarRepositories.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/MobileProjects~/Android/.idea/misc.xml b/MobileProjects~/Android/.idea/misc.xml deleted file mode 100644 index 8978d23..0000000 --- a/MobileProjects~/Android/.idea/misc.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/Packages/com.benoitfreslon.vibration/.gitignore b/Packages/com.benoitfreslon.vibration/.gitignore new file mode 100644 index 0000000..58cbc82 --- /dev/null +++ b/Packages/com.benoitfreslon.vibration/.gitignore @@ -0,0 +1,72 @@ +# This .gitignore file should be placed at the root of your Unity project directory +# +# Get latest from https://github.com/github/gitignore/blob/main/Unity.gitignore +# +/[Ll]ibrary/ +/[Tt]emp/ +/[Oo]bj/ +/[Bb]uild/ +/[Bb]uilds/ +/[Ll]ogs/ +/[Uu]ser[Ss]ettings/ + +# MemoryCaptures can get excessive in size. +# They also could contain extremely sensitive data +/[Mm]emoryCaptures/ + +# Recordings can get excessive in size +/[Rr]ecordings/ + +# Uncomment this line if you wish to ignore the asset store tools plugin +# /[Aa]ssets/AssetStoreTools* + +# Autogenerated Jetbrains Rider plugin +/[Aa]ssets/Plugins/Editor/JetBrains* + +# Visual Studio cache directory +.vs/ + +# Gradle cache directory +.gradle/ + +# Autogenerated VS/MD/Consulo solution and project files +ExportedObj/ +.consulo/ +*.csproj +*.unityproj +*.sln +*.suo +*.tmp +*.user +*.userprefs +*.pidb +*.booproj +*.svd +*.pdb +*.mdb +*.opendb +*.VC.db + +# Unity3D generated meta files +*.pidb.meta +*.pdb.meta +*.mdb.meta + +# Unity3D generated file on crash reports +sysinfo.txt + +# Builds +*.apk +*.aab +*.unitypackage +*.app + +# Crashlytics generated file +crashlytics-build.properties + +# Packed Addressables +/[Aa]ssets/[Aa]ddressable[Aa]ssets[Dd]ata/*/*.bin* + +# Temporary auto-generated Android Assets +/[Aa]ssets/[Ss]treamingAssets/aa.meta +/[Aa]ssets/[Ss]treamingAssets/aa/* diff --git a/MobileProjects~/Android/.gitignore b/Packages/com.benoitfreslon.vibration/MobileProjects~/Android/.gitignore similarity index 86% rename from MobileProjects~/Android/.gitignore rename to Packages/com.benoitfreslon.vibration/MobileProjects~/Android/.gitignore index eb03a88..b21dd55 100644 --- a/MobileProjects~/Android/.gitignore +++ b/Packages/com.benoitfreslon.vibration/MobileProjects~/Android/.gitignore @@ -1,3 +1,7 @@ +# --------------------- +# Android.gitignore +# --------------------- + # Gradle files .gradle/ build/ @@ -32,7 +36,9 @@ google-services.json # Android Profiling *.hprof -# --- Gradle .gitignore --- +# --------------------- +# Gradle.gitignore +# --------------------- .gradle **/build/ !src/**/build/ diff --git a/Packages/com.benoitfreslon.vibration/MobileProjects~/Android/README.md b/Packages/com.benoitfreslon.vibration/MobileProjects~/Android/README.md new file mode 100644 index 0000000..de88280 --- /dev/null +++ b/Packages/com.benoitfreslon.vibration/MobileProjects~/Android/README.md @@ -0,0 +1,7 @@ +# Vibration Plugin: Android Studio project + +A `gradle` project created with latest **Android Studio**, in order to test the native implementation features +outside of game engine project. + +> **PS:** This project is useful to implement/test **haptics** that belongs to specific Android API's versions, and deploy to a device +from Android Studio! diff --git a/MobileProjects~/Android/app/.gitignore b/Packages/com.benoitfreslon.vibration/MobileProjects~/Android/app/.gitignore similarity index 87% rename from MobileProjects~/Android/app/.gitignore rename to Packages/com.benoitfreslon.vibration/MobileProjects~/Android/app/.gitignore index 3543521..796b96d 100644 --- a/MobileProjects~/Android/app/.gitignore +++ b/Packages/com.benoitfreslon.vibration/MobileProjects~/Android/app/.gitignore @@ -1 +1 @@ -/build +/build diff --git a/MobileProjects~/Android/app/build.gradle b/Packages/com.benoitfreslon.vibration/MobileProjects~/Android/app/build.gradle similarity index 96% rename from MobileProjects~/Android/app/build.gradle rename to Packages/com.benoitfreslon.vibration/MobileProjects~/Android/app/build.gradle index f3a4200..1d08b83 100644 --- a/MobileProjects~/Android/app/build.gradle +++ b/Packages/com.benoitfreslon.vibration/MobileProjects~/Android/app/build.gradle @@ -1,68 +1,68 @@ -plugins { - id 'com.android.application' - id 'org.jetbrains.kotlin.android' - id 'kotlin-android' - id 'kotlin-parcelize' - id 'kotlin-kapt' -} - -android { - namespace 'com.benoitfreslon.unity.vibrations.plugin' - compileSdkVersion 33 - - defaultConfig { - applicationId "com.benoitfreslon.unity.vibrations.plugin" - minSdkVersion 19 - targetSdkVersion 33 - versionCode 1 - versionName "1.0" - - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' - } - } - - buildFeatures { - dataBinding true - } - - compileOptions { - sourceCompatibility JavaVersion.VERSION_17 - targetCompatibility JavaVersion.VERSION_17 - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_17.toString() - } -} - -dependencies { - - // --- Local modules/libraries --- - implementation project(path: ':lib') - implementation fileTree(dir: 'libs', include: ['*.jar']) - - // --- Core --- - implementation "androidx.appcompat:appcompat:$appcompat_version" - implementation "androidx.constraintlayout:constraintlayout:$contraintLayout_version" - implementation "androidx.core:core-ktx:$androidx_core_version" - - // --- ViewModel --- - implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version" - - // PS: In order to use viewModels() or activityViewModels() delegates on FRAGMENTS, - // import dependency: "androidx.fragment:fragment-ktx:[$library_version]" - implementation "androidx.activity:activity-ktx:$activityktx_version" - implementation "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycle_version" - implementation "androidx.lifecycle:lifecycle-common:$lifecycle_version" - - // --- Testing --- - testImplementation "junit:junit:$junit_version" - androidTestImplementation "androidx.test.ext:junit:$androidx_junit_version" - androidTestImplementation "androidx.test.espresso:espresso-core:$androidx_espresso_version" -} +plugins { + id 'com.android.application' + id 'org.jetbrains.kotlin.android' + id 'kotlin-android' + id 'kotlin-parcelize' + id 'kotlin-kapt' +} + +android { + namespace 'com.benoitfreslon.unity.vibrations.plugin' + compileSdkVersion 33 + + defaultConfig { + applicationId "com.benoitfreslon.unity.vibrations.plugin" + minSdkVersion 19 + targetSdkVersion 33 + versionCode 1 + versionName "1.0" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + + buildFeatures { + dataBinding true + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 + } + + kotlinOptions { + jvmTarget = JavaVersion.VERSION_17.toString() + } +} + +dependencies { + + // --- Local modules/libraries --- + implementation project(path: ':lib') + implementation fileTree(dir: 'libs', include: ['*.jar']) + + // --- Core --- + implementation "androidx.appcompat:appcompat:$appcompat_version" + implementation "androidx.constraintlayout:constraintlayout:$contraintLayout_version" + implementation "androidx.core:core-ktx:$androidx_core_version" + + // --- ViewModel --- + implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version" + + // PS: In order to use viewModels() or activityViewModels() delegates on FRAGMENTS, + // import dependency: "androidx.fragment:fragment-ktx:[$library_version]" + implementation "androidx.activity:activity-ktx:$activityktx_version" + implementation "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycle_version" + implementation "androidx.lifecycle:lifecycle-common:$lifecycle_version" + + // --- Testing --- + testImplementation "junit:junit:$junit_version" + androidTestImplementation "androidx.test.ext:junit:$androidx_junit_version" + androidTestImplementation "androidx.test.espresso:espresso-core:$androidx_espresso_version" +} diff --git a/MobileProjects~/Android/lib/proguard-rules.pro b/Packages/com.benoitfreslon.vibration/MobileProjects~/Android/app/proguard-rules.pro similarity index 97% rename from MobileProjects~/Android/lib/proguard-rules.pro rename to Packages/com.benoitfreslon.vibration/MobileProjects~/Android/app/proguard-rules.pro index 6e7ffa9..f1b4245 100644 --- a/MobileProjects~/Android/lib/proguard-rules.pro +++ b/Packages/com.benoitfreslon.vibration/MobileProjects~/Android/app/proguard-rules.pro @@ -1,21 +1,21 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile diff --git a/MobileProjects~/Android/app/src/androidTest/java/com/benoitfreslon/unity/vibrations/plugin/ExampleInstrumentedTest.kt b/Packages/com.benoitfreslon.vibration/MobileProjects~/Android/app/src/androidTest/java/com/benoitfreslon/unity/vibrations/plugin/ExampleInstrumentedTest.kt similarity index 96% rename from MobileProjects~/Android/app/src/androidTest/java/com/benoitfreslon/unity/vibrations/plugin/ExampleInstrumentedTest.kt rename to Packages/com.benoitfreslon.vibration/MobileProjects~/Android/app/src/androidTest/java/com/benoitfreslon/unity/vibrations/plugin/ExampleInstrumentedTest.kt index cbda729..6dba919 100644 --- a/MobileProjects~/Android/app/src/androidTest/java/com/benoitfreslon/unity/vibrations/plugin/ExampleInstrumentedTest.kt +++ b/Packages/com.benoitfreslon.vibration/MobileProjects~/Android/app/src/androidTest/java/com/benoitfreslon/unity/vibrations/plugin/ExampleInstrumentedTest.kt @@ -1,24 +1,24 @@ -package com.benoitfreslon.unity.vibrations.plugin - -import androidx.test.platform.app.InstrumentationRegistry -import androidx.test.ext.junit.runners.AndroidJUnit4 - -import org.junit.Test -import org.junit.runner.RunWith - -import org.junit.Assert.* - -/** - * Instrumented test, which will execute on an Android device. - * - * See [testing documentation](http://d.android.com/tools/testing). - */ -@RunWith(AndroidJUnit4::class) -class ExampleInstrumentedTest { - @Test - fun useAppContext() { - // Context of the app under test. - val appContext = InstrumentationRegistry.getInstrumentation().targetContext - assertEquals("com.benoitfreslon.unity.vibrations.plugin", appContext.packageName) - } -} +package com.benoitfreslon.unity.vibrations.plugin + +import androidx.test.platform.app.InstrumentationRegistry +import androidx.test.ext.junit.runners.AndroidJUnit4 + +import org.junit.Test +import org.junit.runner.RunWith + +import org.junit.Assert.* + +/** + * Instrumented test, which will execute on an Android device. + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +@RunWith(AndroidJUnit4::class) +class ExampleInstrumentedTest { + @Test + fun useAppContext() { + // Context of the app under test. + val appContext = InstrumentationRegistry.getInstrumentation().targetContext + assertEquals("com.benoitfreslon.unity.vibrations.plugin", appContext.packageName) + } +} diff --git a/MobileProjects~/Android/app/src/main/AndroidManifest.xml b/Packages/com.benoitfreslon.vibration/MobileProjects~/Android/app/src/main/AndroidManifest.xml similarity index 97% rename from MobileProjects~/Android/app/src/main/AndroidManifest.xml rename to Packages/com.benoitfreslon.vibration/MobileProjects~/Android/app/src/main/AndroidManifest.xml index f8e8a55..93d0dd5 100644 --- a/MobileProjects~/Android/app/src/main/AndroidManifest.xml +++ b/Packages/com.benoitfreslon.vibration/MobileProjects~/Android/app/src/main/AndroidManifest.xml @@ -1,22 +1,22 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + \ No newline at end of file diff --git a/MobileProjects~/Android/app/src/main/java/com/benoitfreslon/unity/vibrations/plugin/views/MainActivity.kt b/Packages/com.benoitfreslon.vibration/MobileProjects~/Android/app/src/main/java/com/benoitfreslon/unity/vibrations/plugin/views/MainActivity.kt similarity index 100% rename from MobileProjects~/Android/app/src/main/java/com/benoitfreslon/unity/vibrations/plugin/views/MainActivity.kt rename to Packages/com.benoitfreslon.vibration/MobileProjects~/Android/app/src/main/java/com/benoitfreslon/unity/vibrations/plugin/views/MainActivity.kt diff --git a/MobileProjects~/Android/app/src/main/java/com/benoitfreslon/unity/vibrations/plugin/views/MainViewModel.kt b/Packages/com.benoitfreslon.vibration/MobileProjects~/Android/app/src/main/java/com/benoitfreslon/unity/vibrations/plugin/views/MainViewModel.kt similarity index 100% rename from MobileProjects~/Android/app/src/main/java/com/benoitfreslon/unity/vibrations/plugin/views/MainViewModel.kt rename to Packages/com.benoitfreslon.vibration/MobileProjects~/Android/app/src/main/java/com/benoitfreslon/unity/vibrations/plugin/views/MainViewModel.kt diff --git a/MobileProjects~/Android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/Packages/com.benoitfreslon.vibration/MobileProjects~/Android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml similarity index 98% rename from MobileProjects~/Android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml rename to Packages/com.benoitfreslon.vibration/MobileProjects~/Android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml index cc14f03..2b068d1 100644 --- a/MobileProjects~/Android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml +++ b/Packages/com.benoitfreslon.vibration/MobileProjects~/Android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -1,30 +1,30 @@ - - - - - - - - - - + + + + + + + + + + \ No newline at end of file diff --git a/MobileProjects~/Android/app/src/main/res/drawable/ic_launcher_background.xml b/Packages/com.benoitfreslon.vibration/MobileProjects~/Android/app/src/main/res/drawable/ic_launcher_background.xml similarity index 97% rename from MobileProjects~/Android/app/src/main/res/drawable/ic_launcher_background.xml rename to Packages/com.benoitfreslon.vibration/MobileProjects~/Android/app/src/main/res/drawable/ic_launcher_background.xml index a4f78de..07d5da9 100644 --- a/MobileProjects~/Android/app/src/main/res/drawable/ic_launcher_background.xml +++ b/Packages/com.benoitfreslon.vibration/MobileProjects~/Android/app/src/main/res/drawable/ic_launcher_background.xml @@ -1,170 +1,170 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MobileProjects~/Android/app/src/main/res/layout/activity_main.xml b/Packages/com.benoitfreslon.vibration/MobileProjects~/Android/app/src/main/res/layout/activity_main.xml similarity index 97% rename from MobileProjects~/Android/app/src/main/res/layout/activity_main.xml rename to Packages/com.benoitfreslon.vibration/MobileProjects~/Android/app/src/main/res/layout/activity_main.xml index 23ec88e..8738380 100644 --- a/MobileProjects~/Android/app/src/main/res/layout/activity_main.xml +++ b/Packages/com.benoitfreslon.vibration/MobileProjects~/Android/app/src/main/res/layout/activity_main.xml @@ -1,61 +1,61 @@ - - - - - - - - - - - - -