You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Install everything to your project EXCEPT files you changed. For example if you have a custom Assets/WebPlayerTemplates/HappyFunTimes/controller.html don't install over that.
Now open the project in Unity. You were probably using the PlayerSpawner or PlayerConnector script on one of your objects. (in the samples that's usually on an object called LevelManager). That script is probably missing now so reconnect it. Click the circle next to "Missing Script" and select PlayerSpawner or PlayerConnector, which ever one you were using before.
Rename Assets/WebPlayerTemplates/HappyFunTimes to Assets/WebPlayerTemplates/HappyFunTimes2. Make sure Unity is the front app. Then rename it back to Assets/WebPlayerTemplates/HappyFunTimes (this is because the new happyfuntimes has to copy files but it only copies new or modified files. Since your files already exist it can't tell. This rename makes it appear all the files are new).
Go to your PlayerSpawner or PlayerConnector. Under HappyFunTimes.Options put in the path to your controller.html The path is relative to Assets/WebPlayerTemplates/HappyFunTimes. If you were using the gamepad controller set the path to controllers/gamepad/controller.html
If you have a custom controller see below
Things to note:
No need to run HappyFunTimes any more
Installation mode can be run from inside the editor or from your exported game with a command line switch
Just build using the regular Unity build process. Publish on itch.io or whereever you want. (please tag with happyfuntimes
No more crazy weird HTML or CSS. You're in complete control. The only file you absolutely must include is /hft/hft.js (or it minimized version) /hft/hft-min.js Everything else is optional and up to you.
Fixing up custom controllers
If you had a custom controller.js or controller.html you'll need to do some editing. Look at one of the other controller.html files in Assets/WebPlayerTemplates/HappyFunTimes/controllers/.... Copy everything from the top of the file to the line
<div id="hft-content">
into the top of your controller.html. Then copy everything from
At the top of controller.js the samples get a bunch of global variables like this
var commonUI = window.sampleUI.commonUI;
var input = window.sampleUI.input;
var misc = window.sampleUI.misc;
var mobileHacks = window.sampleUI.mobileHacks;
var strings = window.sampleUI.strings;
var touch = window.sampleUI.touch;
Make sure those variables match your code. For example maybe you used upper case names like
var CommonUI = window.sampleUI.commonUI;
var Input = window.sampleUI.input;
var Misc = window.sampleUI.misc;
var MobileHacks = window.sampleUI.mobileHacks;
var Strings = window.sampleUI.strings;
var Touch = window.sampleUI.touch;
Look for your line
g_client = new GameClient();
And change it to
g_client = new hft.GameClient();
If your code was using client or some other variable keep the variable the same name, the important part is to change GameClient to hft.GameClient
commonUI.askForNameOnce(); // ask for the user's name if they haven't set one
commonUI.showMenu(true); // show the gear menu
Make sure commonUI's case matches your's. If you used CommonUI with an uppercase C then that instead. NOTE if you don't want the user to be asked for a name or you don't want the gear menu just leave those lines out.
Note if you don't want the user to be asked for their name or your don't want to show the gear menu you can leave one or both of those lines out.
The text was updated successfully, but these errors were encountered:
You can download it here
Please BACKUP YOUR WORK. Copy your entire project to a new folder and try this in the new folder
Steps
Assets/Plugins/HFTRunner.cs
,Assets/Plugins/HappyFunTimes.dll
, andAssets/Plugins/Editor/HappyFunTimesEditor.dll
Assets/WebPlayerTemplates/HappyFunTimes/controller.html
don't install over that.PlayerSpawner
orPlayerConnector
script on one of your objects. (in the samples that's usually on an object calledLevelManager
). That script is probably missing now so reconnect it. Click the circle next to "Missing Script" and selectPlayerSpawner
orPlayerConnector
, which ever one you were using before.Assets/WebPlayerTemplates/HappyFunTimes
toAssets/WebPlayerTemplates/HappyFunTimes2
. Make sure Unity is the front app. Then rename it back toAssets/WebPlayerTemplates/HappyFunTimes
(this is because the new happyfuntimes has to copy files but it only copies new or modified files. Since your files already exist it can't tell. This rename makes it appear all the files are new).PlayerSpawner
orPlayerConnector
. Under HappyFunTimes.Options put in the path to your controller.html The path is relative toAssets/WebPlayerTemplates/HappyFunTimes
. If you were using the gamepad controller set the path tocontrollers/gamepad/controller.html
Things to note:
happyfuntimes
/hft/hft.js
(or it minimized version)/hft/hft-min.js
Everything else is optional and up to you.Fixing up custom controllers
If you had a custom
controller.js
orcontroller.html
you'll need to do some editing. Look at one of the othercontroller.html
files inAssets/WebPlayerTemplates/HappyFunTimes/controllers/...
. Copy everything from the top of the file to the lineinto the top of your
controller.html
. Then copy everything fromto the end to the bottom of your
controller.html
file.Similarly compare your
controller.js
to one of the newcontroller.js
filesThe old structure looked like
The new structure removes everything except
And adds a few things.
At the top of
controller.js
the samples get a bunch of global variables like thisMake sure those variables match your code. For example maybe you used upper case names like
Look for your line
And change it to
If your code was using
client
or some other variable keep the variable the same name, the important part is to changeGameClient
tohft.GameClient
Look for a line like this
Add these two lines after
Make sure
commonUI
's case matches your's. If you usedCommonUI
with an uppercaseC
then that instead. NOTE if you don't want the user to be asked for a name or you don't want the gear menu just leave those lines out.Note if you don't want the user to be asked for their name or your don't want to show the gear menu you can leave one or both of those lines out.
The text was updated successfully, but these errors were encountered: