Skip to content

matterless/Unity-IOS-HapticEngine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unity-IOS-HapticEngine

Build Framework from swift project

Generate Xcode Project

swift package generate-xcodeproj --skip-extra-files

Create Unity plugin framework

xcodebuild -project yourproject.xcodeproj -scheme yourproject-Package -configuration Release -sdk iphoneos CONFIGURATION_BUILD_DIR=.

How to use it

  1. Drag the file yourproject.framework in your Unity project under Asset/Plugin/iOS
  2. Enable Add to Embedded Binaries.

Inside Unity

Start Haptic Engine

[DllImport("__Internal")]
private static extern void Haptic_StartContinuousHapticEngine();

Play Haptic Engine

[DllImport("__Internal")]
private static extern void Haptic_PlayContinuousHaptic(float sharpness, float intensity);

** For more information about sharpness and intensity, please read the document from Apple https://developer.apple.com/documentation/corehaptics

Stop Haptic Engine

[DllImport("__Internal")]
private static extern void Haptic_StopContinuousHaptic();

About

Using IOS Haptic Engine

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages