Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: BenoitFreslon/Vibration
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: mfdeveloper/Vibration
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: upm-package-embedded
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.

Commits on May 31, 2020

  1. [Android] Added Kotlin plugin to use vibration haptics

    [UPM] Added support to Unity Package Manager
    mfdeveloper committed May 31, 2020
    Copy the full SHA
    8a1ceef View commit details

Commits on Jun 10, 2020

  1. [Save/Load] Added PlayerPrefs check for enable/disable vibration

    Refactors to use 'Vibration' static class from the new 'VibrationComponent' behaviour
    mfdeveloper committed Jun 10, 2020
    Copy the full SHA
    51aab01 View commit details
  2. Copy the full SHA
    e511080 View commit details

Commits on Jun 13, 2020

  1. Copy the full SHA
    80de9d7 View commit details
  2. [JSON] Added a fallback to create a ScriptableObject if not defined o…

    …n inspector
    
    Fixed compile errors to Desktop when use 'Handheld' class
    mfdeveloper committed Jun 13, 2020
    Copy the full SHA
    bfe25ce View commit details

Commits on Jul 19, 2023

  1. [Android Project] Updated build.gradle to use Gradle 8.0+ and removed…

    … deprecated warnings
    
    Also:
    
    - Some refactors on Kotlin implementations to improve readability
    mfdeveloper committed Jul 19, 2023
    Copy the full SHA
    11959c9 View commit details

Commits on Jul 20, 2023

  1. [Android] Refactors in Vibration.kt to support android.os.VibratorMan…

    …ager
    
    - Refactored packages folders under com.benoitfreslon.unity.vibrations.lib
    - [Android Project] Updated Kotlin version to 1.9.0
    - Few simple refactors on C# layer, on file VibratorComponent.cs
    mfdeveloper committed Jul 20, 2023
    Copy the full SHA
    27a4d6f View commit details

Commits on Sep 15, 2023

  1. [Android] Refactoring and reorganizing native Vibration Kotlin implem…

    …entations
    
    - Use latest Android API 30 VibratorManager and VibrationAttributes, in a new class "VibrationExtended.kt"
    - A whole refactoring of main class "Vibration.kt" to use milliseconds duration, VibrationEffect or vibration patterns as fallbacks considering the Android API versions
    - Separate generic extension methods and functions inside of "extensions" package.
    mfdeveloper committed Sep 15, 2023
    Copy the full SHA
    8b2c702 View commit details
  2. [Android] Refactoring in C# layer integration with Vibration Kotlin i…

    …mplementations
    
    Also:
    
    - Implementation only of methods signatures to WebGL JS vibration integration
    mfdeveloper committed Sep 15, 2023
    Copy the full SHA
    b505668 View commit details

Commits on Sep 19, 2023

  1. Copy the full SHA
    38739ed View commit details
  2. [Chore] Added Samples folder with a scene example

    Also:
    
    - package.json and Vibration.asmdef changes and sync with the forked [master] branch
    mfdeveloper committed Sep 19, 2023
    Copy the full SHA
    39198d9 View commit details
  3. Copy the full SHA
    49a398e View commit details

Commits on Sep 27, 2023

  1. [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
    mfdeveloper committed Sep 27, 2023
    Copy the full SHA
    4bfb774 View commit details

Commits on Oct 4, 2023

  1. Copy the full SHA
    84ee3f5 View commit details

Commits on Oct 7, 2023

  1. Copy the full SHA
    22b0a7d View commit details

Commits on Oct 13, 2023

  1. Copy the full SHA
    6c85deb View commit details
  2. Copy the full SHA
    4aad85f View commit details

Commits on Oct 14, 2023

  1. Copy the full SHA
    631f3ba View commit details

Commits on Oct 15, 2023

  1. Copy the full SHA
    e417c30 View commit details
  2. Copy the full SHA
    c8a0295 View commit details

Commits on Nov 13, 2023

  1. Copy the full SHA
    94a2683 View commit details

Commits on Feb 14, 2024

  1. Copy the full SHA
    98b3787 View commit details
  2. [Chore] Added missing .meta file for a .jpg file + additional .gitign…

    …ore exclude copied files
    mfdeveloper committed Feb 14, 2024
    Copy the full SHA
    7cd23e5 View commit details

Commits on Feb 15, 2024

  1. [Refactor] Change automation script to create 'Samples~' dir only if …

    …doesn't exists, but always copy the content of regular 'Samples' dir
    mfdeveloper committed Feb 15, 2024
    Copy the full SHA
    a5799cf View commit details
Showing with 12,971 additions and 361 deletions.
  1. +5 −0 .env
  2. +351 −0 .github/scripts/functions.sh
  3. +45 −0 .github/workflows/main.yml
  4. +295 −55 .gitignore
  5. +13 −0 .idea/.idea.Vibration/.idea/.gitignore
  6. +6 −0 .idea/.idea.Vibration/.idea/vcs.xml
  7. +8 −0 .vscode/extensions.json
  8. +10 −0 .vscode/launch.json
  9. +9 −0 .vscode/settings.json
  10. 0 Assets/.gitkeep
  11. +0 −71 Example/VibrationExample.cs
  12. +7 −0 Images.meta
  13. +7 −0 Images/Icons.meta
  14. BIN Images/Icons/android-icon.png
  15. +7 −0 Images/Icons/android-icon.png.meta
  16. BIN Images/Icons/ios-icon.png
  17. +7 −0 Images/Icons/ios-icon.png.meta
  18. BIN Images/Icons/webgl-icon.png
  19. +7 −0 Images/Icons/webgl-icon.png.meta
  20. +7 −0 Images/Screenshots.meta
  21. BIN Images/Screenshots/vibration-component-inspector.png
  22. +7 −0 Images/Screenshots/vibration-component-inspector.png.meta
  23. BIN Images/github-package-auth-require-token.jpg
  24. +166 −0 Images/github-package-auth-require-token.jpg.meta
  25. BIN Images/haptic-logo-color.png
  26. +7 −0 Images/haptic-logo-color.png.meta
  27. +5 −0 Packages/com.benoitfreslon.vibration/.env
  28. +310 −0 Packages/com.benoitfreslon.vibration/.gitignore
  29. +24 −0 Packages/com.benoitfreslon.vibration/.npmignore
  30. +3 −0 Packages/com.benoitfreslon.vibration/.npmrc
  31. +62 −0 Packages/com.benoitfreslon.vibration/MobileProjects~/Android/.gitignore
  32. +7 −0 Packages/com.benoitfreslon.vibration/MobileProjects~/Android/README.md
  33. +1 −0 Packages/com.benoitfreslon.vibration/MobileProjects~/Android/app/.gitignore
  34. +68 −0 Packages/com.benoitfreslon.vibration/MobileProjects~/Android/app/build.gradle
  35. +21 −0 Packages/com.benoitfreslon.vibration/MobileProjects~/Android/app/proguard-rules.pro
  36. +24 −0 ...oid/app/src/androidTest/java/com/benoitfreslon/unity/vibrations/plugin/ExampleInstrumentedTest.kt
  37. +22 −0 Packages/com.benoitfreslon.vibration/MobileProjects~/Android/app/src/main/AndroidManifest.xml
  38. +27 −0 ...ojects~/Android/app/src/main/java/com/benoitfreslon/unity/vibrations/plugin/views/MainActivity.kt
  39. +36 −0 ...jects~/Android/app/src/main/java/com/benoitfreslon/unity/vibrations/plugin/views/MainViewModel.kt
  40. +30 −0 ...reslon.vibration/MobileProjects~/Android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
  41. +170 −0 ...oitfreslon.vibration/MobileProjects~/Android/app/src/main/res/drawable/ic_launcher_background.xml
  42. +61 −0 ...ges/com.benoitfreslon.vibration/MobileProjects~/Android/app/src/main/res/layout/activity_main.xml
  43. +5 −0 ...enoitfreslon.vibration/MobileProjects~/Android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
  44. +5 −0 ...reslon.vibration/MobileProjects~/Android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
  45. BIN .../com.benoitfreslon.vibration/MobileProjects~/Android/app/src/main/res/mipmap-hdpi/ic_launcher.png
  46. BIN ...enoitfreslon.vibration/MobileProjects~/Android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
  47. BIN .../com.benoitfreslon.vibration/MobileProjects~/Android/app/src/main/res/mipmap-mdpi/ic_launcher.png
  48. BIN ...enoitfreslon.vibration/MobileProjects~/Android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
  49. BIN ...com.benoitfreslon.vibration/MobileProjects~/Android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
  50. BIN ...noitfreslon.vibration/MobileProjects~/Android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
  51. BIN ...om.benoitfreslon.vibration/MobileProjects~/Android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
  52. BIN ...oitfreslon.vibration/MobileProjects~/Android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
  53. BIN ...m.benoitfreslon.vibration/MobileProjects~/Android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
  54. BIN ...itfreslon.vibration/MobileProjects~/Android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
  55. +6 −0 Packages/com.benoitfreslon.vibration/MobileProjects~/Android/app/src/main/res/values/colors.xml
  56. +4 −0 Packages/com.benoitfreslon.vibration/MobileProjects~/Android/app/src/main/res/values/strings.xml
  57. +11 −0 Packages/com.benoitfreslon.vibration/MobileProjects~/Android/app/src/main/res/values/styles.xml
  58. +17 −0 ...eProjects~/Android/app/src/test/java/com/benoitfreslon/unity/vibrations/plugin/ExampleUnitTest.kt
  59. +40 −0 Packages/com.benoitfreslon.vibration/MobileProjects~/Android/build.gradle
  60. +24 −0 Packages/com.benoitfreslon.vibration/MobileProjects~/Android/gradle.properties
  61. BIN Packages/com.benoitfreslon.vibration/MobileProjects~/Android/gradle/wrapper/gradle-wrapper.jar
  62. +6 −0 ...ages/com.benoitfreslon.vibration/MobileProjects~/Android/gradle/wrapper/gradle-wrapper.properties
  63. +172 −0 Packages/com.benoitfreslon.vibration/MobileProjects~/Android/gradlew
  64. +84 −0 Packages/com.benoitfreslon.vibration/MobileProjects~/Android/gradlew.bat
  65. +1 −0 Packages/com.benoitfreslon.vibration/MobileProjects~/Android/lib/.gitignore
  66. +55 −0 Packages/com.benoitfreslon.vibration/MobileProjects~/Android/lib/build.gradle
  67. 0 Packages/com.benoitfreslon.vibration/MobileProjects~/Android/lib/consumer-rules.pro
  68. +21 −0 Packages/com.benoitfreslon.vibration/MobileProjects~/Android/lib/proguard-rules.pro
  69. +1 −1 ...ibration/MobileProjects~/Android/lib/src/androidTest/java/com/benoitfreslon/unity/vibrations.meta
  70. +8 −0 ...tion/MobileProjects~/Android/lib/src/androidTest/java/com/benoitfreslon/unity/vibrations/lib.meta
  71. +24 −0 ...ndroid/lib/src/androidTest/java/com/benoitfreslon/unity/vibrations/lib/ExampleInstrumentedTest.kt
  72. +27 −0 ...d/lib/src/androidTest/java/com/benoitfreslon/unity/vibrations/lib/ExampleInstrumentedTest.kt.meta
  73. +43 −0 ...eProjects~/Android/lib/src/test/java/com/benoitfreslon/unity/vibrations/lib/EnumExtensionsTest.kt
  74. +3 −0 Packages/com.benoitfreslon.vibration/MobileProjects~/Android/settings.gradle
  75. +90 −0 Packages/com.benoitfreslon.vibration/MobileProjects~/iOS/.gitignore
  76. +3 −0 Packages/com.benoitfreslon.vibration/MobileProjects~/iOS/README.md
  77. +12 −0 Packages/com.benoitfreslon.vibration/Runtime.meta
  78. +1 −1 { → Packages/com.benoitfreslon.vibration/Runtime}/Plugins.meta
  79. +8 −0 Packages/com.benoitfreslon.vibration/Runtime/Plugins/Android.meta
  80. +4 −0 Packages/com.benoitfreslon.vibration/Runtime/Plugins/Android/AndroidManifest.xml
  81. +7 −0 Packages/com.benoitfreslon.vibration/Runtime/Plugins/Android/AndroidManifest.xml.meta
  82. +8 −0 Packages/com.benoitfreslon.vibration/Runtime/Plugins/Android/gradleTemplate.properties
  83. +3 −0 Packages/com.benoitfreslon.vibration/Runtime/Plugins/Android/gradleTemplate.properties.meta
  84. +8 −0 Packages/com.benoitfreslon.vibration/Runtime/Plugins/Android/java.meta
  85. +8 −0 Packages/com.benoitfreslon.vibration/Runtime/Plugins/Android/java/com.meta
  86. +8 −0 Packages/com.benoitfreslon.vibration/Runtime/Plugins/Android/java/com/benoitfreslon.meta
  87. +8 −0 Packages/com.benoitfreslon.vibration/Runtime/Plugins/Android/java/com/benoitfreslon/unity.meta
  88. +8 −0 .../com.benoitfreslon.vibration/Runtime/Plugins/Android/java/com/benoitfreslon/unity/vibrations.meta
  89. +8 −0 ....benoitfreslon.vibration/Runtime/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib.meta
  90. +258 −0 ...reslon.vibration/Runtime/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/Vibration.kt
  91. +71 −0 ...n.vibration/Runtime/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/Vibration.kt.meta
  92. +8 −0 ...eslon.vibration/Runtime/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/entities.meta
  93. +85 −0 ...ration/Runtime/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/entities/HapticData.kt
  94. +71 −0 ...n/Runtime/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/entities/HapticData.kt.meta
  95. +39 −0 ...ion/Runtime/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/entities/HapticPattern.kt
  96. +32 −0 ...untime/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/entities/HapticPattern.kt.meta
  97. +8 −0 ....vibration/Runtime/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/entities/README.md
  98. +7 −0 ...ation/Runtime/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/entities/README.md.meta
  99. +74 −0 ...n/Runtime/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/entities/VibrationResult.kt
  100. +71 −0 ...time/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/entities/VibrationResult.kt.meta
  101. +8 −0 ...tfreslon.vibration/Runtime/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/enums.meta
  102. +9 −0 ...ation/Runtime/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/enums/IVibrationType.kt
  103. +32 −0 .../Runtime/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/enums/IVibrationType.kt.meta
  104. +8 −0 ...tion/Runtime/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/enums/VibrationRepeat.kt
  105. +32 −0 ...Runtime/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/enums/VibrationRepeat.kt.meta
  106. +444 −0 ...ration/Runtime/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/enums/VibrationType.kt
  107. +71 −0 ...n/Runtime/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/enums/VibrationType.kt.meta
  108. +8 −0 ...eslon.vibration/Runtime/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/extended.meta
  109. +218 −0 ...Runtime/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/extended/VibrationExtended.kt
  110. +32 −0 ...me/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/extended/VibrationExtended.kt.meta
  111. +8 −0 ...ration/Runtime/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/extended/entities.meta
  112. +73 −0 ...ugins/Android/java/com/benoitfreslon/unity/vibrations/lib/extended/entities/HapticDataExtended.kt
  113. +32 −0 .../Android/java/com/benoitfreslon/unity/vibrations/lib/extended/entities/HapticDataExtended.kt.meta
  114. +8 −0 ...vibration/Runtime/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/extended/enums.meta
  115. +296 −0 ...ugins/Android/java/com/benoitfreslon/unity/vibrations/lib/extended/enums/VibrationTypeExtended.kt
  116. +32 −0 .../Android/java/com/benoitfreslon/unity/vibrations/lib/extended/enums/VibrationTypeExtended.kt.meta
  117. +8 −0 ...lon.vibration/Runtime/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/extensions.meta
  118. +82 −0 ...Runtime/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/extensions/AudioAttributes.kt
  119. +32 −0 ...me/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/extensions/AudioAttributes.kt.meta
  120. +36 −0 ....vibration/Runtime/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/extensions/Enum.kt
  121. +32 −0 ...ation/Runtime/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/extensions/Enum.kt.meta
  122. +22 −0 ...ime/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/extensions/VibrationAttributes.kt
  123. +32 −0 ...lugins/Android/java/com/benoitfreslon/unity/vibrations/lib/extensions/VibrationAttributes.kt.meta
  124. +57 −0 ...ration/Runtime/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/extensions/Vibrator.kt
  125. +32 −0 ...n/Runtime/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/extensions/Vibrator.kt.meta
  126. +8 −0 ...ion/Runtime/Plugins/Android/java/com/benoitfreslon/unity/vibrations/lib/extensions/functions.meta
  127. +63 −0 ...ns/Android/java/com/benoitfreslon/unity/vibrations/lib/extensions/functions/VibrationFunctions.kt
  128. +32 −0 ...droid/java/com/benoitfreslon/unity/vibrations/lib/extensions/functions/VibrationFunctions.kt.meta
  129. +8 −0 Packages/com.benoitfreslon.vibration/Runtime/Plugins/WebGL.meta
  130. +8 −0 Packages/com.benoitfreslon.vibration/Runtime/Plugins/WebGL/Lib.meta
  131. +35 −0 Packages/com.benoitfreslon.vibration/Runtime/Plugins/WebGL/Lib/global_functions.jspre
  132. +32 −0 Packages/com.benoitfreslon.vibration/Runtime/Plugins/WebGL/Lib/global_functions.jspre.meta
  133. +369 −0 Packages/com.benoitfreslon.vibration/Runtime/Plugins/WebGL/Lib/vibration_library.jspre
  134. +32 −0 Packages/com.benoitfreslon.vibration/Runtime/Plugins/WebGL/Lib/vibration_library.jspre.meta
  135. +16 −0 Packages/com.benoitfreslon.vibration/Runtime/Plugins/WebGL/README.md
  136. +7 −0 Packages/com.benoitfreslon.vibration/Runtime/Plugins/WebGL/README.md.meta
  137. +60 −0 Packages/com.benoitfreslon.vibration/Runtime/Plugins/WebGL/vibration.jslib
  138. +32 −0 Packages/com.benoitfreslon.vibration/Runtime/Plugins/WebGL/vibration.jslib.meta
  139. 0 { → Packages/com.benoitfreslon.vibration/Runtime}/Plugins/iOS.meta
  140. 0 { → Packages/com.benoitfreslon.vibration/Runtime}/Plugins/iOS/Vibration.meta
  141. 0 { → Packages/com.benoitfreslon.vibration/Runtime}/Plugins/iOS/Vibration/Vibration.h
  142. 0 { → Packages/com.benoitfreslon.vibration/Runtime}/Plugins/iOS/Vibration/Vibration.h.meta
  143. 0 { → Packages/com.benoitfreslon.vibration/Runtime}/Plugins/iOS/Vibration/Vibration.mm
  144. 0 { → Packages/com.benoitfreslon.vibration/Runtime}/Plugins/iOS/Vibration/Vibration.mm.meta
  145. +8 −0 Packages/com.benoitfreslon.vibration/Runtime/Resources.meta
  146. +8 −0 Packages/com.benoitfreslon.vibration/Runtime/Resources/ScriptableObjects.meta
  147. +15 −0 Packages/com.benoitfreslon.vibration/Runtime/Resources/ScriptableObjects/ConfigOptions.asset
  148. +8 −0 Packages/com.benoitfreslon.vibration/Runtime/Resources/ScriptableObjects/ConfigOptions.asset.meta
  149. +8 −0 Packages/com.benoitfreslon.vibration/Runtime/Scripts.meta
  150. +3 −0 Packages/com.benoitfreslon.vibration/Runtime/Scripts/Enums.meta
  151. +130 −0 Packages/com.benoitfreslon.vibration/Runtime/Scripts/Enums/Enumeration.cs
  152. +3 −0 Packages/com.benoitfreslon.vibration/Runtime/Scripts/Enums/Enumeration.cs.meta
  153. +57 −0 Packages/com.benoitfreslon.vibration/Runtime/Scripts/Enums/MobileTimeUnit.cs
  154. +3 −0 Packages/com.benoitfreslon.vibration/Runtime/Scripts/Enums/MobileTimeUnit.cs.meta
  155. +10 −0 Packages/com.benoitfreslon.vibration/Runtime/Scripts/Enums/VibrationRepeat.cs
  156. +11 −0 Packages/com.benoitfreslon.vibration/Runtime/Scripts/Enums/VibrationRepeat.cs.meta
  157. +205 −0 Packages/com.benoitfreslon.vibration/Runtime/Scripts/Enums/VibrationType.cs
  158. +11 −0 Packages/com.benoitfreslon.vibration/Runtime/Scripts/Enums/VibrationType.cs.meta
  159. +8 −0 Packages/com.benoitfreslon.vibration/Runtime/Scripts/Mobile.meta
  160. +71 −0 Packages/com.benoitfreslon.vibration/Runtime/Scripts/Mobile/AndroidBuild.cs
  161. +11 −0 Packages/com.benoitfreslon.vibration/Runtime/Scripts/Mobile/AndroidBuild.cs.meta
  162. +6 −0 Packages/com.benoitfreslon.vibration/Runtime/Scripts/Mobile/README.md
  163. +3 −0 Packages/com.benoitfreslon.vibration/Runtime/Scripts/Mobile/README.md.meta
  164. +8 −0 Packages/com.benoitfreslon.vibration/Runtime/Scripts/Save.meta
  165. +15 −0 Packages/com.benoitfreslon.vibration/Runtime/Scripts/Save/Options.cs
  166. +11 −0 Packages/com.benoitfreslon.vibration/Runtime/Scripts/Save/Options.cs.meta
  167. +274 −0 Packages/com.benoitfreslon.vibration/Runtime/Scripts/Vibration.cs
  168. +1 −2 { → Packages/com.benoitfreslon.vibration/Runtime/Scripts}/Vibration.cs.meta
  169. +495 −0 Packages/com.benoitfreslon.vibration/Runtime/Scripts/VibrationComponent.cs
  170. +11 −0 Packages/com.benoitfreslon.vibration/Runtime/Scripts/VibrationComponent.cs.meta
  171. +14 −0 Packages/com.benoitfreslon.vibration/Runtime/Vibration.asmdef
  172. +7 −0 Packages/com.benoitfreslon.vibration/Runtime/Vibration.asmdef.meta
  173. +8 −0 Packages/com.benoitfreslon.vibration/Samples.meta
  174. +3 −0 Packages/com.benoitfreslon.vibration/Samples/Vibration.Samples.asmref
  175. +7 −0 Packages/com.benoitfreslon.vibration/Samples/Vibration.Samples.asmref.meta
  176. +8 −0 Packages/com.benoitfreslon.vibration/Samples/VibrationExample.meta
  177. +83 −0 Packages/com.benoitfreslon.vibration/Samples/VibrationExample/VibrationExample.cs
  178. 0 {Example → Packages/com.benoitfreslon.vibration/Samples/VibrationExample}/VibrationExample.cs.meta
  179. +345 −68 {Example → Packages/com.benoitfreslon.vibration/Samples/VibrationExample}/VibrationExample.unity
  180. +1 −1 ...mple → Packages/com.benoitfreslon.vibration/Samples/VibrationExample}/VibrationExample.unity.meta
  181. +8 −0 Packages/com.benoitfreslon.vibration/Tests.meta
  182. +8 −0 Packages/com.benoitfreslon.vibration/Tests/Editor.meta
  183. +91 −0 Packages/com.benoitfreslon.vibration/Tests/Editor/MobileTimeUnitTest.cs
  184. +11 −0 Packages/com.benoitfreslon.vibration/Tests/Editor/MobileTimeUnitTest.cs.meta
  185. +21 −0 Packages/com.benoitfreslon.vibration/Tests/Editor/Vibration.Editor.Tests.asmdef
  186. +7 −0 Packages/com.benoitfreslon.vibration/Tests/Editor/Vibration.Editor.Tests.asmdef.meta
  187. +1,450 −0 Packages/com.benoitfreslon.vibration/package-lock.json
  188. +35 −0 Packages/com.benoitfreslon.vibration/package.json
  189. +7 −0 Packages/com.benoitfreslon.vibration/package.json.meta
  190. +45 −0 Packages/manifest.json
  191. +465 −0 Packages/packages-lock.json
  192. +19 −0 ProjectSettings/AudioManager.asset
  193. +16 −0 ProjectSettings/BurstAotSettings_WebGL.json
  194. +6 −0 ProjectSettings/ClusterInputManager.asset
  195. +6 −0 ProjectSettings/CommonBurstAotSettings.json
  196. +37 −0 ProjectSettings/DynamicsManager.asset
  197. +11 −0 ProjectSettings/EditorBuildSettings.asset
  198. +40 −0 ProjectSettings/EditorSettings.asset
  199. +64 −0 ProjectSettings/GraphicsSettings.asset
  200. +487 −0 ProjectSettings/InputManager.asset
  201. +35 −0 ProjectSettings/MemorySettings.asset
  202. +93 −0 ProjectSettings/NavMeshAreas.asset
  203. +8 −0 ProjectSettings/NetworkManager.asset
  204. +44 −0 ProjectSettings/PackageManagerSettings.asset
  205. +56 −0 ProjectSettings/Physics2DSettings.asset
  206. +7 −0 ProjectSettings/PresetManager.asset
  207. +895 −0 ProjectSettings/ProjectSettings.asset
  208. +2 −0 ProjectSettings/ProjectVersion.txt
  209. +239 −0 ProjectSettings/QualitySettings.asset
  210. +167 −0 ProjectSettings/SceneTemplateSettings.json
  211. +43 −0 ProjectSettings/TagManager.asset
  212. +9 −0 ProjectSettings/TimeManager.asset
  213. +36 −0 ProjectSettings/UnityConnectSettings.asset
  214. +14 −0 ProjectSettings/VFXManager.asset
  215. +8 −0 ProjectSettings/VersionControlSettings.asset
  216. +10 −0 ProjectSettings/XRSettings.asset
  217. +372 −16 README.md
  218. +0 −146 Vibration.cs
  219. +557 −0 package-lock.json
  220. +26 −0 package.json
5 changes: 5 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# ---------------------
# dotenv: Environment variables
# to be used inside of npm scripts
# ---------------------
REPOSITORY_ROOT=$PWD
351 changes: 351 additions & 0 deletions .github/scripts/functions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,351 @@
#!/bin/bash
# @file functions
# @brief CI and local package release "automation" functions.

#
# @description Parse and return a version value from a "package.json" file
#
# @see [shdoc](https://github.com/reconquest/shdoc)
# @example
# packageVersion "<PATH>/package.json"
packageVersion() {
local package_json_file=$1
local version=""
while read a b ; do
[ "$a" = '"version":' ] && { b="${b%\"*}" ; version="${b#\"}" ; break ; }
done < $package_json_file
echo $version
}

#
# @description $PKG_ROOT environment variable check. Should be a string
# with a root path of the package
#
# @see $PKG_ROOT
checkPkgRoot() {
if [ -z "$PKG_ROOT" ]
then
PKG_ROOT=$1
if [ -z "$PKG_ROOT" ]
then
PKG_ROOT="."
fi
fi
}

#
# @description Replace .env (default) file content with $PKG_ROOT variable value
#
# @see $PKG_ROOT
fixEnvFile() {
# $PKG_ROOT environment variable check
checkPkgRoot $1

# Fix env (default) file with correct value
# for environment variables
if [ -f "$PKG_ROOT/.env" ]
then
echo "[FIX .ENV] Replaced $(cat "$PKG_ROOT/.env") to => REPOSITORY_ROOT=."
echo "REPOSITORY_ROOT=." > "$PKG_ROOT/.env"
fi
}

# @description Add github actions state and output variables to be handled on .yml workflow files
#
# @see $GITHUB_OUTPUT
# @see [Deprecating save-state and set-output commands](https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands)
# @see [Github Actions: Output parameter](https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-output-parameter)
githubActionsOutputs() {
# PS: CURRENT_TAG and COMMIT_MESSAGE are handled here as "global/environment" variables
CURRENT_TAG=$(git describe --tags $(git rev-list --tags --max-count=1))
COMMIT_MESSAGE=$(git log -1 --pretty=%B)

echo "[GITHUB VARIABLES] Commit => $COMMIT_MESSAGE"

# Use the format {name}={value} instead of ::set-output
echo "TAG=$CURRENT_TAG" >> $GITHUB_OUTPUT
echo "COMMIT_MESSAGE=$COMMIT_MESSAGE" >> $GITHUB_OUTPUT
}

# @description Copy all content of the package folder to the ROOT dir
#
# @see [shdoc](https://github.com/reconquest/shdoc)
# @example
# # From the root folder, with "Packages/<PACKAGE_NAME>"
# copyPackagesContent
# # result: Copy "Packages/<PACKAGE_NAME>/*.*" to ROOT/
copyPackagesContent() {
shopt -s extglob dotglob

cp -rvf "Packages/$PKG_NAME/." "$PKG_ROOT/"
rm -rf ./Packages
}

# TODO: Move this common function to another script file in order to reuse (e.g .github/scripts/common.sh)
#
# @description Rename invalid package directories to be "untracked" by game engine, adding a "~" suffix
# (e.g "Samples" => "Samples~", "Documentation" => "Documentation~")
#
# @see $PKG_ROOT
# @see [shdoc](https://github.com/reconquest/shdoc)
renameInvalidDirs() {
# $PKG_ROOT environment variable check
checkPkgRoot $1

if [ $PKG_ROOT = "./" ]
then
echo "[RENAME DIRECTORIES] [Error] The \$PKG_ROOT => '$PKG_ROOT' should be just '.' for current directory."
return 1
fi

echo "[RENAME DIRECTORIES] Package Root: $PKG_ROOT/"

chmod -R 777 "$PKG_ROOT/"

# Rename UPM special directories with suffix "~"
if [ -d "$PKG_ROOT/Samples" ]
then
# PS: Replaced "mv" to "copy" + "remove" of Samples~ dir, because sometimes
# shows the error Permission Denied. Specially if Samples
# have several sub-directories
if [ ! -d "$PKG_ROOT/Samples~" ]
then
mkdir -p "$PKG_ROOT/Samples~"
fi

cp -Rf "$PKG_ROOT/Samples/." "$PKG_ROOT/Samples~/"

rm -rf "$PKG_ROOT/Samples"
rm -f "$PKG_ROOT/Samples.meta"

echo "[RENAMED] Samples => $PKG_ROOT/Samples~"
fi
if [ -d "$PKG_ROOT/Documentation" ] && [ ! -d "$PKG_ROOT/Documentation~" ]
then
mv "$PKG_ROOT/Documentation" "$PKG_ROOT/Documentation~"
rm -f "$PKG_ROOT/Documentation.meta"

echo "[RENAMED] Documentation => $PKG_ROOT/Documentation~"
fi
}

#
# @description Commit with a new version of the package and push the $PKG_BRANCH
# new orphan branch (usually "upm" branch)
#
# @see $PKG_BRANCH
# @see renameInvalidDirs()
# @see fixEnvFile()
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))";

local release_version=$(packageVersion "./package.json")

echo "[COMMIT AND PUSH] New version: $release_version"

renameInvalidDirs

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~

# .env (default) file path fix
fixEnvFile

git add VERSION.md~
git commit -am "fix: Samples => Samples~ and commit a new version: $release_version"
git push -f -u origin "$PKG_BRANCH"
}

# TODO: Move this function to another script file (e.g .github/scripts/local.sh)
#
# @description Copy a list of files and dirs from the ROOT to the package folder
#
# @arg $1 string A path configured as "$repository_root" local variable to be used as an origin
# path to copy content into package dir
# @arg $2 string A path configured as "$PKG_ROOT" environment variable to be used as
# root path of the package
#
# @see $PKG_ROOT
# @see [Exit the Bash Script if a Certain Condition Occurs](https://itslinuxfoss.com/exit-bash-script-if-certain-condition-occurs)
# @see [How to Check if a File or Directory Exists in Bash](https://linuxize.com/post/bash-check-if-file-exists)
copyFilesForPublish() {
local repository_root=$1

# $PKG_ROOT environment variable check
checkPkgRoot $2
local pkg_root_full_path=$(realpath $PKG_ROOT)

if [ -z "$repository_root" ]
then
echo "[COPY FILES] The parameter \$1 => \$repository_root is required: '$repository_root'"
return 1
else
if [[ "$repository_root" =~ \.$ ]]
then
repository_root="$repository_root/"
fi
fi

if [[ $repository_root == $pkg_root_full_path ]]
then
echo "[COPY FILES] Cannot copy a directory FROM: \$repository_root => '$repository_root' to \$PKG_ROOT => '$pkg_root_full_path', into itself"
return 1
fi

chmod -R 777 "$PKG_ROOT/"

echo "[COPY FILES] From \$repository_root: '$(realpath $repository_root)', to => \$PKG_ROOT: '$pkg_root_full_path'"

local files_copy=(README.md README.md.meta LICENSE LICENSE.meta Images Images.meta)
for file_name in "${files_copy[@]}"
do
if [[ -f "$repository_root/$file_name" && ! -f "$PKG_ROOT/$file_name" ]] || [[ -d "$repository_root/$file_name" && ! -d "$PKG_ROOT/$file_name" ]]
then
cp -rf "$repository_root/$file_name" "$PKG_ROOT/$file_name"
echo "[COPY FILES] Copied: $PKG_ROOT/$file_name"
fi
done
}

# TODO: [Feature] Use this function to loop over all packages and do all operations (copy files, rename and publish)
# @see checkPkgRoot
# @see [How do you store a list of directories into an array in Bash?](https://stackoverflow.com/a/4495304)
fetchPackages() {
local packages_root=$1
checkPkgRoot

# PS: "<PATH>/*/" is a glob that list only directories
if [ -z $packages_root ]
then
packages_root=(
$PKG_ROOT/Packages/*/
)
elif [ -d $packages_root ]
then
packages_root=(
$packages_root/*/
)
fi

for package_path in "${packages_root[@]}"
do
echo "[FETCH PACKAGES] Package: '$package_path'"
done
}

# TODO: Move this function to another script file (e.g .github/scripts/local.sh)
# TODO: Move common functions dependencies to another script file in order to reuse (e.g .github/scripts/common.sh)
#
# @description Automate all actions required before PUBLISH a package in a remote registry
#
# @arg $1 string A path configured as "$repository_root" local variable to be used as an origin
# path to copy content into package dir
# @arg $2 string A path configured as "$PKG_ROOT" environment variable to be used as
# root path of the package
#
# @arg $3 string A flag configured as "$PUBLISH_FORCE" environment variable to force
# publish from "./" root path (usually when publishing packages from a local repo)
#
# @see $PKG_ROOT
# @see $PUBLISH_FORCE
# @see renameInvalidDirs($PKG_ROOT)
# @see copyFilesForPublish($1)
# @see [Using Boolean Variables in Shell Scripts](https://tecadmin.net/boolean-variable-in-shell-script)
localBeforePublish() {
local repository_root=$1
local publish_forced='false'

# Check if publish "force" is true
if [ -z "$PUBLISH_FORCE" ]
then
PUBLISH_FORCE=$3
if [ -z "$PUBLISH_FORCE" ]
then
PUBLISH_FORCE=0
fi
fi

if [ $PUBLISH_FORCE -eq 1 ]
then
publish_forced='true'
fi

if [ -d $repository_root ] && [[ $repository_root != "./" && $repository_root != "." || $PUBLISH_FORCE -eq 1 ]]
then

echo "[PUBLISH: BEFORE/PRE] Forced => '$publish_forced'"

# $PKG_ROOT environment variable check
checkPkgRoot $2

renameInvalidDirs $PKG_ROOT
copyFilesForPublish $repository_root
else
echo "[PUBLISH: BEFORE/PRE] [Skip] Bypass package preparation because \$1 : \$repository_root => '$repository_root' is invalid"
fi
}

# TODO: Move this function to another script file (e.g .github/scripts/local.sh)
#
# @description PUBLISH a package in a remote registry. Usually used inside of a npm script
#
# @arg $1 string Overrides the $PKG_ROOT environment variable with a path to a package
#
# @see $PKG_ROOT
localPublish() {
# $PKG_ROOT environment variable check
checkPkgRoot $1

cd $PKG_ROOT

# Install dev dependencies if weren't installed yet
if [ ! -d "./node_modules" ]
then
npm i
fi
npm run package:prepare && npm publish
}

run() {
if [ $1 == "push" ]
then
commitAndPush
elif [ $1 == "movePackagesFolder" ]
then
copyPackagesContent
elif [ $1 == "githubActionsVariables" ]
then
githubActionsOutputs
elif [ $1 == "fetchPackages" ]
then
fetchPackages $2
elif [ $1 == "copyFilesForPublish" ]
then
copyFilesForPublish $2 $3
elif [ $1 == "fixEnvFile" ]
then
fixEnvFile $2
elif [ $1 == "renameInvalidDirs" ]
then
renameInvalidDirs $2
elif [ $1 == "localBeforePublish" ]
then
localBeforePublish $2
elif [ $1 == "localPublish" ]
then
localPublish $2
else
echo "[ERROR] INVALID SCRIPT OPERATION"
exit 1
fi
}

run $1 $2 $3
Loading