-
Notifications
You must be signed in to change notification settings - Fork 0
Home
This repository contains the code for the plugin which allows to register games on GX.Games and upload them. It also contains some simple game code for testing the plugin.
Open your project. Go to Window -> Package Manager. In the package manager window, press the "+" button in the top left corner. Select the option "Add package from git URL":
Enter the following URL in the text box:
https://github.com/opera-gaming/opera-unity-sdk.git?path=/Packages/com.opera.gx
Click Add. This is a link to the private repository. So you'll be prompted to authorize. It depends on the operational system you use (to be honest, I don't remember how I did this but I may reset the settings, try again and add the steps to the instruction if it's necessary:).
After the plugin is installed you should see it in the list of the packages.
Go to Edit -> Project Settings. Navigate to GX.Games options in the side panel:
Click the buttons "Copy the WebGL template..." and "Set Recommended Settings". The custom template is needed to suppress the most of the browser hotkeys when the play area of the web page is focused. The recommended settings change the compressing mode and set our custom template to be used for building the game.
Click the "Update" button near the label "You are not authorized" to get all the info from the cloud. It will fetch all the data from the cloud. After this step you'll be able to select the studio which will own your game:
Enter the name of the game.
Press "Build && Upload". You will be notified whether the uploading was successful or failed.
The process is similar. But before exporting the project you need to select it from the "Select Game" dropdown list:
Note that the most of the settings will be blocked. It is not allowed to change the game's parameters from the game editor (e.g., name, group etc). But it may be done in the browser. You can click "Edit game on Opera" to go to the game's settings page:
The build template suppresses the most of the hotkeys. But there are two combinations (or maybe more) which are protected from disabling. This is Ctrl+W
and Ctrl+Shift+W
which close the tab and the browser correspondingly. There is a way to disable them, but this method requires to show the warning popup which is also not acceptable. So it looks like the only way to disable them is to rearrange these key combinations in the browser itself, and it should be done by the user. As for Opera GX, it is possible to rearrange the hotkeys.
These hotkeys are not invoked in the fullscreen mode so it's not a problem here.
-
Unity uses so-called Ahead of Time (AOT) compilation when it builds projects for Web platform. It has some restrictions which may cause errors on running projects with certain C# features. This article describes the AOT limitations and contains recommendations to overcome them.
-
IndexedDB is not updated immediately after saving the files using C# functions. So you need to call a function FS.syncfs to immediately synchronize IndexedDB with the virtual file system. Refer to Assets/Plugins/HandleIO.jslib, to the usage of this code and to the Emscripten doc.