File tree 2 files changed +22
-9
lines changed
Assets/NatCamWithOpenCVForUnityExample/IntegrationWithNatShareExample
2 files changed +22
-9
lines changed Original file line number Diff line number Diff line change 1
- using NatShareU ;
1
+ using NatShare ;
2
2
using OpenCVForUnity . CoreModule ;
3
3
using OpenCVForUnity . ImgprocModule ;
4
4
using OpenCVForUnity . UnityUtils ;
@@ -143,16 +143,29 @@ protected override void OnDestroy()
143
143
144
144
public void OnShareButtonClick ( )
145
145
{
146
- NatShare . Share ( texture ,
147
- ( ) =>
146
+ using ( var payload = new SharePayload ( "NatCamWithOpenCVForUnityExample" ,
147
+ completionHandler : ( ) =>
148
148
{
149
- Debug . Log ( "sharing is complete." ) ;
150
- } ) ;
149
+ Debug . Log ( "User shared image!" ) ;
150
+ }
151
+ ) )
152
+ {
153
+ payload . AddText ( "User shared image!" ) ;
154
+ payload . AddImage ( texture ) ;
155
+ }
151
156
}
152
157
153
158
public void OnSaveToCameraRollButtonClick ( )
154
159
{
155
- NatShare . SaveToCameraRoll ( texture , "NatCamWithOpenCVForUnityExample" ) ;
160
+ using ( var payload = new SavePayload ( "NatCamWithOpenCVForUnityExample" ,
161
+ completionHandler : ( ) =>
162
+ {
163
+ Debug . Log ( "User saved image to camera roll!" ) ;
164
+ }
165
+ ) )
166
+ {
167
+ payload . AddImage ( texture ) ;
168
+ }
156
169
}
157
170
}
158
171
}
Original file line number Diff line number Diff line change 12
12
13
13
## Environment
14
14
- Anddroid (Pixel, Nexus 7) / iOS (iPhone8, iPhone6s)
15
- - Unity >= 2017.1 +
15
+ - Unity >= 2018.3 +
16
16
- Scripting backend MONO / IL2CPP
17
17
- [ NatCam - WebCam API] ( https://assetstore.unity.com/packages/tools/integration/natcam-pro-webcam-api-52154?aid=1011l4ehR ) 2.3.0+
18
- - [ NatShare - Mobile Sharing API] ( https://assetstore.unity.com/packages/tools/integration/natshare-mobile-sharing-api-117705?aid=1011l4ehR ) 1.1f3 +
18
+ - [ NatShare - Mobile Sharing API] ( https://assetstore.unity.com/packages/tools/integration/natshare-mobile-sharing-api-117705?aid=1011l4ehR ) 1.2.0 +
19
19
- [ OpenCV for Unity] ( https://assetstore.unity.com/packages/tools/integration/opencv-for-unity-21088?aid=1011l4ehR ) 2.3.7+
20
20
21
21
31
31
1 . Import OpenCVForUnity.
32
32
* Setup the OpenCVForUnity. (Tools > OpenCV for Unity > Set Plugin Import Settings)
33
33
1 . Import the NatCamWithOpenCVForUnityExample.unitypackage.
34
- 1 . Change the "Minimum API Level" to 21 or higher in the "Player Settings (Androd)" Inspector.
34
+ 1 . Change the "Minimum API Level" to 22 or higher in the "Player Settings (Androd)" Inspector.
35
35
1 . Change the "Target minimum iOS Version" to 11 or higher in the "Player Settings (iOS)" Inspector.
36
36
1 . Add the "Assets/NatCamWithOpenCVForUnityExample/* .unity" files to the "Scenes In Build" list in the "Build Settings" window.
37
37
1 . Build and Deploy to Android and iOS.
You can’t perform that action at this time.
0 commit comments