Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ryanslikesocool/hapticskit
Quick access to iOS haptics functions for Unity
https://github.com/ryanslikesocool/hapticskit
Last synced: 7 days ago
JSON representation
Quick access to iOS haptics functions for Unity
- Host: GitHub
- URL: https://github.com/ryanslikesocool/hapticskit
- Owner: ryanslikesocool
- License: mit
- Created: 2021-10-10T08:31:28.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-12-28T08:50:30.000Z (11 months ago)
- Last Synced: 2024-04-18T14:02:22.832Z (7 months ago)
- Language: C#
- Size: 73.2 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# HapticsKit
Quick access to iOS haptics functions for Unity.## Requirements
- A recent version of Unity
- An iPhone 7 or later running iOS 12 or later## Installation
**Recommended Installation** (Unity Package Manager)
- "Add package from git URL..."
- https://github.com/ryanslikesocool/HapticsKit.git**Alternate Installation**
- Get the latest [release](https://github.com/ryanslikesocool/HapticsKit/releases)
- Open with the desired Unity project
- Import into the Plugins folder## Usage
Import HapticsKit into a C# script with `using HapticsKit;`Check if the current device supports haptics.
```cs
bool currentDeviceSupportsHaptics = HapticsController.SupportsHaptics;
```Call one of the methods in `HapticsController`.\
These methods act as a C# wrapper around the Obj-C source.
```cs
HapticsController.NotificationFeedback(NotificationType.Success);
HapticsController.ImpactFeedback(ImpactType.Light);
HapticsController.SelectionFeedback();
//etc...
```Notification and Impact feedbacks have a range of options
```cs
// Notification
NotificationType.Success
NotificationType.Warning
NotificationType.Error//Impact
ImpactType.Light
ImpactType.Medium
ImpactType.Heavy
ImpactType.Soft
ImpactType.Rigid
```