File tree Expand file tree Collapse file tree 2 files changed +22
-9
lines changed
Assets/NatCamWithOpenCVForUnityExample/IntegrationWithNatShareExample Expand file tree Collapse file tree 2 files changed +22
-9
lines changed Original file line number Diff line number Diff line change 1- using NatShareU ;
1+ using NatShare ;
22using OpenCVForUnity . CoreModule ;
33using OpenCVForUnity . ImgprocModule ;
44using OpenCVForUnity . UnityUtils ;
@@ -143,16 +143,29 @@ protected override void OnDestroy()
143143
144144 public void OnShareButtonClick ( )
145145 {
146- NatShare . Share ( texture ,
147- ( ) =>
146+ using ( var payload = new SharePayload ( "NatCamWithOpenCVForUnityExample" ,
147+ completionHandler : ( ) =>
148148 {
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+ }
151156 }
152157
153158 public void OnSaveToCameraRollButtonClick ( )
154159 {
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+ }
156169 }
157170 }
158171}
Original file line number Diff line number Diff line change 1212
1313## Environment
1414- Anddroid (Pixel, Nexus 7) / iOS (iPhone8, iPhone6s)
15- - Unity >= 2017.1 +
15+ - Unity >= 2018.3 +
1616- Scripting backend MONO / IL2CPP
1717- [ 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 +
1919- [ OpenCV for Unity] ( https://assetstore.unity.com/packages/tools/integration/opencv-for-unity-21088?aid=1011l4ehR ) 2.3.7+
2020
2121
31311 . Import OpenCVForUnity.
3232 * Setup the OpenCVForUnity. (Tools > OpenCV for Unity > Set Plugin Import Settings)
33331 . 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.
35351 . Change the "Target minimum iOS Version" to 11 or higher in the "Player Settings (iOS)" Inspector.
36361 . Add the "Assets/NatCamWithOpenCVForUnityExample/* .unity" files to the "Scenes In Build" list in the "Build Settings" window.
37371 . Build and Deploy to Android and iOS.
You can’t perform that action at this time.
0 commit comments