public void OnOperationCancelled(string message) { IsBusy = false; NativeFilePicker.FilePickedCallback _pickCallback = pickCallback; NativeFilePicker.MultipleFilesPickedCallback _pickCallbackMultiple = pickCallbackMultiple; NativeFilePicker.FilesExportedCallback _exportCallback = exportCallback; pickCallback = null; pickCallbackMultiple = null; exportCallback = null; if (_pickCallback != null) { _pickCallback(null); } if (_pickCallbackMultiple != null) { _pickCallbackMultiple(null); } if (_exportCallback != null) { _exportCallback(false); } }
public FPResultCallbackAndroid(NativeFilePicker.FilePickedCallback pickCallback, NativeFilePicker.MultipleFilesPickedCallback pickCallbackMultiple, NativeFilePicker.FilesExportedCallback exportCallback) : base("com.yasirkula.unity.NativeFilePickerResultReceiver") { this.pickCallback = pickCallback; this.pickCallbackMultiple = pickCallbackMultiple; this.exportCallback = exportCallback; callbackHelper = new GameObject("FPCallbackHelper").AddComponent <FPCallbackHelper>(); }
public void OnMultipleFilesPicked(string paths) { IsBusy = false; string[] _paths = SplitPaths(paths); if (_paths != null && _paths.Length == 0) { _paths = null; } if (pickCallbackMultiple != null) { pickCallbackMultiple(_paths); pickCallbackMultiple = null; } }
public void OnOperationCancelled(string message) { IsBusy = false; if (pickCallback != null) { pickCallback(null); pickCallback = null; } if (pickCallbackMultiple != null) { pickCallbackMultiple(null); pickCallbackMultiple = null; } if (exportCallback != null) { exportCallback(false); exportCallback = null; } }
public static void Initialize(NativeFilePicker.FilePickedCallback pickCallback, NativeFilePicker.MultipleFilesPickedCallback pickCallbackMultiple, NativeFilePicker.FilesExportedCallback exportCallback) { if (IsBusy) { return; } if (instance == null) { instance = new GameObject("FPResultCallbackiOS").AddComponent <FPResultCallbackiOS>(); DontDestroyOnLoad(instance.gameObject); } instance.pickCallback = pickCallback; instance.pickCallbackMultiple = pickCallbackMultiple; instance.exportCallback = exportCallback; instance.nextBusyCheckTime = Time.realtimeSinceStartup + 1f; IsBusy = true; }