Развитие системы растений
This commit is contained in:
1 parent
1b578067f3
commit
ba49ef5015
218 files changed
+70415
-1519
No files matched your search
@@ -0,0 +1,52 @@
|
||||
#if UNITY_EDITOR || UNITY_ANDROID
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NativeCameraNamespace
|
||||
{
|
||||
public class NCCallbackHelper : MonoBehaviour
|
||||
{
|
||||
private bool autoDestroyWithCallback;
|
||||
private Action mainThreadAction = null;
|
||||
|
||||
public static NCCallbackHelper Create( bool autoDestroyWithCallback )
|
||||
{
|
||||
NCCallbackHelper result = new GameObject( "NCCallbackHelper" ).AddComponent<NCCallbackHelper>();
|
||||
result.autoDestroyWithCallback = autoDestroyWithCallback;
|
||||
DontDestroyOnLoad( result.gameObject );
|
||||
return result;
|
||||
}
|
||||
|
||||
public void CallOnMainThread( Action function )
|
||||
{
|
||||
lock( this )
|
||||
{
|
||||
mainThreadAction += function;
|
||||
}
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if( mainThreadAction != null )
|
||||
{
|
||||
try
|
||||
{
|
||||
Action temp;
|
||||
lock( this )
|
||||
{
|
||||
temp = mainThreadAction;
|
||||
mainThreadAction = null;
|
||||
}
|
||||
|
||||
temp();
|
||||
}
|
||||
finally
|
||||
{
|
||||
if( autoDestroyWithCallback )
|
||||
Destroy( gameObject );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b2bbe0051e738ea4585119c46d863f19
|
||||
timeCreated: 1545147258
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 117802
|
||||
packageName: Native Camera for Android & iOS
|
||||
packageVersion: 1.5.0
|
||||
assetPath: Assets/Plugins/NativeCamera/Android/NCCallbackHelper.cs
|
||||
uploadId: 746912
|
||||
@@ -0,0 +1,24 @@
|
||||
#if UNITY_EDITOR || UNITY_ANDROID
|
||||
using UnityEngine;
|
||||
|
||||
namespace NativeCameraNamespace
|
||||
{
|
||||
public class NCCameraCallbackAndroid : AndroidJavaProxy
|
||||
{
|
||||
private readonly NativeCamera.CameraCallback callback;
|
||||
private readonly NCCallbackHelper callbackHelper;
|
||||
|
||||
public NCCameraCallbackAndroid( NativeCamera.CameraCallback callback ) : base( "com.yasirkula.unity.NativeCameraMediaReceiver" )
|
||||
{
|
||||
this.callback = callback;
|
||||
callbackHelper = NCCallbackHelper.Create( true );
|
||||
}
|
||||
|
||||
[UnityEngine.Scripting.Preserve]
|
||||
public void OnMediaReceived( string path )
|
||||
{
|
||||
callbackHelper.CallOnMainThread( () => callback( !string.IsNullOrEmpty( path ) ? path : null ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3cc8df584d2a4344b929a4f13a53723a
|
||||
timeCreated: 1519060539
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 117802
|
||||
packageName: Native Camera for Android & iOS
|
||||
packageVersion: 1.5.0
|
||||
assetPath: Assets/Plugins/NativeCamera/Android/NCCameraCallbackAndroid.cs
|
||||
uploadId: 746912
|
||||
@@ -0,0 +1,24 @@
|
||||
#if UNITY_EDITOR || UNITY_ANDROID
|
||||
using UnityEngine;
|
||||
|
||||
namespace NativeCameraNamespace
|
||||
{
|
||||
public class NCPermissionCallbackAndroid : AndroidJavaProxy
|
||||
{
|
||||
private readonly NativeCamera.PermissionCallback callback;
|
||||
private readonly NCCallbackHelper callbackHelper;
|
||||
|
||||
public NCPermissionCallbackAndroid( NativeCamera.PermissionCallback callback ) : base( "com.yasirkula.unity.NativeCameraPermissionReceiver" )
|
||||
{
|
||||
this.callback = callback;
|
||||
callbackHelper = NCCallbackHelper.Create( true );
|
||||
}
|
||||
|
||||
[UnityEngine.Scripting.Preserve]
|
||||
public void OnPermissionResult( int result )
|
||||
{
|
||||
callbackHelper.CallOnMainThread( () => callback( (NativeCamera.Permission) result ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bafa24bbc8c455f44a2b98dcbe6451bd
|
||||
timeCreated: 1519060539
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 117802
|
||||
packageName: Native Camera for Android & iOS
|
||||
packageVersion: 1.5.0
|
||||
assetPath: Assets/Plugins/NativeCamera/Android/NCPermissionCallbackAndroid.cs
|
||||
uploadId: 746912
|
||||
Binary file not shown.
@@ -0,0 +1,40 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 284037eba2526f54d9cf51b5d9bffcfa
|
||||
timeCreated: 1569764737
|
||||
licenseType: Store
|
||||
PluginImporter:
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
platformData:
|
||||
data:
|
||||
first:
|
||||
Android: Android
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
data:
|
||||
first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
data:
|
||||
first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 117802
|
||||
packageName: Native Camera for Android & iOS
|
||||
packageVersion: 1.5.0
|
||||
assetPath: Assets/Plugins/NativeCamera/Android/NativeCamera.aar
|
||||
uploadId: 746912
|
||||
Reference in new issue
Block a user