-
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed main thread dispatcher (not used at the moment)
- Loading branch information
Showing
5 changed files
with
46 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
Plugins/AndroidRuntimePermissions/Android/PermissionCallbackHelper.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#if !UNITY_EDITOR && UNITY_ANDROID | ||
using UnityEngine; | ||
|
||
namespace AndroidRuntimePermissionsNamespace | ||
{ | ||
public class PermissionCallbackHelper : MonoBehaviour | ||
{ | ||
private System.Action mainThreadAction = null; | ||
|
||
private void Awake() | ||
{ | ||
DontDestroyOnLoad( gameObject ); | ||
} | ||
|
||
private void Update() | ||
{ | ||
if( mainThreadAction != null ) | ||
{ | ||
System.Action temp = mainThreadAction; | ||
mainThreadAction = null; | ||
temp(); | ||
} | ||
} | ||
|
||
public void CallOnMainThread( System.Action function ) | ||
{ | ||
mainThreadAction = function; | ||
} | ||
} | ||
} | ||
#endif |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
Binary file not shown.