/// <summary> /// Shows the file upload UI. /// </summary> /// <returns><c>true</c>, if file upload UI was showd, <c>false</c> otherwise.</returns> /// <param name="isDropInput">If set to <c>true</c> is drop input.</param> /// <param name="isOverlay">If set to <c>true</c> is overlay.</param> /// <param name="x">The x coordinate.</param> /// <param name="y">The y coordinate.</param> /// <param name="width">Width.</param> /// <param name="height">Height.</param> public static bool Show(bool isDropInput = false, bool isOverlay = false, int x = -1, int y = -1, int width = -1, int height = -1) { #if UNITY_WEBGL && !UNITY_EDITOR bool success = WebGLFileUploadManager.Unity_FileUploadManager_Show(isDropInput, isOverlay, x, y, width, height); WebGLFileUploadManager.Unity_FileUploadManager_SetCallback(WebGLFileUploadManager.Callback); return(success); #else return(false); #endif }
public static void InitFileUploader(bool isDropInput = false, bool isOverlay = false) { #if UNITY_WEBGL && !UNITY_EDITOR if (IsInitialized) { Dispose(); } WebGLFileUploadManager.Unity_FileUploadManager_SetCallback(WebGLFileUploadManager.Callback); WebGLFileUploadManager.Unity_FileUploadManager_InitFileUploader(isDropInput, isOverlay); #endif }
/// <summary> /// Popup the file upload dialog UI. /// </summary> /// <returns><c>true</c>, if dialog was popuped, <c>false</c> otherwise.</returns> /// <param name="titleText">Title text.</param> /// <param name="uploadBtnText">Upload button text.</param> /// <param name="cancelBtnText">Cancel button text.</param> public static bool PopupDialog(string titleText = "", string uploadBtnText = "", string cancelBtnText = "") { #if UNITY_WEBGL && !UNITY_EDITOR if (Screen.fullScreen) { if (Unity_FileUploadManager_IsRunningOnEdgeBrowser()) { Screen.fullScreen = false; } else { Unity_FileUploadManager_HideUnityScreenIfHtmlOverlayCant(); } } bool success = WebGLFileUploadManager.Unity_FileUploadManager_PopupDialog(titleText, uploadBtnText, cancelBtnText); WebGLFileUploadManager.Unity_FileUploadManager_SetCallback(WebGLFileUploadManager.Callback); return(success); #else return(false); #endif }
public static void PopupDialog(string titleText = "", string uploadBtnText = "", string cancelBtnText = "") { #if UNITY_WEBGL && !UNITY_EDITOR if (IsInitialized) { Dispose(); } if (Screen.fullScreen) { if (Unity_FileUploadManager_IsRunningOnEdgeBrowser()) { Screen.fullScreen = false; } else { Unity_FileUploadManager_HideUnityScreenIfHtmlOverlayCant(); } } WebGLFileUploadManager.Unity_FileUploadManager_SetCallback(WebGLFileUploadManager.Callback); WebGLFileUploadManager.Unity_FileUploadManager_PopupDialog(titleText, uploadBtnText, cancelBtnText); #endif }