react-unity-webgl
Advanced tools
Comparing version 7.1.3 to 7.1.4
declare class LoggingService { | ||
warnUnityContentRemoveNotAvailable(): void; | ||
errorUnityLoaderNotFound(): void; | ||
warnUnityContentRemoveNotAvailable(additionalDetials?: any): void; | ||
errorUnityLoaderNotFound(additionalDetials?: any): void; | ||
private warn; | ||
@@ -5,0 +5,0 @@ private error; |
@@ -6,7 +6,7 @@ "use strict"; | ||
} | ||
LoggingService.prototype.warnUnityContentRemoveNotAvailable = function () { | ||
this.warn("Your version of Unity does not support unloading the WebGL Player.", "This preverts ReactUnityWebGL from unmounting this component properly.", "Please consider updating to Unity 2019.1 or newer, or reload the page", "to free the WebGL Player from the memory. See the follow link for more details:", "https://github.com/elraccoone/react-unity-webgl/issues/22"); | ||
LoggingService.prototype.warnUnityContentRemoveNotAvailable = function (additionalDetials) { | ||
this.warn("Your version of Unity does not support unloading the WebGL Player.", "This preverts ReactUnityWebGL from unmounting this component properly.", "Please consider updating to Unity 2019.1 or newer, or reload the page", "to free the WebGL Player from the memory. See the follow link for more details:", "https://github.com/elraccoone/react-unity-webgl/issues/22", additionalDetials); | ||
}; | ||
LoggingService.prototype.errorUnityLoaderNotFound = function () { | ||
this.warn("Unable to use the Unity Loader, please make sure you've imported", "the Unity Loader the correct way. You might have entered an incorrect", "path to the UnityLoader.js. The path is not relative to your bundle,", "but to your index html file. See the follow link for more details: ", "https://github.com/elraccoone/react-unity-webgl/issues/31"); | ||
LoggingService.prototype.errorUnityLoaderNotFound = function (additionalDetials) { | ||
this.error("Unable to use the Unity Loader, please make sure you've imported", "the Unity Loader the correct way. You might have entered an incorrect", "path to the UnityLoader.js. The path is not relative to your bundle,", "but to your index html file. See the follow link for more details: ", "https://github.com/elraccoone/react-unity-webgl/issues/31", additionalDetials); | ||
}; | ||
@@ -18,3 +18,3 @@ LoggingService.prototype.warn = function () { | ||
} | ||
console.warn(messages.join(" ")); | ||
console.warn(messages.filter(function (_) { return typeof _ !== "undefined"; }).join(" ")); | ||
}; | ||
@@ -26,3 +26,3 @@ LoggingService.prototype.error = function () { | ||
} | ||
console.error(messages.join(" ")); | ||
console.error(messages.filter(function (_) { return typeof _ !== "undefined"; }).join(" ")); | ||
}; | ||
@@ -29,0 +29,0 @@ return LoggingService; |
@@ -29,8 +29,12 @@ "use strict"; | ||
} | ||
window.fetch(source).then(function (_response) { | ||
window | ||
.fetch(source) | ||
.then(function (_response) { | ||
if (_response.status >= 400) | ||
return LoggingService_1.loggingService.errorUnityLoaderNotFound(); | ||
_response.text().then(function (_text) { | ||
return LoggingService_1.loggingService.errorUnityLoaderNotFound(_response.status); | ||
_response | ||
.text() | ||
.then(function (_text) { | ||
if (_text.trim().charAt(0) === "<") | ||
return LoggingService_1.loggingService.errorUnityLoaderNotFound(); | ||
return LoggingService_1.loggingService.errorUnityLoaderNotFound("error doc"); | ||
_this.unityLoaderScript = document.createElement("script"); | ||
@@ -46,4 +50,6 @@ _this.unityLoaderScript.type = "text/javascript"; | ||
_this.documentHead.appendChild(_this.unityLoaderScript); | ||
}); | ||
}); | ||
}) | ||
.catch(function (_reason) { return LoggingService_1.loggingService.errorUnityLoaderNotFound(_reason); }); | ||
}) | ||
.catch(function (_reason) { return LoggingService_1.loggingService.errorUnityLoaderNotFound(_reason); }); | ||
}; | ||
@@ -50,0 +56,0 @@ return UnityLoaderService; |
{ | ||
"name": "react-unity-webgl", | ||
"version": "7.1.3", | ||
"version": "7.1.4", | ||
"description": "React Unity WebGL provides an easy solution for embedding Unity WebGL builds in your React application, with two-way communication between your React and Unity application with advanced API's.", | ||
@@ -5,0 +5,0 @@ "main": "./distribution/Exports.js", |
@@ -14,3 +14,3 @@ <div align="center"> | ||
__This package is an open source hobby project with ongoing development. A result of a long road since 2017, full of sleepless nights, working after hours, and busy weekends. If you're using this module for production, please consider [donating](https://paypal.me/jeffreylanters) to support the project. Thank you!__ 🥳 | ||
**This package is an open source hobby project with ongoing development. A result of a long road since 2017, full of sleepless nights, working after hours, and busy weekends. If you're using this module for production, please consider [donating](https://paypal.me/jeffreylanters) to support the project. Thank you!** 🥳 | ||
@@ -29,3 +29,3 @@ **≪** | ||
Install using npm. Make sure you download the release matching with your Unity version. I try to update this plugin in case of need as fast as possible. Check the [releases on GitHub](https://github.com/jeffreylanters/react-unity-webgl/releases) for the corresponding version or [view on NPM](https://www.npmjs.com/package/react-unity-webgl). | ||
Install using npm. Make sure you download the release matching with your Unity version. I try to update this plugin in case of need as fast as possible. Check the [releases on GitHub](https://github.com/jeffreylanters/react-unity-webgl/releases) for the corresponding version or [view on NPM](https://www.npmjs.com/package/react-unity-webgl). | ||
@@ -32,0 +32,0 @@ ```sh |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
60824
731