Skip to content

Commit ffa7dd8

Browse files
committed
Renamed directory.
0 parents  commit ffa7dd8

10 files changed

+268
-0
lines changed

CandyCoded.UnityiOSBridge.asmdef

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"name": "CandyCoded.UnityiOSBridge"
3+
}

CandyCoded.UnityiOSBridge.asmdef.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Plugins.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Plugins/iOS.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Plugins/iOS/IOSBridge.cs

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
using System.Runtime.InteropServices;
2+
3+
namespace CandyCoded
4+
{
5+
6+
public static class IOSBridge
7+
{
8+
9+
[DllImport("__Internal")]
10+
public static extern bool IOSPermissionCameraOK();
11+
12+
[DllImport("__Internal")]
13+
public static extern bool IOSIsLowPowerModeEnabled();
14+
15+
[DllImport("__Internal")]
16+
public static extern bool IOSUIAccessibilityIsAssistiveTouchRunning();
17+
18+
[DllImport("__Internal")]
19+
public static extern bool IOSUIAccessibilityIsVoiceOverRunning();
20+
21+
[DllImport("__Internal")]
22+
public static extern bool IOSUIAccessibilityIsSwitchControlRunning();
23+
24+
[DllImport("__Internal")]
25+
public static extern bool IOSUIAccessibilityIsShakeToUndoEnabled();
26+
27+
[DllImport("__Internal")]
28+
public static extern bool IOSUIAccessibilityIsClosedCaptioningEnabled();
29+
30+
[DllImport("__Internal")]
31+
public static extern bool IOSUIAccessibilityIsBoldTextEnabled();
32+
33+
[DllImport("__Internal")]
34+
public static extern bool IOSUIAccessibilityDarkerSystemColorsEnabled();
35+
36+
[DllImport("__Internal")]
37+
public static extern bool IOSUIAccessibilityIsGrayscaleEnabled();
38+
39+
[DllImport("__Internal")]
40+
public static extern bool IOSUIAccessibilityIsGuidedAccessEnabled();
41+
42+
[DllImport("__Internal")]
43+
public static extern bool IOSUIAccessibilityIsInvertColorsEnabled();
44+
45+
[DllImport("__Internal")]
46+
public static extern bool IOSUIAccessibilityIsMonoAudioEnabled();
47+
48+
[DllImport("__Internal")]
49+
public static extern bool IOSUIAccessibilityIsReduceMotionEnabled();
50+
51+
[DllImport("__Internal")]
52+
public static extern bool IOSUIAccessibilityIsReduceTransparencyEnabled();
53+
54+
[DllImport("__Internal")]
55+
public static extern bool IOSUIAccessibilityIsSpeakScreenEnabled();
56+
57+
[DllImport("__Internal")]
58+
public static extern bool IOSUIAccessibilityIsSpeakSelectionEnabled();
59+
60+
[DllImport("__Internal")]
61+
public static extern bool IOSUIImpactFeedbackGenerator(string style = "medium");
62+
63+
}
64+
65+
}

Plugins/iOS/IOSBridge.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Plugins/iOS/IOSBridge.mm

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
#import <Foundation/Foundation.h>
2+
#import <AVFoundation/AVFoundation.h>
3+
#import <UIKit/UIKit.h>
4+
5+
extern "C"
6+
{
7+
8+
bool IOSPermissionCameraOK() {
9+
10+
NSString *mediaType = AVMediaTypeVideo;
11+
AVAuthorizationStatus authStatus = [AVCaptureDevice authorizationStatusForMediaType:mediaType];
12+
13+
return authStatus == AVAuthorizationStatusAuthorized;
14+
15+
}
16+
17+
bool IOSIsLowPowerModeEnabled() {
18+
return [[NSProcessInfo processInfo] isLowPowerModeEnabled];
19+
}
20+
21+
bool IOSUIAccessibilityIsAssistiveTouchRunning() {
22+
return UIAccessibilityIsAssistiveTouchRunning();
23+
}
24+
25+
bool IOSUIAccessibilityIsVoiceOverRunning() {
26+
return UIAccessibilityIsVoiceOverRunning();
27+
}
28+
29+
bool IOSUIAccessibilityIsSwitchControlRunning() {
30+
return UIAccessibilityIsSwitchControlRunning();
31+
}
32+
33+
bool IOSUIAccessibilityIsShakeToUndoEnabled() {
34+
return UIAccessibilityIsShakeToUndoEnabled();
35+
}
36+
37+
bool IOSUIAccessibilityIsClosedCaptioningEnabled() {
38+
return UIAccessibilityIsClosedCaptioningEnabled();
39+
}
40+
41+
bool IOSUIAccessibilityIsBoldTextEnabled() {
42+
return UIAccessibilityIsBoldTextEnabled();
43+
}
44+
45+
bool IOSUIAccessibilityDarkerSystemColorsEnabled() {
46+
return UIAccessibilityDarkerSystemColorsEnabled();
47+
}
48+
49+
bool IOSUIAccessibilityIsGrayscaleEnabled() {
50+
return UIAccessibilityIsGrayscaleEnabled();
51+
}
52+
53+
bool IOSUIAccessibilityIsGuidedAccessEnabled() {
54+
return UIAccessibilityIsGuidedAccessEnabled();
55+
}
56+
57+
bool IOSUIAccessibilityIsInvertColorsEnabled() {
58+
return UIAccessibilityIsInvertColorsEnabled();
59+
}
60+
61+
bool IOSUIAccessibilityIsMonoAudioEnabled() {
62+
return UIAccessibilityIsMonoAudioEnabled();
63+
}
64+
65+
bool IOSUIAccessibilityIsReduceMotionEnabled() {
66+
return UIAccessibilityIsReduceMotionEnabled();
67+
}
68+
69+
bool IOSUIAccessibilityIsReduceTransparencyEnabled() {
70+
return UIAccessibilityIsReduceTransparencyEnabled();
71+
}
72+
73+
bool IOSUIAccessibilityIsSpeakScreenEnabled() {
74+
return UIAccessibilityIsSpeakScreenEnabled();
75+
}
76+
77+
bool IOSUIAccessibilityIsSpeakSelectionEnabled() {
78+
return UIAccessibilityIsSpeakSelectionEnabled();
79+
}
80+
81+
void IOSUIImpactFeedbackGenerator(const char* style) {
82+
83+
UIImpactFeedbackStyle feedbackStyle;
84+
85+
const NSString* styleString = [NSString stringWithUTF8String: style];
86+
87+
if ([styleString isEqualToString:@"light"]) {
88+
89+
feedbackStyle = UIImpactFeedbackStyleLight;
90+
91+
} else if ([styleString isEqualToString:@"medium"]) {
92+
93+
feedbackStyle = UIImpactFeedbackStyleMedium;
94+
95+
} else if ([styleString isEqualToString:@"heavy"]) {
96+
97+
feedbackStyle = UIImpactFeedbackStyleHeavy;
98+
99+
} else {
100+
101+
NSException* exception = [NSException
102+
exceptionWithName:NSInvalidArgumentException
103+
reason:@"Invalid inpact feedback style."
104+
userInfo:nil];
105+
106+
[exception raise];
107+
108+
}
109+
110+
UIImpactFeedbackGenerator *feedbackGenerator = [[UIImpactFeedbackGenerator alloc] initWithStyle:feedbackStyle];
111+
112+
[feedbackGenerator impactOccurred];
113+
114+
}
115+
116+
}

Plugins/iOS/IOSBridge.mm.meta

Lines changed: 32 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"name": "com.candycoded.unity-ios-bridge",
3+
"displayName": "Unity iOS Bridge",
4+
"version": "1.0.0",
5+
"unity": "2018.3",
6+
"description": "Bridge for requesting state from an iOS device",
7+
"keywords": [
8+
"ios"
9+
],
10+
"dependencies": {}
11+
}

package.json.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)