Files
tianrunCRM/Assets/3rd/NativeCamera/Plugins/Android/NCPermissionCallbackAndroid.cs
2020-07-18 21:12:14 +08:00

29 lines
583 B
C#

#if !UNITY_EDITOR && UNITY_ANDROID
using System.Threading;
using UnityEngine;
namespace NativeCameraNamespace
{
public class NCPermissionCallbackAndroid : AndroidJavaProxy
{
private object threadLock;
public int Result { get; private set; }
public NCPermissionCallbackAndroid( object threadLock ) : base( "com.yasirkula.unity.NativeCameraPermissionReceiver" )
{
Result = -1;
this.threadLock = threadLock;
}
public void OnPermissionResult( int result )
{
Result = result;
lock( threadLock )
{
Monitor.Pulse( threadLock );
}
}
}
}
#endif