react-unity-webgl
Advanced tools
Comparing version 9.0.3 to 9.0.4
@@ -96,7 +96,7 @@ "use strict"; | ||
/** | ||
* @param type Defines the type of screenshot to take. | ||
* @param dataType Defines the type of screenshot to take. | ||
* @param quality Defines the quality of the screenshot. | ||
* @returns A base 64 encoded string of the screenshot. | ||
*/ | ||
function (type, quality) { | ||
function (dataType, quality) { | ||
if (unityInstance === null || | ||
@@ -109,4 +109,4 @@ typeof unityInstance.Module.canvas === "undefined") { | ||
// Takes a screenshot by converting Canvas's render-context's buffer into | ||
// a Data URL of the specified type and quality. | ||
return unityInstance.Module.canvas.toDataURL(type, quality); | ||
// a Data URL of the specified data type and quality. | ||
return unityInstance.Module.canvas.toDataURL(dataType, quality); | ||
}, [unityInstance]); | ||
@@ -117,7 +117,11 @@ /** | ||
*/ | ||
var unload = (0, react_1.useCallback)(function () { | ||
var unload = (0, react_1.useCallback)( | ||
/** | ||
* @returns A promise that resolves when the UnityInstance has been unloaded. | ||
*/ | ||
function () { | ||
if (unityInstance === null) { | ||
// Guarding the Unity Instance. | ||
console.warn(error_messages_1.errorMessages.quitNoUnityInstance); | ||
return; | ||
return Promise.reject(); | ||
} | ||
@@ -124,0 +128,0 @@ return unityInstance.Quit(); |
@@ -46,3 +46,3 @@ import { IUnityProvider } from "../interfaces/unity-provider"; | ||
*/ | ||
readonly takeScreenshot: (type: string, quality?: number) => string | undefined; | ||
readonly takeScreenshot: (dataType?: string, quality?: number) => string | undefined; | ||
/** | ||
@@ -58,6 +58,7 @@ * Lets you asynchronously ask for the pointer to be locked on the given Unity | ||
* unmounted from the DOM. | ||
* @returns A promise that resolves when the UnityInstance has been unloaded. | ||
*/ | ||
readonly unload: () => Promise<void> | undefined; | ||
readonly unload: () => Promise<void>; | ||
} | ||
export type { IUnityContextHook }; | ||
//# sourceMappingURL=unity-context-hook.d.ts.map |
{ | ||
"name": "react-unity-webgl", | ||
"version": "9.0.3", | ||
"version": "9.0.4", | ||
"description": "React Unity WebGL provides a modern solution for embedding Unity WebGL builds in your React Application while providing advanced APIs for two way communication and interaction between Unity and React.", | ||
@@ -27,4 +27,4 @@ "keywords": [ | ||
{ | ||
"type": "paypal", | ||
"url": "https://paypal.me/jeffreylanters" | ||
"type": "website", | ||
"url": "https://react-unity-webgl.dev/support" | ||
} | ||
@@ -31,0 +31,0 @@ ], |
@@ -13,7 +13,7 @@ <div align="center"> | ||
[](https://github.com/sponsors/jeffreylanters) | ||
[](https://paypal.me/jeffreylanters) | ||
[](https://react-unity-webgl.dev/support) | ||
[**Documentation**](https://react-unity-webgl.dev/) · | ||
[**Example Templates**](https://github.com/jeffreylanters/react-unity-webgl-templates/) · | ||
[**Sponsor the Project**](https://github.com/sponsors/jeffreylanters) · | ||
[**Example Templates**](https://github.com/jeffreylanters/react-unity-webgl-template/) · | ||
[**Support the project**](https://react-unity-webgl.dev/support) · | ||
[**Discussion Board**](https://github.com/jeffreylanters/react-unity-webgl/discussions) | ||
@@ -29,3 +29,3 @@ | ||
Hi there! I would like to say one more thing before you start bringing your awesome games to the web. My name is Jeffrey, I'm a Unity and Web developer with a passion for Open Source. The project you're looking at right now is one of my hobby projects. Maintaining and building this project is something I do in my spare time, and I have been doing so since 2017. React-Unity-WebGL will always remain free, but maining it and keeping up-to-date with Unity's updates takes a lot of work and tine. If you are able to, I would appreciate it greatly if you would consider [sending a donation](https://paypal.me/jeffreylanters) or [becoming a sponsor](https://github.com/sponsors/jeffreylanters) to help me keep this project going. | ||
Hi there! I would like to say one more thing before you start bringing your awesome games to the web. My name is Jeffrey Lanters, I'm a Unity and Web developer with a passion for Open Source. The project you're looking at right now is one of my hobby projects. Maintaining and building this project is something **I do in my spare time**, and I have been doing so since 2017. React-Unity-WebGL will **always remain free**, but adding new features, maintaining it and keeping up-to-date with Unity's updates takes a lot of work and time. If you are able to, I would appreciate it greatly if you would consider [sending a donation or becoming a sponsor](https://react-unity-webgl.dev/support) to help me keep this project going. | ||
@@ -32,0 +32,0 @@ Thanks for your time, happy coding! |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
79617
1373