Skip to content
Advertisement

Phaser 3 with Unity Ads

I am trying to make a playable on Unity Ads using Phaser 3 but it seems that there are multiple specifications to use it, one of the Unity Ads specifications and as in their documentation “Advertisements should be designed not to need any network requests (XHR), but for example, analytics calls to track user interaction are allowed” So I don’t know how to add the Phaser CDN to my file. Note: the Playable should be in one file and images must be in base 64. So I need to know if there is an example of how to make playable on unity ads using phaser 3. The following code shows a black screen when I test it

JavaScript

Advertisement

Answer

I don’t really know how unity ads works, but you could simply inline the minified phaser-code-file into a script-tag above the gamecode, and so there are no calls to external source / cdn’s.

JavaScript

(This will obviously increase your html-file significantly (~ 1 MB), but works)

Tip: if you are using a bundler like webpack or so, this could be done automatically, maybe even images an such.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement